[llvm] [X86] Prefer SIMD min/max/abs for scalars when staying in XMM domain (PR #210654)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 03:26:11 PDT 2026


================
@@ -54649,6 +54649,143 @@ static SDValue narrowBitOpRMW(StoreSDNode *St, const SDLoc &DL,
   return NewStore;
 }
 
+/// True if V is a plain (non-extending) load of VT. Don't peek through
+/// bitcasts: that could pull a float-domain value into an integer vector.
+static bool isPlainScalarLoad(SDValue V, EVT VT) {
+  auto *Ld = dyn_cast<LoadSDNode>(V);
+  if (!Ld || Ld->getExtensionType() != ISD::NON_EXTLOAD)
+    return false;
+  return Ld->getMemoryVT() == VT;
+}
----------------
RKSimon wrote:

just use ISD::isNormalLoad

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


More information about the llvm-commits mailing list