Test Failure: Transforms/InstSimplify/compare.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i1 @ptrtoint() {
%0:
  %a = alloca i64 1, align 1
  %tmp = ptrtoint * %a to i32
  %r = icmp eq i32 %tmp, 0
  ret i1 %r
}
=>
define i1 @ptrtoint() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @bitcast() {
%0:
  %a = alloca i64 4, align 4
  %b = alloca i64 8, align 8
  %x = bitcast * %a to *
  %y = bitcast * %b to *
  %cmp = icmp eq * %x, %y
  ret i1 %cmp
}
=>
define i1 @bitcast() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep() {
%0:
  %a = alloca i64 3, align 8
  %x = gep inbounds * %a, 3 x i32 0, 1 x i32 0
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep2() {
%0:
  %a = alloca i64 3, align 8
  %x = gep inbounds * %a, 3 x i32 0, 1 x i32 0
  %y = gep inbounds * %a, 3 x i32 0, 1 x i32 0
  %cmp = icmp eq * %x, %y
  ret i1 %cmp
}
=>
define i1 @gep2() {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep3() {
%0:
  %x = alloca i64 8, align 8
  %a = gep * %x, 8 x i64 0, 1 x i64 0
  %b = gep * %x, 8 x i64 0, 1 x i64 4
  %equal = icmp eq * %a, %b
  ret i1 %equal
}
=>
define i1 @gep3() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
@gepy = global 8 bytes, align 8

define i1 @gep4() {
%0:
  %x = alloca i64 8, align 8
  %a = gep * @gepy, 8 x i64 0, 1 x i64 0
  %b = gep * @gepy, 8 x i64 0, 1 x i64 4
  %equal = icmp eq * %a, %b
  ret i1 %equal
}
=>
@gepy = global 8 bytes, align 8

define i1 @gep4() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
@a = global 4 bytes, align 4

define i1 @PR31262() {
%0:
  %idx = gep inbounds * @a, 4 x i64 0, 4 x i64 undef
  %__constexpr_0 = gep inbounds * @a, 4 x i32 0, 4 x i32 0
  %cmp = icmp uge * %idx, %__constexpr_0
  ret i1 %cmp
}
=>
@a = global 4 bytes, align 4

define i1 @PR31262() {
%0:
  %__constexpr_1 = gep * @a, 4 x i32 0, 4 x i32 undef
  %__constexpr_2 = gep inbounds * @a, 4 x i32 0, 4 x i32 0
  %__constexpr_0 = icmp uge * %__constexpr_1, %__constexpr_2
  ret i1 %__constexpr_0
}
Transformation seems to be correct!


----------------------------------------
@gepy = global 8 bytes, align 8

define i1 @gep5() {
%0:
  %x = alloca i64 8, align 8
  %a = gep inbounds * %x, 8 x i64 0, 1 x i64 4
  %b = gep * @gepy, 8 x i64 0, 1 x i64 0
  %equal = icmp eq * %a, %b
  ret i1 %equal
}
=>
@gepy = global 8 bytes, align 8

define i1 @gep5() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep6(* %x) {
%0:
  %a = gep * %x, 8 x i64 0, 1 x i64 0
  %b = gep * %x, 8 x i64 0, 1 x i64 4
  %equal = icmp eq * %a, %b
  ret i1 %equal
}
=>
define i1 @gep6(* %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
@gepz = global 8 bytes, align 4

define i1 @gep7(* %x) {
%0:
  %a = gep * %x, 8 x i64 0, 1 x i64 0
  %b = gep * @gepz, 8 x i64 0, 1 x i64 0
  %equal = icmp eq * %a, %b
  ret i1 %equal
}
=>
@gepz = global 8 bytes, align 4

define i1 @gep7(* %x) {
%0:
  %a = gep * %x, 8 x i64 0, 1 x i64 0
  %__constexpr_0 = gep * @gepz, 8 x i32 0, 1 x i64 0
  %equal = icmp eq * %a, %__constexpr_0
  ret i1 %equal
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep8(* %x) {
%0:
  %a = gep * %x, 8 x i32 1
  %b = gep * %x, 8 x i32 4294967295
  %equal = icmp ugt * %a, %b
  ret i1 %equal
}
=>
define i1 @gep8(* %x) {
%0:
  %a = gep * %x, 8 x i32 1
  %b = gep * %x, 8 x i32 4294967295
  %equal = icmp ugt * %a, %b
  ret i1 %equal
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep9(* %ptr) {
%entry:
  %first1 = gep inbounds * %ptr, 1 x i32 0
  %first2 = gep inbounds * %first1, 1 x i32 1
  %first3 = gep inbounds * %first2, 1 x i32 2
  %first4 = gep inbounds * %first3, 1 x i32 4
  %last1 = gep inbounds * %first2, 1 x i32 48
  %last2 = gep inbounds * %last1, 1 x i32 8
  %last3 = gep inbounds * %last2, 1 x i32 4294967292
  %last4 = gep inbounds * %last3, 1 x i32 4294967292
  %first.int = ptrtoint * %first4 to i32
  %last.int = ptrtoint * %last4 to i32
  %cmp = icmp ne i32 %last.int, %first.int
  ret i1 %cmp
}
=>
define i1 @gep9(* %ptr) {
%entry:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep10(* %ptr) {
%entry:
  %first1 = gep inbounds * %ptr, 1 x i32 4294967294
  %first2 = gep inbounds * %first1, 1 x i32 44
  %last1 = gep inbounds * %ptr, 1 x i32 48
  %last2 = gep inbounds * %last1, 1 x i32 4294967290
  %first.int = ptrtoint * %first2 to i32
  %last.int = ptrtoint * %last2 to i32
  %cmp = icmp eq i32 %last.int, %first.int
  ret i1 %cmp
}
=>
define i1 @gep10(* %ptr) {
%entry:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep11(* %ptr) {
%entry:
  %first1 = gep inbounds * %ptr, 1 x i32 4294967294
  %last1 = gep inbounds * %ptr, 1 x i32 48
  %last2 = gep inbounds * %last1, 1 x i32 4294967290
  %cmp = icmp ult * %first1, %last2
  ret i1 %cmp
}
=>
define i1 @gep11(* %ptr) {
%entry:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep12(* %ptr) {
%entry:
  %first1 = gep inbounds * %ptr, 1 x i32 4294967294
  %last1 = gep inbounds * %ptr, 1 x i32 48
  %last2 = gep inbounds * %last1, 1 x i32 4294967290
  %cmp = icmp slt * %first1, %last2
  ret i1 %cmp
}
=>
define i1 @gep12(* %ptr) {
%entry:
  %first1 = gep inbounds * %ptr, 1 x i32 4294967294
  %last1 = gep inbounds * %ptr, 1 x i32 48
  %last2 = gep inbounds * %last1, 1 x i32 4294967290
  %cmp = icmp slt * %first1, %last2
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep13(* %ptr) {
%0:
  %x = gep inbounds * %ptr, 1 x i32 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep13(* %ptr) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep13_no_null_opt(* %ptr) {
%0:
  %x = gep inbounds * %ptr, 1 x i32 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep13_no_null_opt(* %ptr) {
%0:
  %x = gep inbounds * %ptr, 1 x i32 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep14(* %ptr) {
%0:
  %x = gep inbounds * %ptr, 1 x i32 0, 1 x i64 0
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep14(* %ptr) {
%0:
  %x = gep inbounds * %ptr, 1 x i32 0, 1 x i64 0
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep15(* %ptr, i32 %y) {
%0:
  %x = gep inbounds * %ptr, 8 x i32 0, 1 x i64 0, 2 x i32 %y, 1 x i64 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep15(* %ptr, i32 %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep15_no_null_opt(* %ptr, i32 %y) {
%0:
  %x = gep inbounds * %ptr, 8 x i32 0, 1 x i64 0, 2 x i32 %y, 1 x i64 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep15_no_null_opt(* %ptr, i32 %y) {
%0:
  %x = gep inbounds * %ptr, 8 x i32 0, 1 x i64 0, 2 x i32 %y, 1 x i64 1
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep16(* %ptr, i32 %a) {
%0:
  %b = or i32 %a, 1
  %x = gep inbounds * %ptr, 1 x i32 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep16(* %ptr, i32 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep16_no_null_opt(* %ptr, i32 %a) {
%0:
  %b = or i32 %a, 1
  %x = gep inbounds * %ptr, 1 x i32 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @gep16_no_null_opt(* %ptr, i32 %a) {
%0:
  %b = or i32 %a, 1
  %x = gep inbounds * %ptr, 1 x i32 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep17() {
%0:
  %alloca = alloca i64 4, align 4
  %bc = bitcast * %alloca to *
  %gep1 = gep inbounds * %alloca, 4 x i32 1
  %pti1 = ptrtoint * %gep1 to i32
  %gep2 = gep inbounds * %bc, 4 x i32 0, 1 x i32 1
  %pti2 = ptrtoint * %gep2 to i32
  %cmp = icmp ugt i32 %pti1, %pti2
  ret i1 %cmp
}
=>
define i1 @gep17() {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @gep_same_base_constant_indices(* %a) {
%0:
  %arrayidx1 = gep inbounds * %a, 1 x i64 1
  %arrayidx2 = gep inbounds * %a, 1 x i64 10
  %cmp = icmp slt * %arrayidx1, %arrayidx2
  ret i1 %cmp
}
=>
define i1 @gep_same_base_constant_indices(* %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @zext(i32 %x) {
%0:
  %e1 = zext i32 %x to i64
  %e2 = zext i32 %x to i64
  %r = icmp eq i64 %e1, %e2
  ret i1 %r
}
=>
define i1 @zext(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @zext2(i1 %x) {
%0:
  %e = zext i1 %x to i32
  %c = icmp ne i32 %e, 0
  ret i1 %c
}
=>
define i1 @zext2(i1 %x) {
%0:
  ret i1 %x
}
Transformation seems to be correct!


----------------------------------------
define i1 @zext3() {
%0:
  %e = zext i1 1 to i32
  %c = icmp ne i32 %e, 0
  ret i1 %c
}
=>
define i1 @zext3() {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @sext(i32 %x) {
%0:
  %e1 = sext i32 %x to i64
  %e2 = sext i32 %x to i64
  %r = icmp eq i64 %e1, %e2
  ret i1 %r
}
=>
define i1 @sext(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @sext2(i1 %x) {
%0:
  %e = sext i1 %x to i32
  %c = icmp ne i32 %e, 0
  ret i1 %c
}
=>
define i1 @sext2(i1 %x) {
%0:
  ret i1 %x
}
Transformation seems to be correct!


----------------------------------------
define i1 @sext3() {
%0:
  %e = sext i1 1 to i32
  %c = icmp ne i32 %e, 0
  ret i1 %c
}
=>
define i1 @sext3() {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @add(i32 %x, i32 %y) {
%0:
  %l = lshr i32 %x, 1
  %q = lshr i32 %y, 1
  %r = or i32 %q, 1
  %s = add i32 %l, %r
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @add(i32 %x, i32 %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @addv(<2 x i32> %x, <2 x i32> %y) {
%0:
  %l = lshr <2 x i32> %x, { 1, 0 }
  %q = lshr <2 x i32> %y, { 1, 0 }
  %r = or <2 x i32> %q, { 1, 0 }
  %s = add <2 x i32> %l, %r
  %e = extractelement <2 x i32> %s, i32 0
  %c = icmp eq i32 %e, 0
  ret i1 %c
}
=>
define i1 @addv(<2 x i32> %x, <2 x i32> %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @add2(i8 %x, i8 %y) {
%0:
  %l = or i8 %x, 128
  %r = or i8 %y, 129
  %s = add i8 %l, %r
  %c = icmp eq i8 %s, 0
  ret i1 %c
}
=>
define i1 @add2(i8 %x, i8 %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @add2v(<2 x i8> %x, <2 x i8> %y) {
%0:
  %l = or <2 x i8> %x, { 0, 128 }
  %r = or <2 x i8> %y, { 0, 129 }
  %s = add <2 x i8> %l, %r
  %e = extractelement <2 x i8> %s, i32 1
  %c = icmp eq i8 %e, 0
  ret i1 %c
}
=>
define i1 @add2v(<2 x i8> %x, <2 x i8> %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @add3(i8 %x, i8 %y) {
%0:
  %l = zext i8 %x to i32
  %r = zext i8 %y to i32
  %s = add i32 %l, %r
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @add3(i8 %x, i8 %y) {
%0:
  %l = zext i8 %x to i32
  %r = zext i8 %y to i32
  %s = add i32 %l, %r
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @add4(i32 %x, i32 %y) {
%0:
  %z = add nsw i32 %y, 1
  %s1 = add nsw i32 %x, %y
  %s2 = add nsw i32 %x, %z
  %c = icmp slt i32 %s1, %s2
  ret i1 %c
}
=>
define i1 @add4(i32 %x, i32 %y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @add5(i32 %x, i32 %y) {
%0:
  %z = add nuw i32 %y, 1
  %s1 = add nuw i32 %x, %z
  %s2 = add nuw i32 %x, %y
  %c = icmp ugt i32 %s1, %s2
  ret i1 %c
}
=>
define i1 @add5(i32 %x, i32 %y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @add6(i64 %A, i64 %B) {
%0:
  %s1 = add i64 %A, %B
  %s2 = add i64 %B, %A
  %cmp = icmp eq i64 %s1, %s2
  ret i1 %cmp
}
=>
define i1 @add6(i64 %A, i64 %B) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @addpowtwo(i32 %x, i32 %y) {
%0:
  %l = lshr i32 %x, 1
  %r = shl i32 1, %y
  %s = add i32 %l, %r
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @addpowtwo(i32 %x, i32 %y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @addpowtwov(<2 x i32> %x, <2 x i32> %y) {
%0:
  %l = lshr <2 x i32> %x, { 1, 0 }
  %r = shl <2 x i32> { 1, 0 }, %y
  %s = add <2 x i32> %l, %r
  %e = extractelement <2 x i32> %s, i32 0
  %c = icmp eq i32 %e, 0
  ret i1 %c
}
=>
define i1 @addpowtwov(<2 x i32> %x, <2 x i32> %y) {
%0:
  %l = lshr <2 x i32> %x, { 1, 0 }
  %r = shl <2 x i32> { 1, 0 }, %y
  %s = add <2 x i32> %l, %r
  %e = extractelement <2 x i32> %s, i32 0
  %c = icmp eq i32 %e, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @or(i32 %x) {
%0:
  %o = or i32 %x, 1
  %c = icmp eq i32 %o, 0
  ret i1 %c
}
=>
define i1 @or(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
@GV = global 4 bytes, align 4

define i1 @or_constexp(i32 %x) {
%entry:
  %__constexpr_0 = ptrtoint * @GV to i32
  %0 = and i32 %__constexpr_0, 32
  %o = or i32 %x, %0
  %c = icmp eq i32 %o, 0
  ret i1 %c
}
=>
@GV = global 4 bytes, align 4

define i1 @or_constexp(i32 %x) {
%entry:
  %__constexpr_1 = ptrtoint * @GV to i32
  %__constexpr_0 = and i32 %__constexpr_1, 32
  %o = or i32 %x, %__constexpr_0
  %c = icmp eq i32 %o, 0
  ret i1 %c
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl1(i32 %x) {
%0:
  %s = shl i32 1, %x
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @shl1(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @shl3(i32 %X) {
%0:
  %sub = shl nuw i32 4, %X
  %cmp = icmp eq i32 %sub, 31
  ret i1 %cmp
}
=>
define i1 @shl3(i32 %X) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr1(i32 %x) {
%0:
  %s = lshr i32 4294967295, %x
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @lshr1(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr3(i32 %x) {
%0:
  %s = lshr i32 %x, %x
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @lshr3(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr4(i32 %X, i32 %Y) {
%0:
  %A = lshr i32 %X, %Y
  %C = icmp ule i32 %A, %X
  ret i1 %C
}
=>
define i1 @lshr4(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr5(i32 %X, i32 %Y) {
%0:
  %A = lshr i32 %X, %Y
  %C = icmp ugt i32 %A, %X
  ret i1 %C
}
=>
define i1 @lshr5(i32 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr6(i32 %X, i32 %Y) {
%0:
  %A = lshr i32 %X, %Y
  %C = icmp ult i32 %X, %A
  ret i1 %C
}
=>
define i1 @lshr6(i32 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr7(i32 %X, i32 %Y) {
%0:
  %A = lshr i32 %X, %Y
  %C = icmp uge i32 %X, %A
  ret i1 %C
}
=>
define i1 @lshr7(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @ashr1(i32 %x) {
%0:
  %s = ashr i32 4294967295, %x
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @ashr1(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @ashr3(i32 %x) {
%0:
  %s = ashr i32 %x, %x
  %c = icmp eq i32 %s, 0
  ret i1 %c
}
=>
define i1 @ashr3(i32 %x) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @select1(i1 %cond) {
%0:
  %s = select i1 %cond, i32 1, i32 0
  %c = icmp eq i32 %s, 1
  ret i1 %c
}
=>
define i1 @select1(i1 %cond) {
%0:
  ret i1 %cond
}
Transformation seems to be correct!


----------------------------------------
define i1 @select2(i1 %cond) {
%0:
  %x = zext i1 %cond to i32
  %s = select i1 %cond, i32 %x, i32 0
  %c = icmp ne i32 %s, 0
  ret i1 %c
}
=>
define i1 @select2(i1 %cond) {
%0:
  ret i1 %cond
}
Transformation seems to be correct!


----------------------------------------
define i1 @select3(i1 %cond) {
%0:
  %x = zext i1 %cond to i32
  %s = select i1 %cond, i32 1, i32 %x
  %c = icmp ne i32 %s, 0
  ret i1 %c
}
=>
define i1 @select3(i1 %cond) {
%0:
  ret i1 %cond
}
Transformation seems to be correct!


----------------------------------------
define i1 @select4(i1 %cond) {
%0:
  %invert = xor i1 %cond, 1
  %s = select i1 %invert, i32 0, i32 1
  %c = icmp ne i32 %s, 0
  ret i1 %c
}
=>
define i1 @select4(i1 %cond) {
%0:
  ret i1 %cond
}
Transformation seems to be correct!


----------------------------------------
define i1 @select5(i32 %x) {
%0:
  %c = icmp eq i32 %x, 0
  %s = select i1 %c, i32 1, i32 %x
  %c2 = icmp eq i32 %s, 0
  ret i1 %c2
}
=>
define i1 @select5(i32 %x) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @select6(i32 %x) {
%0:
  %c = icmp sgt i32 %x, 0
  %s = select i1 %c, i32 %x, i32 4
  %c2 = icmp eq i32 %s, 0
  ret i1 %c2
}
=>
define i1 @select6(i32 %x) {
%0:
  %c = icmp sgt i32 %x, 0
  %s = select i1 %c, i32 %x, i32 4
  %c2 = icmp eq i32 %s, 0
  ret i1 %c2
}
Transformation seems to be correct!


----------------------------------------
define i1 @urem1(i32 %X, i32 %Y) {
%0:
  %A = urem i32 %X, %Y
  %B = icmp ult i32 %A, %Y
  ret i1 %B
}
=>
define i1 @urem1(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @urem2(i32 %X, i32 %Y) {
%0:
  %A = urem i32 %X, %Y
  %B = icmp eq i32 %A, %Y
  ret i1 %B
}
=>
define i1 @urem2(i32 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @urem4(i32 %X) {
%0:
  %A = urem i32 %X, 15
  %B = icmp ult i32 %A, 10
  ret i1 %B
}
=>
define i1 @urem4(i32 %X) {
%0:
  %A = urem i32 %X, 15
  %B = icmp ult i32 %A, 10
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @urem5(i16 %X, i32 %Y) {
%0:
  %A = zext i16 %X to i32
  %B = urem i32 %A, %Y
  %C = icmp slt i32 %B, %Y
  ret i1 %C
}
=>
define i1 @urem5(i16 %X, i32 %Y) {
%0:
  %A = zext i16 %X to i32
  %B = urem i32 %A, %Y
  %C = icmp slt i32 %B, %Y
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @urem6(i32 %X, i32 %Y) {
%0:
  %A = urem i32 %X, %Y
  %B = icmp ugt i32 %Y, %A
  ret i1 %B
}
=>
define i1 @urem6(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @urem7(i32 %X) {
%0:
  %A = urem i32 1, %X
  %B = icmp sgt i32 %A, %X
  ret i1 %B
}
=>
define i1 @urem7(i32 %X) {
%0:
  %A = urem i32 1, %X
  %B = icmp sgt i32 %A, %X
  ret i1 %B
}
Transformation seems to be correct!


----------------------------------------
define i1 @srem2(i16 %X, i32 %Y) {
%0:
  %A = zext i16 %X to i32
  %B = add nsw i32 %A, 1
  %C = srem i32 %B, %Y
  %D = icmp slt i32 %C, 0
  ret i1 %D
}
=>
define i1 @srem2(i16 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @srem2v(<2 x i16> %X, <2 x i32> %Y) {
%0:
  %A = zext <2 x i16> %X to <2 x i32>
  %B = add nsw <2 x i32> %A, { 1, 0 }
  %C = srem <2 x i32> %B, %Y
  %D = extractelement <2 x i32> %C, i32 0
  %E = icmp slt i32 %D, 0
  ret i1 %E
}
=>
define i1 @srem2v(<2 x i16> %X, <2 x i32> %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @srem3(i16 %X, i32 %Y) {
%0:
  %A = zext i16 %X to i32
  %B = or i32 2147483648, %A
  %C = sub nsw i32 1, %B
  %D = srem i32 %C, %Y
  %E = icmp slt i32 %D, 0
  ret i1 %E
}
=>
define i1 @srem3(i16 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @srem3v(<2 x i16> %X, <2 x i32> %Y) {
%0:
  %A = zext <2 x i16> %X to <2 x i32>
  %B = or <2 x i32> { 1, 2147483648 }, %A
  %C = sub nsw <2 x i32> { 0, 1 }, %B
  %D = srem <2 x i32> %C, %Y
  %E = extractelement <2 x i32> %C, i32 1
  %F = icmp slt i32 %E, 0
  ret i1 %F
}
=>
define i1 @srem3v(<2 x i16> %X, <2 x i32> %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv2(i32 %Z) {
%0:
  %A = udiv exact i32 10, %Z
  %B = udiv exact i32 20, %Z
  %C = icmp ult i32 %A, %B
  ret i1 %C
}
=>
define i1 @udiv2(i32 %Z) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @sdiv_exact_equality(i32 %Z) {
%0:
  %A = sdiv exact i32 10, %Z
  %B = sdiv exact i32 20, %Z
  %C = icmp eq i32 %A, %B
  ret i1 %C
}
=>
define i1 @sdiv_exact_equality(i32 %Z) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @sdiv_exact_not_equality(i32 %Z) {
%0:
  %A = sdiv exact i32 10, %Z
  %B = sdiv exact i32 20, %Z
  %C = icmp ult i32 %A, %B
  ret i1 %C
}
=>
define i1 @sdiv_exact_not_equality(i32 %Z) {
%0:
  %A = sdiv exact i32 10, %Z
  %B = sdiv exact i32 20, %Z
  %C = icmp ult i32 %A, %B
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv3(i32 %X, i32 %Y) {
%0:
  %A = udiv i32 %X, %Y
  %C = icmp ugt i32 %A, %X
  ret i1 %C
}
=>
define i1 @udiv3(i32 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv4(i32 %X, i32 %Y) {
%0:
  %A = udiv i32 %X, %Y
  %C = icmp ule i32 %A, %X
  ret i1 %C
}
=>
define i1 @udiv4(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv6(i32 %X) {
%0:
  %A = udiv i32 1, %X
  %C = icmp eq i32 %A, 0
  ret i1 %C
}
=>
define i1 @udiv6(i32 %X) {
%0:
  %A = udiv i32 1, %X
  %C = icmp eq i32 %A, 0
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv7(i32 %X, i32 %Y) {
%0:
  %A = udiv i32 %X, %Y
  %C = icmp ult i32 %X, %A
  ret i1 %C
}
=>
define i1 @udiv7(i32 %X, i32 %Y) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @udiv8(i32 %X, i32 %Y) {
%0:
  %A = udiv i32 %X, %Y
  %C = icmp uge i32 %X, %A
  ret i1 %C
}
=>
define i1 @udiv8(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @mul1(i32 %X) {
%0:
  %Y = or i32 %X, 1
  %M = mul nuw i32 %Y, %Y
  %C = icmp eq i32 %M, 0
  ret i1 %C
}
=>
define i1 @mul1(i32 %X) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @mul1v(<2 x i32> %X) {
%0:
  %Y = or <2 x i32> %X, { 1, 0 }
  %M = mul nuw <2 x i32> %Y, %Y
  %E = extractelement <2 x i32> %M, i32 0
  %C = icmp eq i32 %E, 0
  ret i1 %C
}
=>
define i1 @mul1v(<2 x i32> %X) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @mul2(i32 %X) {
%0:
  %Y = or i32 %X, 1
  %M = mul nsw i32 %Y, %Y
  %C = icmp sgt i32 %M, 0
  ret i1 %C
}
=>
define i1 @mul2(i32 %X) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @mul2v(<2 x i32> %X) {
%0:
  %Y = or <2 x i32> %X, { 0, 1 }
  %M = mul nsw <2 x i32> %Y, %Y
  %E = extractelement <2 x i32> %M, i32 1
  %C = icmp sgt i32 %E, 0
  ret i1 %C
}
=>
define i1 @mul2v(<2 x i32> %X) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @mul3(i32 %X, i32 %Y) {
%0:
  %XX = mul nsw i32 %X, %X
  %YY = mul nsw i32 %Y, %Y
  %M = mul nsw i32 %XX, %YY
  %C = icmp sge i32 %M, 0
  ret i1 %C
}
=>
define i1 @mul3(i32 %X, i32 %Y) {
%0:
  ret i1 1
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @mul3v(<2 x i32> %X, <2 x i32> %Y) {
%0:
  %XX = mul nsw <2 x i32> %X, %X
  %YY = mul nsw <2 x i32> %Y, %Y
  %M = mul nsw <2 x i32> %XX, %YY
  %C = icmp sge <2 x i32> %M, { 0, 0 }
  ret <2 x i1> %C
}
=>
define <2 x i1> @mul3v(<2 x i32> %X, <2 x i32> %Y) {
%0:
  ret <2 x i1> { 1, 1 }
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i1> @vectorselect1(<2 x i1> %cond) {
%0:
  %invert = xor <2 x i1> %cond, { 1, 1 }
  %s = select <2 x i1> %invert, <2 x i32> { 0, 0 }, <2 x i32> { 1, 1 }
  %c = icmp ne <2 x i32> %s, { 0, 0 }
  ret <2 x i1> %c
}
=>
define <2 x i1> @vectorselect1(<2 x i1> %cond) {
%0:
  ret <2 x i1> %cond
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @vectorselectcrash(i32 %arg1) {
%0:
  %tobool40 = icmp ne i32 %arg1, 0
  %cond43 = select i1 %tobool40, <2 x i16> { 65531, 66 }, <2 x i16> { 46, 1 }
  %cmp45 = icmp ugt <2 x i16> %cond43, { 73, 21 }
  ret <2 x i1> %cmp45
}
=>
define <2 x i1> @vectorselectcrash(i32 %arg1) {
%0:
  %tobool40 = icmp ne i32 %arg1, 0
  %cond43 = select i1 %tobool40, <2 x i16> { 65531, 66 }, <2 x i16> { 46, 1 }
  %cmp45 = icmp ugt <2 x i16> %cond43, { 73, 21 }
  ret <2 x i1> %cmp45
}
Transformation seems to be correct!


----------------------------------------
define i1 @alloca_compare(i64 %idx) {
%0:
  %sv = alloca i64 504, align 8
  %1 = gep inbounds * %sv, 504 x i32 0, 1 x i64 8, 4 x i64 %idx
  %2 = icmp eq * %1, null
  ret i1 %2
}
=>
define i1 @alloca_compare(i64 %idx) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @alloca_compare_no_null_opt(i64 %idx) {
%0:
  %sv = alloca i64 504, align 8
  %cmp = gep inbounds * %sv, 504 x i32 0, 1 x i64 8, 4 x i64 %idx
  %X = icmp eq * %cmp, null
  ret i1 %X
}
=>
define i1 @alloca_compare_no_null_opt(i64 %idx) {
%0:
  %sv = alloca i64 504, align 8
  %cmp = gep inbounds * %sv, 504 x i32 0, 1 x i64 8, 4 x i64 %idx
  %X = icmp eq * %cmp, null
  ret i1 %X
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   %X = getelementptr i32, i32* %X, i32 1
ERROR: Unsupported instruction:   %X = getelementptr i32, i32* %X, i32 1

----------------------------------------
define i1 @alloca_argument_compare(* %arg) {
%0:
  %alloc = alloca i64 8, align 8
  %cmp = icmp eq * %arg, %alloc
  ret i1 %cmp
}
=>
define i1 @alloca_argument_compare(* %arg) {
%0:
  %alloc = alloca i64 8, align 8
  %cmp = icmp eq * %arg, %alloc
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @alloca_argument_compare_swapped(* %arg) {
%0:
  %alloc = alloca i64 8, align 8
  %cmp = icmp eq * %alloc, %arg
  ret i1 %cmp
}
=>
define i1 @alloca_argument_compare_swapped(* %arg) {
%0:
  %alloc = alloca i64 8, align 8
  %cmp = icmp eq * %alloc, %arg
  ret i1 %cmp
}
Transformation seems to be correct!

ERROR: Unsupported attribute: noalias
ERROR: Unsupported attribute: noalias

----------------------------------------
define i1 @alloca_gep(i64 %a, i64 %b) {
%0:
  %strs = alloca i64 1001000, align 16
  %x = gep inbounds * %strs, 1001000 x i64 0, 1001 x i64 %a, 1 x i64 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @alloca_gep(i64 %a, i64 %b) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @alloca_gep_no_null_opt(i64 %a, i64 %b) {
%0:
  %strs = alloca i64 1001000, align 16
  %x = gep inbounds * %strs, 1001000 x i64 0, 1001 x i64 %a, 1 x i64 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
=>
define i1 @alloca_gep_no_null_opt(i64 %a, i64 %b) {
%0:
  %strs = alloca i64 1001000, align 16
  %x = gep inbounds * %strs, 1001000 x i64 0, 1001 x i64 %a, 1 x i64 %b
  %cmp = icmp eq * %x, null
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i1 @non_inbounds_gep_compare(* %a) {
%0:
  %x = gep * %a, 8 x i64 42
  %y = gep inbounds * %x, 8 x i64 -42
  %z = gep * %a, 8 x i64 -42
  %w = gep inbounds * %z, 8 x i64 42
  %cmp = icmp eq * %y, %w
  ret i1 %cmp
}
=>
define i1 @non_inbounds_gep_compare(* %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @non_inbounds_gep_compare2(* %a) {
%0:
  %x = gep * %a, 8 x i64 4294967297
  %y = gep * %a, 8 x i64 1
  %cmp = icmp eq * %y, %y
  ret i1 %cmp
}
=>
define i1 @non_inbounds_gep_compare2(* %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_true_slt(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp slt i32 %2, 1
  ret i1 %3
}
=>
define i1 @compare_always_true_slt(i16 %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_true_sle(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp sle i32 %2, 0
  ret i1 %3
}
=>
define i1 @compare_always_true_sle(i16 %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_false_sgt(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp sgt i32 %2, 0
  ret i1 %3
}
=>
define i1 @compare_always_false_sgt(i16 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_false_sge(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp sge i32 %2, 1
  ret i1 %3
}
=>
define i1 @compare_always_false_sge(i16 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_false_eq(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp eq i32 %2, 1
  ret i1 %3
}
=>
define i1 @compare_always_false_eq(i16 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @compare_always_false_ne(i16 %a) {
%0:
  %1 = zext i16 %a to i32
  %2 = sub nsw i32 0, %1
  %3 = icmp ne i32 %2, 1
  ret i1 %3
}
=>
define i1 @compare_always_false_ne(i16 %a) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define i1 @lshr_ugt_false(i32 %a) {
%0:
  %shr = lshr i32 1, %a
  %cmp = icmp ugt i32 %shr, 1
  ret i1 %cmp
}
=>
define i1 @lshr_ugt_false(i32 %a) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @nonnull_arg(* nonnull %i) {
%0:
  %cmp = icmp eq * nonnull %i, null
  ret i1 %cmp
}
=>
define i1 @nonnull_arg(* nonnull %i) {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @nonnull_arg_no_null_opt(* nonnull %i) {
%0:
  %cmp = icmp eq * nonnull %i, null
  ret i1 %cmp
}
=>
define i1 @nonnull_arg_no_null_opt(* nonnull %i) {
%0:
  ret i1 0
}
Transformation seems to be correct!

ERROR: Unsupported attribute: dereferenceable(4)
ERROR: Unsupported attribute: dereferenceable(4)
ERROR: Unsupported attribute: dereferenceable(4)
ERROR: Unsupported attribute: dereferenceable(4)
ERROR: Unsupported attribute: dereferenceable(4)
ERROR: Unsupported attribute: dereferenceable(4)

----------------------------------------
define i1 @returns_nonnull() {
%0:
  %call = call * @returns_nonnull_helper()
  %cmp = icmp eq * %call, null
  ret i1 %cmp
}
=>
define i1 @returns_nonnull() {
%0:
  %call = call * @returns_nonnull_helper()
  ret i1 0
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:

Source:
* %call = null
i1 %cmp = #x1 (1)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 32	alloc type: 0
Block 1 >	size: 0	align: 2	alloc type: 0
Block 2 >	size: 0	align: 2	alloc type: 0
Block 3 >	size: 0	align: 2	alloc type: 0

Target:
* %call = null
Source value: #x1 (1)
Target value: #x0 (0)


------------------- SMT STATS -------------------
Num queries: 189
Num invalid: 0
Num skips:   0
Num trivial: 313 (62.4%)
Num timeout: 7 (3.7%)
Num errors:  0 (0.0%)
Num SAT:     103 (54.5%)
Num UNSAT:   79 (41.8%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/scripts/opt-alive.sh -instsimplify -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstSimplify/compare.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstSimplify/compare.ll

 

<-- Back