diff --git a/llvm/test/Transforms/InstCombine/sub-of-negatible.ll b/llvm/test/Transforms/InstCombine/sub-of-negatible.ll index f2a28c0dd02b3..72fd7f7be2b04 100644 --- a/llvm/test/Transforms/InstCombine/sub-of-negatible.ll +++ b/llvm/test/Transforms/InstCombine/sub-of-negatible.ll @@ -1385,6 +1385,19 @@ define i8 @dont_negate_ordinary_select(i8 %x, i8 %y, i8 %z, i1 %c) { ret i8 %t1 } +; FIXME: This is a miscompile. +define <2 x i32> @negate_select_of_negation_poison(<2 x i1> %c, <2 x i32> %x) { +; CHECK-LABEL: @negate_select_of_negation_poison( +; CHECK-NEXT: [[NEG:%.*]] = sub <2 x i32> , [[X:%.*]] +; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C:%.*]], <2 x i32> [[X]], <2 x i32> [[NEG]] +; CHECK-NEXT: ret <2 x i32> [[TMP1]] +; + %neg = sub <2 x i32> , %x + %sel = select <2 x i1> %c, <2 x i32> %neg, <2 x i32> %x + %neg2 = sub <2 x i32> zeroinitializer, %sel + ret <2 x i32> %neg2 +} + ; Freeze is transparent as far as negation is concerned define i4 @negate_freeze(i4 %x, i4 %y, i4 %z) { ; CHECK-LABEL: @negate_freeze(