diff --git a/llvm/test/Transforms/InstCombine/and-or-icmps.ll b/llvm/test/Transforms/InstCombine/and-or-icmps.ll index e5aa3a184fab..ddb3fbc283f5 100644 --- a/llvm/test/Transforms/InstCombine/and-or-icmps.ll +++ b/llvm/test/Transforms/InstCombine/and-or-icmps.ll @@ -177,5 +177,31 @@ define i1 @and_ne_with_diff_one_signed(i64 %x) { ret i1 %and } +; FIXME: Vectors with splat constants get the same folds. +define <2 x i1> @or_eq_with_one_bit_diff_constants2_splatvec(<2 x i32> %x) { +; CHECK-LABEL: @or_eq_with_one_bit_diff_constants2_splatvec( +; CHECK-NEXT: [[CMP1:%.*]] = icmp eq <2 x i32> %x, +; CHECK-NEXT: [[CMP2:%.*]] = icmp eq <2 x i32> %x, +; CHECK-NEXT: [[OR:%.*]] = or <2 x i1> [[CMP1]], [[CMP2]] +; CHECK-NEXT: ret <2 x i1> [[OR]] +; + %cmp1 = icmp eq <2 x i32> %x, + %cmp2 = icmp eq <2 x i32> %x, + %or = or <2 x i1> %cmp1, %cmp2 + ret <2 x i1> %or +} + +define <2 x i1> @and_ne_with_diff_one_splatvec(<2 x i32> %x) { +; CHECK-LABEL: @and_ne_with_diff_one_splatvec( +; CHECK-NEXT: [[CMP1:%.*]] = icmp ne <2 x i32> %x, +; CHECK-NEXT: [[CMP2:%.*]] = icmp ne <2 x i32> %x, +; CHECK-NEXT: [[AND:%.*]] = and <2 x i1> [[CMP1]], [[CMP2]] +; CHECK-NEXT: ret <2 x i1> [[AND]] +; + %cmp1 = icmp ne <2 x i32> %x, + %cmp2 = icmp ne <2 x i32> %x, + %and = and <2 x i1> %cmp1, %cmp2 + ret <2 x i1> %and +}