[llvm] [GlobalISel][RISCV] Use constant pool for large integer constants. (PR #81101)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 22:13:29 PST 2024


================
@@ -451,17 +459,94 @@ 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.getSExtValue();
----------------
mgudim wrote:

done.

https://github.com/llvm/llvm-project/pull/81101


More information about the llvm-commits mailing list