[llvm] [AArch64] Fix #94909: Optimize vector fmul(sitofp(x), 0.5) -> scvtf(x, 2) (PR #141480)

David Green via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 14:52:16 PDT 2025


================
@@ -3952,6 +3960,156 @@ static bool checkCVTFixedPointOperandWithFBits(SelectionDAG *CurDAG, SDValue N,
   return true;
 }
 
+static bool checkCVTFixedPointOperandWithFBitsForVectors(SelectionDAG *CurDAG,
+                                                         SDValue N,
+                                                         SDValue &FixedPos,
+                                                         unsigned RegWidth,
+                                                         bool isReciprocal) {
+
+  // Fast Path
+  if (N.getOpcode() == ISD::BUILD_VECTOR) {
----------------
davemgreen wrote:

I think this can use isConstantSplatVector to check for BUILD_VECTOR or SPLAT, and then some extra logic to check for DUP of a constant or MOVIshift.

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


More information about the llvm-commits mailing list