[llvm] Add FeatureFuseLiterals as SubTargetFeature for Grace and Olympus (PR #160257)

David Green via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 02:34:15 PDT 2025


================
@@ -12564,6 +12564,17 @@ bool AArch64TargetLowering::isOffsetFoldingLegal(
 
 bool AArch64TargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT,
                                          bool OptForSize) const {
+  // If the constant to be materialized is scalar, it maybe efficient to use
+  // sequence of 'mov + fmov' rather than 'adrp + ldr' on specified CPU's.
+  // However, when materializing vector of constants, there are two things to
+  // note:
+  // 1. Throughput of fmov instruction is very low.
+  // 2. ldr instruction can load multiple constants in one go. Also, it's
+  // throughput is higher as compared to fmov.
----------------
davemgreen wrote:

Does this say "fmovs limit throughput, loads are great", but then goes on to use the fmov version for these cpus?

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


More information about the llvm-commits mailing list