As far as arithmetic right shift always saves the sign, shift can be omitted to check if number is positive or negative.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
During fixing this case I had a question why RISCV doesn't use SimplifySetCC from common TargetLowering. It seems that there are some cases of combinations that should work for RISCV. I tried to call it, but found cases that crashes compilations on RISCV. Are there any plans to rework this part and reuse some part of foldings from common lowering? It seems that some optimizations can be lost, doesn't it?
Comment Actions
It should be called from DAGCombiner both before and after type legalization. I think the issue here is that the setcc is merged into RISCVISD::BR_CC before the sign_extend_inreg is converted to shl+sra.
llvm/test/CodeGen/RISCV/branch_zero.ll | ||
---|---|---|
11 | Can you construct a test for GE too? |
Can you construct a test for GE too?