This builds on D132771 to invert (setlt 0, X) to (setlt X, 1) and
vice versa.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9188 | I think we can generalize this for any constant operand where adding one doesn't overflow? If so, mind doing that in a follow up? |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9188 | Its more complicated because the constant on the LHS can't be folded into the instruction. 0 is special because it will select x0. But I'll try to see if there is anything that makes sense. |
llvm/lib/Target/RISCV/RISCVISelLowering.cpp | ||
---|---|---|
9188 | Good point on the constant LHS bit. Hadn't considered that. |
I think we can generalize this for any constant operand where adding one doesn't overflow? If so, mind doing that in a follow up?