[IR] Let IRBuilder's CreateVectorSplat/CreateShuffleVector use poison as placeholder

This patch updates IRBuilder to create insertelement/shufflevector using poison as a placeholder.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D93793

GitOrigin-RevId: 278aa65cc495b2f548018eb2fd96351d36b4591f
diff --git a/test/Isl/CodeGen/invariant_load_hoist_alignment.ll b/test/Isl/CodeGen/invariant_load_hoist_alignment.ll
index 52ea061..59f92cb 100644
--- a/test/Isl/CodeGen/invariant_load_hoist_alignment.ll
+++ b/test/Isl/CodeGen/invariant_load_hoist_alignment.ll
@@ -17,7 +17,7 @@
   %indvar = phi i64 [ 0, %entry ], [ %indvar_next, %body ]
   %scevgep = getelementptr [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvar
 ; CHECK: [[T2:%.load]] = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @A, i32 0, i32 0), align 4
-; CHECK: %value_p.splatinsert = insertelement <4 x i32> undef, i32 [[T2]], i32 0
+; CHECK: %value_p.splatinsert = insertelement <4 x i32> poison, i32 [[T2]], i32 0
   %value = load i32, i32* getelementptr inbounds ([1024 x i32], [1024 x i32]* @A, i64 0, i64 0), align 4
   %result = tail call i32 @foo(i32 %value) nounwind
   store i32 %result, i32* %scevgep, align 4
diff --git a/test/Isl/CodeGen/simple_vec_cast.ll b/test/Isl/CodeGen/simple_vec_cast.ll
index 8991a07..c3ee183 100644
--- a/test/Isl/CodeGen/simple_vec_cast.ll
+++ b/test/Isl/CodeGen/simple_vec_cast.ll
@@ -32,7 +32,7 @@
 ; CHECK:   %.load = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i32 0, i32 0)
 
 ; CHECK: polly.stmt.bb2:                                   ; preds = %polly.start
-; CHECK:   %tmp_p.splatinsert = insertelement <4 x float> undef, float %.load, i32 0
-; CHECK:   %tmp_p.splat = shufflevector <4 x float> %tmp_p.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
+; CHECK:   %tmp_p.splatinsert = insertelement <4 x float> poison, float %.load, i32 0
+; CHECK:   %tmp_p.splat = shufflevector <4 x float> %tmp_p.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
 ; CHECK:   %0 = fpext <4 x float> %tmp_p.splat to <4 x double>
 ; CHECK:   store <4 x double> %0, <4 x double>*
diff --git a/test/Isl/CodeGen/simple_vec_const.ll b/test/Isl/CodeGen/simple_vec_const.ll
index 62acccb..f3641c1 100644
--- a/test/Isl/CodeGen/simple_vec_const.ll
+++ b/test/Isl/CodeGen/simple_vec_const.ll
@@ -56,5 +56,5 @@
 ; CHECK:   %.load = load float, float* getelementptr inbounds ([1024 x float], [1024 x float]* @A, i32 0, i32 0)
 
 ; CHECK: polly.stmt.:                                      ; preds = %polly.start
-; CHECK:   %_p.splatinsert = insertelement <4 x float> undef, float %.load, i32 0
-; CHECK:   %_p.splat = shufflevector <4 x float> %_p.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
+; CHECK:   %_p.splatinsert = insertelement <4 x float> poison, float %.load, i32 0
+; CHECK:   %_p.splat = shufflevector <4 x float> %_p.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
diff --git a/test/Isl/CodeGen/simple_vec_ptr_ptr_ty.ll b/test/Isl/CodeGen/simple_vec_ptr_ptr_ty.ll
index 13cc9aa..b645ece 100644
--- a/test/Isl/CodeGen/simple_vec_ptr_ptr_ty.ll
+++ b/test/Isl/CodeGen/simple_vec_ptr_ptr_ty.ll
@@ -26,6 +26,6 @@
 ; CHECK:   %.load = load float**, float*** getelementptr inbounds ([1024 x float**], [1024 x float**]* @A, i32 0, i32 0)
 
 ; CHECK-NOT: load <1 x float**>
-; CHECK: %value_p.splatinsert = insertelement <4 x float**> undef, float** %.load, i32 0
-; CHECK: %value_p.splat = shufflevector <4 x float**> %value_p.splatinsert, <4 x float**> undef, <4 x i32> zeroinitializer
+; CHECK: %value_p.splatinsert = insertelement <4 x float**> poison, float** %.load, i32 0
+; CHECK: %value_p.splat = shufflevector <4 x float**> %value_p.splatinsert, <4 x float**> poison, <4 x i32> zeroinitializer
 ; CHECK: store <4 x float**> %value_p.splat, <4 x float**>* bitcast ([1024 x float**]* @B to <4 x float**>*), align 8