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

Sushant Gokhale via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 03:35:38 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.
+  if (!VT.isVector() && (Subtarget->getCPU() == "neoverse-v2" ||
+                         Subtarget->getCPU() == "olympus"))
----------------
sushgokh wrote:

ok sure

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


More information about the llvm-commits mailing list