diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -5236,7 +5236,7 @@ const SimplifyQuery &Q, unsigned MaxRecurse) { if (all_of(Mask, [](int Elem) { return Elem == PoisonMaskElem; })) - return UndefValue::get(RetTy); + return PoisonValue::get(RetTy); auto *InVecTy = cast(Op0->getType()); unsigned MaskNumElts = Mask.size(); @@ -5301,11 +5301,11 @@ })) { assert(isa(Op1) && "Expected undef operand 1 for splat"); - // Shuffle mask undefs become undefined constant result elements. + // Shuffle mask poisons become poison constant result elements. SmallVector VecC(MaskNumElts, C); for (unsigned i = 0; i != MaskNumElts; ++i) if (Indices[i] == -1) - VecC[i] = UndefValue::get(C->getType()); + VecC[i] = PoisonValue::get(C->getType()); return ConstantVector::get(VecC); } } diff --git a/llvm/test/Transforms/InstSimplify/shufflevector-inseltpoison.ll b/llvm/test/Transforms/InstSimplify/shufflevector-inseltpoison.ll --- a/llvm/test/Transforms/InstSimplify/shufflevector-inseltpoison.ll +++ b/llvm/test/Transforms/InstSimplify/shufflevector-inseltpoison.ll @@ -122,7 +122,7 @@ define <4 x i32> @undef_mask(<4 x i32> %x) { ; CHECK-LABEL: @undef_mask( -; CHECK-NEXT: ret <4 x i32> undef +; CHECK-NEXT: ret <4 x i32> poison ; %shuf = shufflevector <4 x i32> %x, <4 x i32> undef, <4 x i32> poison ret <4 x i32> %shuf @@ -130,7 +130,7 @@ define <4 x i32> @undef_mask_1(<4 x i32> %x, <4 x i32> %y) { ; CHECK-LABEL: @undef_mask_1( -; CHECK-NEXT: ret <4 x i32> undef +; CHECK-NEXT: ret <4 x i32> poison ; %shuf = shufflevector <4 x i32> %x, <4 x i32> %y, <4 x i32> poison ret <4 x i32> %shuf @@ -269,7 +269,7 @@ define <4 x float> @splat_inserted_constant_undef_elt(<4 x float> %x) { ; CHECK-LABEL: @splat_inserted_constant_undef_elt( -; CHECK-NEXT: ret <4 x float> +; CHECK-NEXT: ret <4 x float> ; %ins1 = insertelement <4 x float> %x, float 12.0, i32 1 %splat1 = shufflevector <4 x float> %ins1, <4 x float> poison, <4 x i32> @@ -278,7 +278,7 @@ define <2 x i8> @splat_inserted_constant_not_canonical(<3 x i8> %x, <3 x i8> %y) { ; CHECK-LABEL: @splat_inserted_constant_not_canonical( -; CHECK-NEXT: ret <2 x i8> +; CHECK-NEXT: ret <2 x i8> ; %ins2 = insertelement <3 x i8> %x, i8 23, i7 2 %splat2 = shufflevector <3 x i8> %y, <3 x i8> %ins2, <2 x i32> diff --git a/llvm/test/Transforms/InstSimplify/shufflevector.ll b/llvm/test/Transforms/InstSimplify/shufflevector.ll --- a/llvm/test/Transforms/InstSimplify/shufflevector.ll +++ b/llvm/test/Transforms/InstSimplify/shufflevector.ll @@ -122,7 +122,7 @@ define <4 x i32> @undef_mask(<4 x i32> %x) { ; CHECK-LABEL: @undef_mask( -; CHECK-NEXT: ret <4 x i32> undef +; CHECK-NEXT: ret <4 x i32> poison ; %shuf = shufflevector <4 x i32> %x, <4 x i32> undef, <4 x i32> undef ret <4 x i32> %shuf @@ -130,7 +130,7 @@ define <4 x i32> @undef_mask_1(<4 x i32> %x, <4 x i32> %y) { ; CHECK-LABEL: @undef_mask_1( -; CHECK-NEXT: ret <4 x i32> undef +; CHECK-NEXT: ret <4 x i32> poison ; %shuf = shufflevector <4 x i32> %x, <4 x i32> %y, <4 x i32> undef ret <4 x i32> %shuf @@ -269,7 +269,7 @@ define <4 x float> @splat_inserted_constant_undef_elt(<4 x float> %x) { ; CHECK-LABEL: @splat_inserted_constant_undef_elt( -; CHECK-NEXT: ret <4 x float> +; CHECK-NEXT: ret <4 x float> ; %ins1 = insertelement <4 x float> %x, float 12.0, i32 1 %splat1 = shufflevector <4 x float> %ins1, <4 x float> undef, <4 x i32> @@ -278,7 +278,7 @@ define <2 x i8> @splat_inserted_constant_not_canonical(<3 x i8> %x, <3 x i8> %y) { ; CHECK-LABEL: @splat_inserted_constant_not_canonical( -; CHECK-NEXT: ret <2 x i8> +; CHECK-NEXT: ret <2 x i8> ; %ins2 = insertelement <3 x i8> %x, i8 23, i7 2 %splat2 = shufflevector <3 x i8> %y, <3 x i8> %ins2, <2 x i32>