[llvm] [DAGCombiner] Fold insert_vector_elt into a shared BUILD_VECTOR with undef lanes (PR #210905)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 01:15:48 PDT 2026


================
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
+; RUN: llc -mtriple=amdgpu9.00 < %s | FileCheck %s
+
+; Two vectors are derived from the same poison-padded base constant. CSE shares
+; the base BUILD_VECTOR; the combine rebuilds each insert as its own
+; BUILD_VECTOR so the shared base does not force copies of its unused lanes.
+define amdgpu_kernel void @shared_poison_base(i32 %a, i32 %b, ptr addrspace(1) %out0, ptr addrspace(1) %out1) {
----------------
arsenm wrote:

Prefer testing with not-kernels

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


More information about the llvm-commits mailing list