[llvm] [SelectionDAG] Fold extracts of subvector inserts (PR #201271)

Krzysztof Drewniak via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 16 11:52:26 PDT 2026


================
@@ -27575,20 +27575,40 @@ SDValue DAGCombiner::visitEXTRACT_SUBVECTOR(SDNode *N) {
         return DAG.getSplatVector(NVT, DL, V.getOperand(0));
 
   // extract_subvector(insert_subvector(x,y,c1),c2)
+  //  --> extract_subvector(x,c2)
----------------
krzysz00 wrote:

Ok, yeah, looks like, of the two folds I'm adding here, the one that you disliked the fix for is the load-bearing one in "make the compiler stop spinning forever".

https://gist.github.com/krzysz00/de0efa4204b07e3667a6b67b8856dfa4 has the triggering input (which is stubbornly resisting my attempts to make a good testcase out of it)

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


More information about the llvm-commits mailing list