[llvm] [Hexagon] Implement shouldConvertConstantLoadToIntImm (PR #146452)
Sudharsan Veeravalli via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 30 20:06:12 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;
+
----------------
svs-quic wrote:
I am not sure if this will always give us wins in terms of code size. That's the reason I put in a flag. Maybe if we can get more data on this to prove that it will give us wins the majority of the time then we can remove the flag somewhere down the line.
https://github.com/llvm/llvm-project/pull/146452
More information about the llvm-commits
mailing list