If the immediate is a shifted mask, we will use a pair of shifts
and never materialize the immediate. Consider the immediate free.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM.
llvm/test/Transforms/ConstantHoisting/RISCV/immediates.ll | ||
---|---|---|
85 | Nit: having a comment here with the rationale from the summary ("If the immediate is a shifted mask, we will use a pair of shifts and never materialize the immediate") would be convenient, since without the assembly code that might not be obvious. |
Comment Actions
LGTM as well w/the same comment on adding comments. I'd also encourage a comment on the helper routine which describes the pattern you're matching and why that makes the immediate free.
Nit: having a comment here with the rationale from the summary ("If the immediate is a shifted mask, we will use a pair of shifts and never materialize the immediate") would be convenient, since without the assembly code that might not be obvious.