Optimize (mul x, imm) to (ADD (SLLI x, s0), (SLLI x, s1)) or
(SUB (SLLI x, s0), (SLLI x, s1)) if possible.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The changes LGTM except a nit in comments. Thanks.
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 3169 | Seems this condition only applies to ADD but no SUB. For example, in below test, 65280 is 0xff00 which has 8 consecutive set bits. | |
| llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp | ||
|---|---|---|
| 3169 | Thanks. Fixed. | |
Seems this condition only applies to ADD but no SUB. For example, in below test, 65280 is 0xff00 which has 8 consecutive set bits.