-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDAG][RISCV] vnsrl pattern is broken after PR93182 #94265
Comments
@llvm/issue-subscribers-backend-risc-v Author: Yingwei Zheng (dtcxzyw)
See the diff of file `result/rvv/193fc4d8b7725d32.S` in https://github.com/dtcxzyw/llvm-codegen-benchmark/commit/c134d37047d3e6ee2336279936f98a6eab922e77#diff-bc8f186427aa6515f00cd4d764feea719d5d90240f5602f6a8acf2e114cc9660
Before:
After #93182:
I think the following code breaks vnsrl (i.e., trunc (srl X, C)) pattern: llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp Lines 2609 to 2618 in 2ee7f49
Do we need a TLI hook to query whether (trunc (srl X, C)) is natively supported? cc @RKSimon @topperc |
There is a isTypeDesirableForOp check after type legalization - is that not working? |
RISC-V target doesn't override this method. I think we need a new hook like |
Why can't it use isTypeDesirableForOp ? |
ISD::SRL is legal for both v8i32 and v8i16 on RISCV with rvv. |
What about if we updated isTypeDesirableForOp to take NewVT + OldVT arguments? I always worry when we add yet another TLI hook :( |
It sounds reasonable. |
May I get assigned to this issue? I'm guided by @dtcxzyw. |
…lvm#95563) Added a RISCV overload of `isTruncateFree` to fix the break of vnsrl described in issue llvm#94265. Fixes llvm#94265
See the diff of file
result/rvv/193fc4d8b7725d32.S
in dtcxzyw/llvm-codegen-benchmark@c134d37#diff-bc8f186427aa6515f00cd4d764feea719d5d90240f5602f6a8acf2e114cc9660Before:
After #93182:
I think the following code breaks vnsrl (i.e., trunc (srl X, C)) pattern:
llvm-project/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Lines 2609 to 2618 in 2ee7f49
Do we need a TLI hook to query whether (trunc (srl X, C)) is natively supported?
cc @RKSimon @topperc
The text was updated successfully, but these errors were encountered: