[llvm] [X86] Optimize v4i16->v4i8 truncating stores via v4i32 widening (PR #186676)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 15 09:33:58 PDT 2026


================
@@ -54294,6 +54294,20 @@ static SDValue combineStore(SDNode *N, SelectionDAG &DAG,
   EVT VT = StoredVal.getValueType();
   const TargetLowering &TLI = DAG.getTargetLoweringInfo();
 
+  // Pattern: store(trunc(load v4i16) to v4i8)
+  if (!St->isTruncatingStore() && VT == MVT::v4i8 && Subtarget.hasAVX512() &&
+      StoredVal.getOpcode() == ISD::TRUNCATE &&
----------------
RKSimon wrote:

Can this be done more tidily as a sd_match pattern?

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


More information about the llvm-commits mailing list