[llvm] [AMDGPU][ISEL] Use target specific hook to block narrowing insert-extract sub-vector (PR #201056)

via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 01:23:08 PDT 2026


================
@@ -27207,6 +27207,13 @@ static SDValue narrowInsertExtractVectorBinOp(EVT SubVT, SDValue BinOp,
   if (!Sub0 || !Sub1)
     return SDValue();
 
+  // Every user of the wide binop must be an EXTRACT_SUBVECTOR; otherwise the
+  // wide binop will still be needed and this transform would not eliminate it.
+  for (SDNode *User : BinOp->users()) {
+    if (User->getOpcode() != ISD::EXTRACT_SUBVECTOR)
+      return SDValue();
+  }
----------------
Shoreshen wrote:

Hi @RKSimon , this is not correct, I'm still working on this. Basically it need 2 condition:
1. The other users are all EXTRACT_SUBVECTOR
2. These EXTRACT_SUBVECTOR are still waiting for combine, so they will be eliminated by this function.

There will be a regression in one of the x86 case.

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


More information about the llvm-commits mailing list