diff --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c --- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c +++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector-constrained.c @@ -37,7 +37,7 @@ // CHECK-ASM: vlvgg vd = vec_promote(d, idx); - // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x double> poison, double %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vd = vec_insert_and_zero(cptrd); diff --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector.c --- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector.c +++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector.c @@ -166,31 +166,31 @@ // CHECK-ASM: vlvgg vsc = vec_promote(sc, idx); - // CHECK: insertelement <16 x i8> undef, i8 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <16 x i8> poison, i8 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgb vuc = vec_promote(uc, idx); - // CHECK: insertelement <16 x i8> undef, i8 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <16 x i8> poison, i8 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgb vss = vec_promote(ss, idx); - // CHECK: insertelement <8 x i16> undef, i16 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <8 x i16> poison, i16 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgh vus = vec_promote(us, idx); - // CHECK: insertelement <8 x i16> undef, i16 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <8 x i16> poison, i16 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgh vsi = vec_promote(si, idx); - // CHECK: insertelement <4 x i32> undef, i32 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <4 x i32> poison, i32 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgf vui = vec_promote(ui, idx); - // CHECK: insertelement <4 x i32> undef, i32 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <4 x i32> poison, i32 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgf vsl = vec_promote(sl, idx); - // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x i64> poison, i64 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vul = vec_promote(ul, idx); - // CHECK: insertelement <2 x i64> undef, i64 %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x i64> poison, i64 %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vd = vec_promote(d, idx); - // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x double> poison, double %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vsc = vec_insert_and_zero(cptrsc); diff --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-constrained.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-constrained.c --- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-constrained.c +++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2-constrained.c @@ -70,10 +70,10 @@ // CHECK-ASM: vlvgg vf = vec_promote(f, idx); - // CHECK: insertelement <4 x float> undef, float %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <4 x float> poison, float %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgf vd = vec_promote(d, idx); - // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x double> poison, double %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vf = vec_insert_and_zero(cptrf); diff --git a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2.c b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2.c --- a/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2.c +++ b/clang/test/CodeGen/SystemZ/builtins-systemz-zvector2.c @@ -102,10 +102,10 @@ // CHECK-ASM: vlvgg vf = vec_promote(f, idx); - // CHECK: insertelement <4 x float> undef, float %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <4 x float> poison, float %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgf vd = vec_promote(d, idx); - // CHECK: insertelement <2 x double> undef, double %{{.*}}, i32 %{{.*}} + // CHECK: insertelement <2 x double> poison, double %{{.*}}, i32 %{{.*}} // CHECK-ASM: vlvgg vf = vec_insert_and_zero(cptrf); diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -710,9 +710,9 @@ ElementCount::get(MaskNumElts, isa(V1VTy)); Type *EltTy = V1VTy->getElementType(); - // Undefined shuffle mask -> undefined value. + // Poison shuffle mask -> poison value. if (all_of(Mask, [](int Elt) { return Elt == PoisonMaskElem; })) { - return UndefValue::get(VectorType::get(EltTy, MaskEltCount)); + return PoisonValue::get(VectorType::get(EltTy, MaskEltCount)); } // If the mask is all zeros this is a splat, no need to go through all diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -2290,7 +2290,7 @@ SmallVector MaskConst; for (int Elem : Mask) { if (Elem == PoisonMaskElem) - MaskConst.push_back(UndefValue::get(Int32Ty)); + MaskConst.push_back(PoisonValue::get(Int32Ty)); else MaskConst.push_back(ConstantInt::get(Int32Ty, Elem)); } diff --git a/llvm/test/Transforms/InstCombine/shufflevec-constant.ll b/llvm/test/Transforms/InstCombine/shufflevec-constant.ll --- a/llvm/test/Transforms/InstCombine/shufflevec-constant.ll +++ b/llvm/test/Transforms/InstCombine/shufflevec-constant.ll @@ -18,7 +18,7 @@ define <4 x i1> @shuffle_undef_fixed() { ; CHECK-LABEL: @shuffle_undef_fixed( -; CHECK-NEXT: ret <4 x i1> undef +; CHECK-NEXT: ret <4 x i1> poison ; %S = shufflevector <4 x i1> zeroinitializer, <4 x i1> zeroinitializer, <4 x i32> undef ret <4 x i1> %S @@ -26,7 +26,7 @@ define @suffle_undef_scalable() { ; CHECK-LABEL: @suffle_undef_scalable( -; CHECK-NEXT: ret undef +; CHECK-NEXT: ret poison ; %S = shufflevector zeroinitializer, zeroinitializer, undef ret %S