Add with immediates in the range [-4096, -2049] or [2048, 4095] get
convert to two ADDIs. Teach RISCVMergeBaseOffset to recognize this
pattern as well.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM.
llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp | ||
---|---|---|
209–223 | BTW, shouldn't the preexisting code check the type of the tail ADDI immediate machine operand (that it is MO_Immediate or something like that)? If so, then the same applies to this second ADDI. |
llvm/lib/Target/RISCV/RISCVMergeBaseOffset.cpp | ||
---|---|---|
209–223 | I think it has to be an immediate because we started from a global address LUI+ADDI pair. Any user of that could only be an ADDI with a real immediate. It couldn't be part of another global address and it couldn't be a frame index. |
BTW, shouldn't the preexisting code check the type of the tail ADDI immediate machine operand (that it is MO_Immediate or something like that)? If so, then the same applies to this second ADDI.