Test Failure: Transforms/InstCombine/sub.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @sub_constant(i32 %x) {
%0:
  %r = sub i32 %x, 42
  ret i32 %r
}
=>
define i32 @sub_constant(i32 %x) {
%0:
  %r = add i32 %x, 4294967254
  ret i32 %r
}
Transformation seems to be correct!


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

define i32 @sub_constant_expression(i32 %x) {
%0:
  %__constexpr_0 = ptrtoint * @g to i32
  %r = sub i32 %x, %__constexpr_0
  ret i32 %r
}
=>
@g = global 4 bytes, align 4

define i32 @sub_constant_expression(i32 %x) {
%0:
  %__constexpr_0 = ptrtoint * @g to i32
  %r = sub i32 %x, %__constexpr_0
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @sub_constant_vec(<2 x i32> %x) {
%0:
  %r = sub <2 x i32> %x, { 42, 4294967284 }
  ret <2 x i32> %r
}
=>
define <2 x i32> @sub_constant_vec(<2 x i32> %x) {
%0:
  %r = add <2 x i32> %x, { 4294967254, 12 }
  ret <2 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <3 x i33> @sub_constant_vec_weird_type(<3 x i33> %x) {
%0:
  %r = sub <3 x i33> %x, { 8589934550, 42, 8589934580 }
  ret <3 x i33> %r
}
=>
define <3 x i33> @sub_constant_vec_weird_type(<3 x i33> %x) {
%0:
  %r = add <3 x i33> %x, { 42, 8589934550, 12 }
  ret <3 x i33> %r
}
Transformation seems to be correct!


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

define <4 x i32> @sub_constant_expression_vec(<4 x i32> %x) {
%0:
  %__constexpr_1 = ptrtoint * @g to i128
  %__constexpr_0 = bitcast i128 %__constexpr_1 to <4 x i32>
  %r = sub <4 x i32> %x, %__constexpr_0
  ret <4 x i32> %r
}
=>
@g = global 4 bytes, align 4

define <4 x i32> @sub_constant_expression_vec(<4 x i32> %x) {
%0:
  %__constexpr_1 = ptrtoint * @g to i128
  %__constexpr_0 = bitcast i128 %__constexpr_1 to <4 x i32>
  %r = sub <4 x i32> %x, %__constexpr_0
  ret <4 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @neg_sub(i32 %x, i32 %y) {
%0:
  %neg = sub i32 0, %x
  %r = sub i32 %y, %neg
  ret i32 %r
}
=>
define i32 @neg_sub(i32 %x, i32 %y) {
%0:
  %r = add i32 %y, %x
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @neg_nsw_sub(i32 %x, i32 %y) {
%0:
  %neg = sub nsw i32 0, %x
  %r = sub i32 %y, %neg
  ret i32 %r
}
=>
define i32 @neg_nsw_sub(i32 %x, i32 %y) {
%0:
  %r = add i32 %y, %x
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @neg_sub_nsw(i32 %x, i32 %y) {
%0:
  %neg = sub i32 0, %x
  %r = sub nsw i32 %y, %neg
  ret i32 %r
}
=>
define i32 @neg_sub_nsw(i32 %x, i32 %y) {
%0:
  %r = add i32 %y, %x
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define i32 @neg_nsw_sub_nsw(i32 %x, i32 %y) {
%0:
  %neg = sub nsw i32 0, %x
  %r = sub nsw i32 %y, %neg
  ret i32 %r
}
=>
define i32 @neg_nsw_sub_nsw(i32 %x, i32 %y) {
%0:
  %r = add nsw i32 %y, %x
  ret i32 %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @neg_sub_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub <2 x i32> { 0, 0 }, %x
  %r = sub <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_sub_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @neg_nsw_sub_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub nsw <2 x i32> { 0, 0 }, %x
  %r = sub <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_nsw_sub_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @neg_sub_nsw_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub <2 x i32> { 0, 0 }, %x
  %r = sub nsw <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_sub_nsw_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @neg_nsw_sub_nsw_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub nsw <2 x i32> { 0, 0 }, %x
  %r = sub nsw <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_nsw_sub_nsw_vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add nsw <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @neg_sub_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub <2 x i32> { 0, undef }, %x
  %r = sub <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_sub_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @neg_nsw_sub_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub nsw <2 x i32> { undef, 0 }, %x
  %r = sub <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_nsw_sub_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @neg_sub_nsw_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub <2 x i32> { undef, 0 }, %x
  %r = sub nsw <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_sub_nsw_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @neg_nsw_sub_nsw_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %neg = sub nsw <2 x i32> { 0, undef }, %x
  %r = sub nsw <2 x i32> %y, %neg
  ret <2 x i32> %r
}
=>
define <2 x i32> @neg_nsw_sub_nsw_vec_undef(<2 x i32> %x, <2 x i32> %y) {
%0:
  %r = add nsw <2 x i32> %y, %x
  ret <2 x i32> %r
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i8 @notnotsub(i8 %x, i8 %y) {
%0:
  %nx = xor i8 %x, 255
  %ny = xor i8 %y, 255
  %sub = sub i8 %nx, %ny
  call void @use8(i8 %nx)
  call void @use8(i8 %ny)
  ret i8 %sub
}
=>
define i8 @notnotsub(i8 %x, i8 %y) {
%0:
  %nx = xor i8 %x, 255
  %ny = xor i8 %y, 255
  %sub = sub i8 %y, %x
  call void @use8(i8 %nx)
  call void @use8(i8 %ny)
  ret i8 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i8> @notnotsub_vec(<2 x i8> %x, <2 x i8> %y) {
%0:
  %nx = xor <2 x i8> %x, { 255, 255 }
  %ny = xor <2 x i8> %y, { 255, 255 }
  %sub = sub <2 x i8> %nx, %ny
  ret <2 x i8> %sub
}
=>
define <2 x i8> @notnotsub_vec(<2 x i8> %x, <2 x i8> %y) {
%0:
  %sub = sub <2 x i8> %y, %x
  ret <2 x i8> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i8> @notnotsub_vec_undef_elts(<2 x i8> %x, <2 x i8> %y) {
%0:
  %nx = xor <2 x i8> %x, { undef, 255 }
  %ny = xor <2 x i8> %y, { 255, undef }
  %sub = sub <2 x i8> %nx, %ny
  ret <2 x i8> %sub
}
=>
define <2 x i8> @notnotsub_vec_undef_elts(<2 x i8> %x, <2 x i8> %y) {
%0:
  %sub = sub <2 x i8> %y, %x
  ret <2 x i8> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test5(i32 %A, i32 %B, i32 %C) {
%0:
  %D = sub i32 %B, %C
  %E = sub i32 %A, %D
  ret i32 %E
}
=>
define i32 @test5(i32 %A, i32 %B, i32 %C) {
%0:
  %D.neg = sub i32 %C, %B
  %E = add i32 %D.neg, %A
  ret i32 %E
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test6(i32 %A, i32 %B) {
%0:
  %C = and i32 %A, %B
  %D = sub i32 %A, %C
  ret i32 %D
}
=>
define i32 @test6(i32 %A, i32 %B) {
%0:
  %B.not = xor i32 %B, 4294967295
  %D = and i32 %B.not, %A
  ret i32 %D
}
Transformation seems to be correct!


----------------------------------------
define i32 @test6commuted(i32 %A, i32 %B) {
%0:
  %C = and i32 %B, %A
  %D = sub i32 %A, %C
  ret i32 %D
}
=>
define i32 @test6commuted(i32 %A, i32 %B) {
%0:
  %B.not = xor i32 %B, 4294967295
  %D = and i32 %B.not, %A
  ret i32 %D
}
Transformation seems to be correct!


----------------------------------------
define i32 @test7(i32 %A) {
%0:
  %B = sub i32 4294967295, %A
  ret i32 %B
}
=>
define i32 @test7(i32 %A) {
%0:
  %B = xor i32 %A, 4294967295
  ret i32 %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test8(i32 %A) {
%0:
  %B = mul i32 9, %A
  %C = sub i32 %B, %A
  ret i32 %C
}
=>
define i32 @test8(i32 %A) {
%0:
  %C = shl i32 %A, 3
  ret i32 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test9(i32 %A) {
%0:
  %B = mul i32 3, %A
  %C = sub i32 %A, %B
  ret i32 %C
}
=>
define i32 @test9(i32 %A) {
%0:
  %C = mul i32 %A, 4294967294
  ret i32 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test11(i8 %A, i8 %B) {
%0:
  %C = sub i8 %A, %B
  %D = icmp ne i8 %C, 0
  ret i1 %D
}
=>
define i1 @test11(i8 %A, i8 %B) {
%0:
  %D = icmp ne i8 %A, %B
  ret i1 %D
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test11vec(<2 x i8> %A, <2 x i8> %B) {
%0:
  %C = sub <2 x i8> %A, %B
  %D = icmp ne <2 x i8> %C, { 0, 0 }
  ret <2 x i1> %D
}
=>
define <2 x i1> @test11vec(<2 x i8> %A, <2 x i8> %B) {
%0:
  %D = icmp ne <2 x i8> %A, %B
  ret <2 x i1> %D
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12(i32 %A) {
%0:
  %B = ashr i32 %A, 31
  %C = sub i32 0, %B
  ret i32 %C
}
=>
define i32 @test12(i32 %A) {
%0:
  %B.neg = lshr i32 %A, 31
  ret i32 %B.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13(i32 %A) {
%0:
  %B = lshr i32 %A, 31
  %C = sub i32 0, %B
  ret i32 %C
}
=>
define i32 @test13(i32 %A) {
%0:
  %B.neg = ashr i32 %A, 31
  ret i32 %B.neg
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test12vec(<2 x i32> %A) {
%0:
  %B = ashr <2 x i32> %A, { 31, 31 }
  %C = sub <2 x i32> { 0, 0 }, %B
  ret <2 x i32> %C
}
=>
define <2 x i32> @test12vec(<2 x i32> %A) {
%0:
  %B.neg = lshr <2 x i32> %A, { 31, 31 }
  ret <2 x i32> %B.neg
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test13vec(<2 x i32> %A) {
%0:
  %B = lshr <2 x i32> %A, { 31, 31 }
  %C = sub <2 x i32> { 0, 0 }, %B
  ret <2 x i32> %C
}
=>
define <2 x i32> @test13vec(<2 x i32> %A) {
%0:
  %B.neg = ashr <2 x i32> %A, { 31, 31 }
  ret <2 x i32> %B.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test15(i32 %A, i32 %B) {
%0:
  %C = sub i32 0, %A
  %D = srem i32 %B, %C
  ret i32 %D
}
=>
define i32 @test15(i32 %A, i32 %B) {
%0:
  %C = sub i32 0, %A
  %D = srem i32 %B, %C
  ret i32 %D
}
Transformation seems to be correct!


----------------------------------------
define i32 @test16(i32 %A) {
%0:
  %X = sdiv i32 %A, 1123
  %Y = sub i32 0, %X
  ret i32 %Y
}
=>
define i32 @test16(i32 %A) {
%0:
  %X.neg = sdiv i32 %A, 4294966173
  ret i32 %X.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test17(i32 %A) {
%0:
  %B = sub i32 0, %A
  %C = sdiv i32 %B, 1234
  ret i32 %C
}
=>
define i32 @test17(i32 %A) {
%0:
  %B = sub i32 0, %A
  %C = sdiv i32 %B, 1234
  ret i32 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test18(i64 %Y) {
%0:
  %i.4 = shl i64 %Y, 2
  %i.12 = shl i64 %Y, 2
  %i.8 = sub i64 %i.4, %i.12
  ret i64 %i.8
}
=>
define i64 @test18(i64 %Y) {
%0:
  ret i64 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test20(i32 %g, i32 %h) {
%0:
  %i.2 = sub i32 %g, %h
  %i.4 = icmp ne i32 %i.2, %g
  ret i1 %i.4
}
=>
define i1 @test20(i32 %g, i32 %h) {
%0:
  %i.4 = icmp ne i32 %h, 0
  ret i1 %i.4
}
Transformation seems to be correct!


----------------------------------------
define i1 @test21(i32 %g, i32 %h) {
%0:
  %i.2 = sub i32 %g, %h
  %i.4 = icmp ne i32 %i.2, %g
  ret i1 %i.4
}
=>
define i1 @test21(i32 %g, i32 %h) {
%0:
  %i.4 = icmp ne i32 %h, 0
  ret i1 %i.4
}
Transformation seems to be correct!


----------------------------------------
define i1 @test22(i32 %a, i32 %b) {
%0:
  %i2 = sub i32 0, %a
  %i4 = sub i32 0, %b
  %i5 = icmp eq i32 %i2, %i4
  ret i1 %i5
}
=>
define i1 @test22(i32 %a, i32 %b) {
%0:
  %i5 = icmp eq i32 %b, %a
  ret i1 %i5
}
Transformation seems to be correct!


----------------------------------------
define i32 @test26(i32 %x) {
%0:
  %shl = shl i32 3, %x
  %neg = sub i32 0, %shl
  ret i32 %neg
}
=>
define i32 @test26(i32 %x) {
%0:
  %shl.neg = shl i32 4294967293, %x
  ret i32 %shl.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_shl_sub(i64 %a, i64 %b) {
%0:
  %sub = sub i64 %a, %b
  %mul = shl i64 %sub, 2
  %neg = sub i64 0, %mul
  ret i64 %neg
}
=>
define i64 @test_neg_shl_sub(i64 %a, i64 %b) {
%0:
  %sub.neg = sub i64 %b, %a
  %mul.neg = shl i64 %sub.neg, 2
  ret i64 %mul.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test_neg_shl_sub_extra_use1(i64 %a, i64 %b, * %p) {
%0:
  %sub = sub i64 %a, %b
  store i64 %sub, * %p, align 8
  %mul = shl i64 %sub, 2
  %neg = sub i64 0, %mul
  ret i64 %neg
}
=>
define i64 @test_neg_shl_sub_extra_use1(i64 %a, i64 %b, * %p) {
%0:
  %sub = sub i64 %a, %b
  store i64 %sub, * %p, align 8
  %mul.neg = mul i64 %sub, -4
  ret i64 %mul.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test_neg_shl_sub_extra_use2(i64 %a, i64 %b, * %p) {
%0:
  %sub = sub i64 %a, %b
  %mul = shl i64 %sub, 2
  store i64 %mul, * %p, align 8
  %neg = sub i64 0, %mul
  ret i64 %neg
}
=>
define i64 @test_neg_shl_sub_extra_use2(i64 %a, i64 %b, * %p) {
%0:
  %sub = sub i64 %a, %b
  %mul = shl i64 %sub, 2
  store i64 %mul, * %p, align 8
  %neg = sub i64 0, %mul
  ret i64 %neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test_neg_shl_div(i64 %a) {
%0:
  %div = sdiv i64 %a, 3
  %shl = shl i64 %div, 2
  %neg = sub i64 0, %shl
  ret i64 %neg
}
=>
define i64 @test_neg_shl_div(i64 %a) {
%0:
  %div.neg = sdiv i64 %a, -3
  %shl.neg = shl i64 %div.neg, 2
  ret i64 %shl.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_shl_zext_i1(i1 %a, i64 %b) {
%0:
  %ext = zext i1 %a to i64
  %shl = shl i64 %ext, %b
  %neg = sub i64 0, %shl
  ret i64 %neg
}
=>
define i64 @test_neg_shl_zext_i1(i1 %a, i64 %b) {
%0:
  %ext.neg = sext i1 %a to i64
  %shl.neg = shl i64 %ext.neg, %b
  ret i64 %shl.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_shl_sext_i1(i1 %a, i64 %b) {
%0:
  %ext = sext i1 %a to i64
  %shl = shl i64 %ext, %b
  %neg = sub i64 0, %shl
  ret i64 %neg
}
=>
define i64 @test_neg_shl_sext_i1(i1 %a, i64 %b) {
%0:
  %ext.neg = zext i1 %a to i64
  %shl.neg = shl i64 %ext.neg, %b
  ret i64 %shl.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_zext_i1_extra_use(i1 %a, i64 %b, * %p) {
%0:
  %ext = zext i1 %a to i64
  %neg = sub i64 0, %ext
  store i64 %ext, * %p, align 8
  ret i64 %neg
}
=>
define i64 @test_neg_zext_i1_extra_use(i1 %a, i64 %b, * %p) {
%0:
  %ext.neg = sext i1 %a to i64
  %ext = zext i1 %a to i64
  store i64 %ext, * %p, align 8
  ret i64 %ext.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_sext_i1_extra_use(i1 %a, i64 %b, * %p) {
%0:
  %ext = sext i1 %a to i64
  %neg = sub i64 0, %ext
  store i64 %ext, * %p, align 8
  ret i64 %neg
}
=>
define i64 @test_neg_sext_i1_extra_use(i1 %a, i64 %b, * %p) {
%0:
  %ext.neg = zext i1 %a to i64
  %ext = sext i1 %a to i64
  store i64 %ext, * %p, align 8
  ret i64 %ext.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test_neg_trunc_shl_sub(i64 %a, i64 %b) {
%0:
  %sub = sub i64 %a, %b
  %shl = shl i64 %sub, 2
  %trunc = trunc i64 %shl to i32
  %neg = sub i32 0, %trunc
  ret i32 %neg
}
=>
define i32 @test_neg_trunc_shl_sub(i64 %a, i64 %b) {
%0:
  %sub.neg = sub i64 %b, %a
  %sub.tr.neg = trunc i64 %sub.neg to i32
  %trunc.neg = shl i32 %sub.tr.neg, 2
  ret i32 %trunc.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test_neg_trunc_shl_ashr(i64 %a, i64 %b) {
%0:
  %shr = ashr i64 %a, 63
  %shl = shl i64 %shr, %b
  %trunc = trunc i64 %shl to i32
  %neg = sub i32 0, %trunc
  ret i32 %neg
}
=>
define i32 @test_neg_trunc_shl_ashr(i64 %a, i64 %b) {
%0:
  %shr.neg = lshr i64 %a, 63
  %shl.neg = shl i64 %shr.neg, %b
  %trunc.neg = trunc i64 %shl.neg to i32
  ret i32 %trunc.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test_neg_trunc_shl_lshr(i64 %a, i64 %b) {
%0:
  %shr = lshr i64 %a, 63
  %shl = shl i64 %shr, %b
  %trunc = trunc i64 %shl to i32
  %neg = sub i32 0, %trunc
  ret i32 %neg
}
=>
define i32 @test_neg_trunc_shl_lshr(i64 %a, i64 %b) {
%0:
  %shr.neg = ashr i64 %a, 63
  %shl.neg = shl i64 %shr.neg, %b
  %trunc.neg = trunc i64 %shl.neg to i32
  ret i32 %trunc.neg
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_neg_mul_sub(i64 %a, i64 %b, i64 %c) {
%0:
  %sub = sub i64 %a, %b
  %mul = mul i64 %sub, %c
  %neg = sub i64 0, %mul
  ret i64 %neg
}
=>
define i64 @test_neg_mul_sub(i64 %a, i64 %b, i64 %c) {
%0:
  %sub.neg = sub i64 %b, %a
  %mul.neg = mul i64 %sub.neg, %c
  ret i64 %mul.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test_neg_mul_sub_commuted(i64 %a, i64 %b, i64 %c) {
%0:
  %complex = mul i64 %c, %c
  %sub = sub i64 %a, %b
  %mul = mul i64 %complex, %sub
  %neg = sub i64 0, %mul
  ret i64 %neg
}
=>
define i64 @test_neg_mul_sub_commuted(i64 %a, i64 %b, i64 %c) {
%0:
  %complex = mul i64 %c, %c
  %sub.neg = sub i64 %b, %a
  %mul.neg = mul i64 %sub.neg, %complex
  ret i64 %mul.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test27(i32 %x, i32 %y) {
%0:
  %mul = mul i32 %y, 4294967288
  %sub = sub i32 %x, %mul
  ret i32 %sub
}
=>
define i32 @test27(i32 %x, i32 %y) {
%0:
  %mul.neg = shl i32 %y, 3
  %sub = add i32 %mul.neg, %x
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> %y, { 4294967288, 4294967290 }
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27vec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = mul <2 x i32> %y, { 8, 6 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27vecsplat(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> %y, { 4294967288, 4294967288 }
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27vecsplat(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = shl <2 x i32> %y, { 3, 3 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27vecmixed(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> %y, { 4294967288, 8 }
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27vecmixed(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = mul <2 x i32> %y, { 8, 4294967288 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test27commuted(i32 %x, i32 %y) {
%0:
  %mul = mul i32 4294967288, %y
  %sub = sub i32 %x, %mul
  ret i32 %sub
}
=>
define i32 @test27commuted(i32 %x, i32 %y) {
%0:
  %mul.neg = shl i32 %y, 3
  %sub = add i32 %mul.neg, %x
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27commutedvec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> { 4294967288, 4294967290 }, %y
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27commutedvec(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = mul <2 x i32> %y, { 8, 6 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27commutedvecsplat(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> { 4294967288, 4294967288 }, %y
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27commutedvecsplat(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = shl <2 x i32> %y, { 3, 3 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test27commutedvecmixed(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul = mul <2 x i32> { 4294967288, 8 }, %y
  %sub = sub <2 x i32> %x, %mul
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test27commutedvecmixed(<2 x i32> %x, <2 x i32> %y) {
%0:
  %mul.neg = mul <2 x i32> %y, { 8, 4294967288 }
  %sub = add <2 x i32> %mul.neg, %x
  ret <2 x i32> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test28(i32 %x, i32 %y, i32 %z) {
%0:
  %neg = sub i32 0, %z
  %mul = mul i32 %neg, %y
  %sub = sub i32 %x, %mul
  ret i32 %sub
}
=>
define i32 @test28(i32 %x, i32 %y, i32 %z) {
%0:
  %1 = mul i32 %z, %y
  %sub = add i32 %1, %x
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test28commuted(i32 %x, i32 %y, i32 %z) {
%0:
  %neg = sub i32 0, %z
  %mul = mul i32 %y, %neg
  %sub = sub i32 %x, %mul
  ret i32 %sub
}
=>
define i32 @test28commuted(i32 %x, i32 %y, i32 %z) {
%0:
  %1 = mul i32 %z, %y
  %sub = add i32 %1, %x
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i64> @test31(<2 x i64> %A) {
%0:
  %xor = xor <2 x i64> %A, { -1, -1 }
  %sub = sub <2 x i64> { 2, 3 }, %xor
  ret <2 x i64> %sub
}
=>
define <2 x i64> @test31(<2 x i64> %A) {
%0:
  %sub = add <2 x i64> %A, { 3, 4 }
  ret <2 x i64> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i64> @test32(<2 x i64> %A) {
%0:
  %add = add <2 x i64> %A, { -1, -1 }
  %sub = sub <2 x i64> { 2, 3 }, %add
  ret <2 x i64> %sub
}
=>
define <2 x i64> @test32(<2 x i64> %A) {
%0:
  %sub = sub <2 x i64> { 3, 4 }, %A
  ret <2 x i64> %sub
}
Transformation seems to be correct!


----------------------------------------
define <2 x i64> @test35(<2 x i64> %A) {
%0:
  %mul = mul <2 x i64> %A, { 3, 4 }
  %sub = sub <2 x i64> %A, %mul
  ret <2 x i64> %sub
}
=>
define <2 x i64> @test35(<2 x i64> %A) {
%0:
  %sub = mul <2 x i64> %A, { -2, -3 }
  ret <2 x i64> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i64> @test36(<2 x i64> %A) {
%0:
  %shl = shl <2 x i64> %A, { 3, 4 }
  %sub = sub <2 x i64> %shl, %A
  ret <2 x i64> %sub
}
=>
define <2 x i64> @test36(<2 x i64> %A) {
%0:
  %sub = mul <2 x i64> %A, { 7, 15 }
  ret <2 x i64> %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test37(<2 x i32> %A) {
%0:
  %div = sdiv <2 x i32> %A, { 2147483648, 2147483648 }
  %sub = sub nsw <2 x i32> { 0, 0 }, %div
  ret <2 x i32> %sub
}
=>
define <2 x i32> @test37(<2 x i32> %A) {
%0:
  %1 = icmp eq <2 x i32> %A, { 2147483648, 2147483648 }
  %div.neg = sext <2 x i1> %1 to <2 x i32>
  ret <2 x i32> %div.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test38(i32 %A) {
%0:
  %div = sdiv i32 %A, 2147483648
  %sub = sub nsw i32 0, %div
  ret i32 %sub
}
=>
define i32 @test38(i32 %A) {
%0:
  %1 = icmp eq i32 %A, 2147483648
  %div.neg = sext i1 %1 to i32
  ret i32 %div.neg
}
Transformation seems to be correct!


----------------------------------------
define i16 @test40(i16 %a, i16 %b) {
%0:
  %ashr = ashr i16 %a, 1
  %ashr1 = ashr i16 %b, 1
  %sub = sub i16 %ashr, %ashr1
  ret i16 %sub
}
=>
define i16 @test40(i16 %a, i16 %b) {
%0:
  %ashr = ashr i16 %a, 1
  %ashr1 = ashr i16 %b, 1
  %sub = sub nsw i16 %ashr, %ashr1
  ret i16 %sub
}
Transformation seems to be correct!


----------------------------------------
define i32 @test41(i16 %a, i16 %b) {
%0:
  %conv = sext i16 %a to i32
  %conv1 = sext i16 %b to i32
  %sub = sub i32 %conv, %conv1
  ret i32 %sub
}
=>
define i32 @test41(i16 %a, i16 %b) {
%0:
  %conv = sext i16 %a to i32
  %conv1 = sext i16 %b to i32
  %sub = sub nsw i32 %conv, %conv1
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i4 @test42(i4 %x, i4 %y) {
%0:
  %a = and i4 %y, 7
  %b = and i4 %x, 7
  %c = sub i4 %a, %b
  ret i4 %c
}
=>
define i4 @test42(i4 %x, i4 %y) {
%0:
  %a = and i4 %y, 7
  %b = and i4 %x, 7
  %c = sub nsw i4 %a, %b
  ret i4 %c
}
Transformation seems to be correct!


----------------------------------------
define i4 @test43(i4 %x, i4 %y) {
%0:
  %a = or i4 %x, 8
  %b = and i4 %y, 7
  %c = sub i4 %a, %b
  ret i4 %c
}
=>
define i4 @test43(i4 %x, i4 %y) {
%0:
  %a = or i4 %x, 8
  %b = and i4 %y, 7
  %c = sub nuw i4 %a, %b
  ret i4 %c
}
Transformation seems to be correct!


----------------------------------------
define i32 @test44(i32 %x) {
%0:
  %sub = sub nsw i32 %x, 32768
  ret i32 %sub
}
=>
define i32 @test44(i32 %x) {
%0:
  %sub = add nsw i32 %x, 4294934528
  ret i32 %sub
}
Transformation seems to be correct!


----------------------------------------
define i32 @test45(i32 %x, i32 %y) {
%0:
  %or = or i32 %x, %y
  %xor = xor i32 %x, %y
  %sub = sub i32 %or, %xor
  ret i32 %sub
}
=>
define i32 @test45(i32 %x, i32 %y) {
%0:
  %sub = and i32 %x, %y
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test45commuted(i32 %x, i32 %y) {
%0:
  %or = or i32 %x, %y
  %xor = xor i32 %y, %x
  %sub = sub i32 %or, %xor
  ret i32 %sub
}
=>
define i32 @test45commuted(i32 %x, i32 %y) {
%0:
  %sub = and i32 %y, %x
  ret i32 %sub
}
Transformation seems to be correct!


----------------------------------------
define i32 @test46(i32 %x, i32 %y) {
%0:
  %or = or i32 %x, %y
  %sub = sub i32 %or, %x
  ret i32 %sub
}
=>
define i32 @test46(i32 %x, i32 %y) {
%0:
  %x.not = xor i32 %x, 4294967295
  %sub = and i32 %x.not, %y
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test46commuted(i32 %x, i32 %y) {
%0:
  %or = or i32 %y, %x
  %sub = sub i32 %or, %x
  ret i32 %sub
}
=>
define i32 @test46commuted(i32 %x, i32 %y) {
%0:
  %x.not = xor i32 %x, 4294967295
  %sub = and i32 %x.not, %y
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test47(i1 %A, i32 %B, i32 %C, i32 %D) {
%0:
  %sel0 = select i1 %A, i32 %D, i32 %B
  %sel1 = select i1 %A, i32 %C, i32 %B
  %sub = sub i32 %sel0, %sel1
  ret i32 %sub
}
=>
define i32 @test47(i1 %A, i32 %B, i32 %C, i32 %D) {
%0:
  %1 = sub i32 %D, %C
  %sub = select i1 %A, i32 %1, i32 0
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test48(i1 %A, i32 %B, i32 %C, i32 %D) {
%0:
  %sel0 = select i1 %A, i32 %B, i32 %D
  %sel1 = select i1 %A, i32 %B, i32 %C
  %sub = sub i32 %sel0, %sel1
  ret i32 %sub
}
=>
define i32 @test48(i1 %A, i32 %B, i32 %C, i32 %D) {
%0:
  %1 = sub i32 %D, %C
  %sub = select i1 %A, i32 0, i32 %1
  ret i32 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test49(i32 %X) {
%0:
  %sub = sub i32 129, %X
  %res = and i32 %sub, 64
  ret i32 %res
}
=>
define i32 @test49(i32 %X) {
%0:
  %sub = sub i32 1, %X
  %res = and i32 %sub, 64
  ret i32 %res
}
Transformation seems to be correct!


----------------------------------------
define i32 @test50(i32 %X) {
%0:
  %sub = sub i32 129, %X
  %res = and i32 %sub, 127
  ret i32 %res
}
=>
define i32 @test50(i32 %X) {
%0:
  %sub = sub i32 1, %X
  %res = and i32 %sub, 127
  ret i32 %res
}
Transformation seems to be correct!


----------------------------------------
define i32 @test51(i32 %X) {
%0:
  %sub = sub i32 254, %X
  %res = and i32 %sub, 64
  ret i32 %res
}
=>
define i32 @test51(i32 %X) {
%0:
  %sub = sub i32 126, %X
  %res = and i32 %sub, 64
  ret i32 %res
}
Transformation seems to be correct!


----------------------------------------
define i32 @test52(i32 %X) {
%0:
  %sub = sub i32 254, %X
  %res = and i32 %sub, 127
  ret i32 %res
}
=>
define i32 @test52(i32 %X) {
%0:
  %sub = sub i32 126, %X
  %res = and i32 %sub, 127
  ret i32 %res
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test53(<2 x i1> %A, <2 x i1> %B) {
%0:
  %sub = sub <2 x i1> %A, %B
  ret <2 x i1> %sub
}
=>
define <2 x i1> @test53(<2 x i1> %A, <2 x i1> %B) {
%0:
  %sub = xor <2 x i1> %B, %A
  ret <2 x i1> %sub
}
Transformation seems to be correct!


----------------------------------------
define i32 @test54(i1 %C) {
%0:
  %A = select i1 %C, i32 1000, i32 10
  %V = sub i32 123, %A
  ret i32 %V
}
=>
define i32 @test54(i1 %C) {
%0:
  %V = select i1 %C, i32 4294966419, i32 113
  ret i32 %V
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test54vec(i1 %C) {
%0:
  %A = select i1 %C, <2 x i32> { 1000, 1000 }, <2 x i32> { 10, 10 }
  %V = sub <2 x i32> { 123, 123 }, %A
  ret <2 x i32> %V
}
=>
define <2 x i32> @test54vec(i1 %C) {
%0:
  %V = select i1 %C, <2 x i32> { 4294966419, 4294966419 }, <2 x i32> { 113, 113 }
  ret <2 x i32> %V
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test54vec2(i1 %C) {
%0:
  %A = select i1 %C, <2 x i32> { 1000, 2500 }, <2 x i32> { 10, 30 }
  %V = sub <2 x i32> { 123, 333 }, %A
  ret <2 x i32> %V
}
=>
define <2 x i32> @test54vec2(i1 %C) {
%0:
  %V = select i1 %C, <2 x i32> { 4294966419, 4294965129 }, <2 x i32> { 113, 303 }
  ret <2 x i32> %V
}
Transformation seems to be correct!


----------------------------------------
define i32 @test55(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A = phi i32 [ 1000, %entry ], [ 10, %delay ]
  %value = sub i32 123, %A
  ret i32 %value
}
=>
define i32 @test55(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A.neg = phi i32 [ 4294966419, %entry ], [ 113, %delay ]
  ret i32 %A.neg
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test55vec(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A = phi <2 x i32> [ { 1000, 1000 }, %entry ], [ { 10, 10 }, %delay ]
  %value = sub <2 x i32> { 123, 123 }, %A
  ret <2 x i32> %value
}
=>
define <2 x i32> @test55vec(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A.neg = phi <2 x i32> [ { 4294966419, 4294966419 }, %entry ], [ { 113, 113 }, %delay ]
  ret <2 x i32> %A.neg
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test55vec2(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A = phi <2 x i32> [ { 1000, 2500 }, %entry ], [ { 10, 30 }, %delay ]
  %value = sub <2 x i32> { 123, 333 }, %A
  ret <2 x i32> %value
}
=>
define <2 x i32> @test55vec2(i1 %which) {
%entry:
  br i1 %which, label %final, label %delay

%delay:
  br label %final

%final:
  %A.neg = phi <2 x i32> [ { 4294966419, 4294965129 }, %entry ], [ { 113, 303 }, %delay ]
  ret <2 x i32> %A.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test56(i32 %A, i32 %B) {
%0:
  %X = add i32 %A, %B
  %Y = sub i32 %A, %X
  ret i32 %Y
}
=>
define i32 @test56(i32 %A, i32 %B) {
%0:
  %Y = sub i32 0, %B
  ret i32 %Y
}
Transformation seems to be correct!


----------------------------------------
define i32 @test57(i32 %A, i32 %B) {
%0:
  %X = add i32 %B, %A
  %Y = sub i32 %A, %X
  ret i32 %Y
}
=>
define i32 @test57(i32 %A, i32 %B) {
%0:
  %Y = sub i32 0, %B
  ret i32 %Y
}
Transformation seems to be correct!


----------------------------------------
define i64 @test58(* %foo, i64 %i, i64 %j) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 %i
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 %j
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  ret i64 %sub
}
=>
define i64 @test58(* %foo, i64 %i, i64 %j) {
%0:
  %gep1.offs = add nsw i64 %i, 4200
  %gep2.offs = add nsw i64 %j, 4200
  %gepdiff = sub nsw i64 %gep1.offs, %gep2.offs
  ret i64 %gepdiff
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
@dummy_global1 = global 8 bytes, align 8
@dummy_global2 = global 8 bytes, align 8

define i64 @test59(* %foo, i64 %i) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 %i
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  store * %gep1, * @dummy_global1, align 8
  store * %gep2, * @dummy_global2, align 8
  ret i64 %sub
}
=>
@dummy_global1 = global 8 bytes, align 8
@dummy_global2 = global 8 bytes, align 8

define i64 @test59(* %foo, i64 %i) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 %i
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  store * %gep1, * @dummy_global1, align 8
  store * %gep2, * @dummy_global2, align 8
  ret i64 %i
}
Transformation seems to be correct!


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

define i64 @test60(* %foo, i64 %i, i64 %j) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 %j, 1 x i64 %i
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  store * %gep1, * @dummy_global1, align 8
  ret i64 %sub
}
=>
@dummy_global1 = global 8 bytes, align 8

define i64 @test60(* %foo, i64 %i, i64 %j) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 %j, 1 x i64 %i
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  store * %gep1, * @dummy_global1, align 8
  ret i64 %sub
}
Transformation seems to be correct!


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

define i64 @test61(* %foo, i64 %i, i64 %j) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 %j, 1 x i64 %i
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  store * %gep2, * @dummy_global2, align 8
  ret i64 %sub
}
=>
@dummy_global2 = global 8 bytes, align 8

define i64 @test61(* %foo, i64 %i, i64 %j) {
%0:
  %gep1 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 42, 1 x i64 0
  %gep2 = gep inbounds * %foo, 10000 x i64 0, 100 x i64 %j, 1 x i64 %i
  %cast1 = ptrtoint * %gep1 to i64
  %cast2 = ptrtoint * %gep2 to i64
  %sub = sub i64 %cast1, %cast2
  store * %gep2, * @dummy_global2, align 8
  ret i64 %sub
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test62(i32 %A) {
%0:
  %B = sub i32 1, %A
  %C = shl i32 %B, 1
  ret i32 %C
}
=>
define i32 @test62(i32 %A) {
%0:
  %B.neg = mul i32 %A, 4294967294
  %C = add i32 %B.neg, 2
  ret i32 %C
}
Transformation seems to be correct!


----------------------------------------
define <2 x i32> @test62vec(<2 x i32> %A) {
%0:
  %B = sub <2 x i32> { 1, 1 }, %A
  %C = shl <2 x i32> %B, { 1, 1 }
  ret <2 x i32> %C
}
=>
define <2 x i32> @test62vec(<2 x i32> %A) {
%0:
  %B.neg = mul <2 x i32> %A, { 4294967294, 4294967294 }
  %C = add <2 x i32> %B.neg, { 2, 2 }
  ret <2 x i32> %C
}
Transformation seems to be correct!


----------------------------------------
define i32 @test63(i32 %A) {
%0:
  %B = sub i32 1, %A
  %C = shl i32 %B, 1
  %D = sub i32 2, %C
  ret i32 %D
}
=>
define i32 @test63(i32 %A) {
%0:
  %B.neg.neg = shl i32 %A, 1
  ret i32 %B.neg.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define <2 x i32> @test63vec(<2 x i32> %A) {
%0:
  %B = sub <2 x i32> { 1, 1 }, %A
  %C = shl <2 x i32> %B, { 1, 1 }
  %D = sub <2 x i32> { 2, 2 }, %C
  ret <2 x i32> %D
}
=>
define <2 x i32> @test63vec(<2 x i32> %A) {
%0:
  %B.neg.neg = shl <2 x i32> %A, { 1, 1 }
  ret <2 x i32> %B.neg.neg
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test64(i32 %x) {
%0:
  %1 = xor i32 %x, 4294967295
  %2 = icmp sgt i32 %1, 4294967040
  %3 = select i1 %2, i32 %1, i32 4294967040
  %res = sub i32 0, %3
  ret i32 %res
}
=>
define i32 @test64(i32 %x) {
%0:
  %1 = icmp slt i32 %x, 255
  %2 = select i1 %1, i32 %x, i32 255
  %.neg = add nsw i32 %2, 1
  ret i32 %.neg
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
i32 %x = undef

Source:
i32 %1 = #xffffffff (4294967295, -1)	[based on undef value]
i1 %2 = #x1 (1)
i32 %3 = #xffffffff (4294967295, -1)	[based on undef value]
i32 %res = #x00000001 (1)

Target:
i1 %1 = #x1 (1)
i32 %2 = #x7fffffff (2147483647)
i32 %.neg = poison
Source value: #x00000001 (1)
Target value: poison


------------------- SMT STATS -------------------
Num queries: 355
Num invalid: 0
Num skips:   0
Num trivial: 301 (45.9%)
Num timeout: 45 (12.7%)
Num errors:  0 (0.0%)
Num SAT:     103 (29.0%)
Num UNSAT:   207 (58.3%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/InstCombine/sub.ll
+ /home/nlopes/alive2/build/opt-alive.sh -instcombine -S

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/InstCombine/sub.ll

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back