[llvm] [Hexagon] Implement shouldConvertConstantLoadToIntImm (PR #146452)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 30 19:45:35 PDT 2025


================
@@ -3607,6 +3611,18 @@ bool HexagonTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT,
   return true;
 }
 
+/// Returns true if it is beneficial to convert a load of a constant
+/// to just the constant itself.
+bool HexagonTargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
+                                                              Type *Ty) const {
+  if (!ConstantLoadsToImm)
+    return false;
+
----------------
aankit-ca wrote:

Does this change really need to be controlled by a flag? I feel this change can go in without a flag control. 

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


More information about the llvm-commits mailing list