[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 21:30:37 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();
----------------
mgudim wrote:

yes, my bad, thanks. In non-global version it's also `SExt`. 

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


More information about the llvm-commits mailing list