[llvm] [GlobalISel][RISCV] Use constant pool for large integer constants. (PR #81101)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 8 17:56:49 PST 2024
================
@@ -451,17 +460,97 @@ bool RISCVLegalizerInfo::legalizeVAStart(MachineInstr &MI,
return true;
}
+bool RISCVLegalizerInfo::shouldBeInConstantPool(APInt APImm,
+ bool shouldOptForSize) const {
+ unsigned BitWidth = APImm.getBitWidth();
+ assert(BitWidth == 32 || BitWidth == 64);
+ uint64_t Imm = APImm.getZExtValue();
----------------
topperc wrote:
I think this should be getSExtValue()? Otherwise the isInt<32> will always fail on BitWidth==32.
https://github.com/llvm/llvm-project/pull/81101
More information about the llvm-commits
mailing list