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

JP Hafer via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 06:59:30 PDT 2025


================
@@ -3952,6 +3960,129 @@ static bool checkCVTFixedPointOperandWithFBits(SelectionDAG *CurDAG, SDValue N,
   return true;
 }
 
+static bool checkCVTFixedPointOperandWithFBitsForVectors(SelectionDAG *CurDAG,
+                                                         SDValue N,
+                                                         SDValue &FixedPos,
+                                                         unsigned FloatWidth,
+                                                         bool isReciprocal) {
+
+  // N must be a bitcast/nvcast of a vector float type.
+  if (!((N.getOpcode() == ISD::BITCAST ||
+         N.getOpcode() == AArch64ISD::NVCAST) &&
+        N.getValueType().isVector() && N.getValueType().isFloatingPoint())) {
----------------
jph-13 wrote:

But the input is a vector of ints at this point no?

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


More information about the llvm-commits mailing list