Test Failure: Transforms/InstCombine/getelementptr.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define * @test1(* %I) {
%0:
  %A = gep * %I, 4 x i64 0
  ret * %A
}
=>
define * @test1(* %I) {
%0:
  ret * %I
}
Transformation seems to be correct!


----------------------------------------
define * @test2(* %I) {
%0:
  %A = gep * %I
  ret * %A
}
=>
define * @test2(* %I) {
%0:
  ret * %I
}
Transformation seems to be correct!


----------------------------------------
define * @test3(* %I) {
%0:
  %A = gep * %I, 4 x i64 17
  %B = gep * %A, 4 x i64 4
  ret * %B
}
=>
define * @test3(* %I) {
%0:
  %B = gep * %I, 4 x i64 21
  ret * %B
}
Transformation seems to be correct!


----------------------------------------
define * @test4(* %I) {
%0:
  %A = gep * %I, 4 x i64 1
  %B = gep * %A, 4 x i64 0, 1 x i64 0
  ret * %B
}
=>
define * @test4(* %I) {
%0:
  %B = gep * %I, 4 x i64 1, 1 x i64 0
  ret * %B
}
Transformation seems to be correct!


----------------------------------------
@Global = global 10 bytes, align 1

define void @test5(i8 %B) {
%0:
  %A = gep * @Global, 10 x i64 0, 1 x i64 4
  store i8 %B, * %A, align 1
  ret void
}
=>
@Global = global 10 bytes, align 1

define void @test5(i8 %B) {
%0:
  %__constexpr_0 = gep inbounds * @Global, 10 x i64 0, 1 x i64 4
  store i8 %B, * %__constexpr_0, align 1
  ret void
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   %A = getelementptr [10 x i8], [10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4
ERROR: Unsupported instruction:   store i8 %B, i8 addrspace(1)* getelementptr inbounds ([10 x i8], [10 x i8] addrspace(1)* @Global_as1, i16 0, i16 4), align 1

----------------------------------------
define * @test7(* %I, i64 %C, i64 %D) {
%0:
  %A = gep * %I, 4 x i64 %C
  %B = gep * %A, 4 x i64 %D
  ret * %B
}
=>
define * @test7(* %I, i64 %C, i64 %D) {
%0:
  %A = gep * %I, 4 x i64 %C
  %B = gep * %A, 4 x i64 %D
  ret * %B
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define * @test8(* %X) {
%0:
  %A = gep * %X, 40 x i64 0, 4 x i64 0
  %B = bitcast * %A to *
  ret * %B
}
=>
define * @test8(* %X) {
%0:
  %B = bitcast * %X to *
  ret * %B
}
Transformation seems to be correct!


----------------------------------------
define i32 @test9() {
%0:
  %A = gep * null, 16 x i32 0, 1 x i64 8
  %B = ptrtoint * %A to i32
  ret i32 %B
}
=>
define i32 @test9() {
%0:
  ret i32 8
}
Transformation seems to be correct!


----------------------------------------
define i1 @test10(* %x, * %y) {
%0:
  %tmp.1 = gep * %x, 8 x i32 0, 1 x i64 4
  %tmp.3 = gep * %y, 8 x i32 0, 1 x i64 4
  %tmp.4 = icmp eq * %tmp.1, %tmp.3
  ret i1 %tmp.4
}
=>
define i1 @test10(* %x, * %y) {
%0:
  %tmp.4 = icmp eq * %x, %y
  ret i1 %tmp.4
}
Transformation seems to be correct!


----------------------------------------
define i1 @test11(* %X) {
%0:
  %P = gep * %X, 8 x i32 0, 1 x i64 0
  %Q = icmp eq * %P, null
  ret i1 %Q
}
=>
define i1 @test11(* %X) {
%0:
  %Q = icmp eq * %X, null
  ret i1 %Q
}
Transformation seems to be correct!


----------------------------------------
define i32 @test12(* %a) {
%entry:
  %g3 = gep * %a, 16 x i32 0, 1 x i64 8
  store i32 10, * %g3, align 4
  %g4 = gep * %a, 16 x i32 0, 1 x i64 0
  %new_a = bitcast * %g4 to *
  %g5 = gep * %new_a, 16 x i32 0, 1 x i64 8
  %a_a = load i32, * %g5, align 4
  ret i32 %a_a
}
=>
define i32 @test12(* %a) {
%entry:
  %g3 = gep * %a, 16 x i64 0, 1 x i64 8
  store i32 10, * %g3, align 4
  ret i32 10
}
Transformation seems to be correct!


----------------------------------------
define i1 @test13(i64 %X, * %P) {
%0:
  %A = gep inbounds * %P, 404 x i32 0, 1 x i64 4, 4 x i64 %X
  %B = gep inbounds * %P, 404 x i32 0, 1 x i64 0
  %C = icmp eq * %A, %B
  ret i1 %C
}
=>
define i1 @test13(i64 %X, * %P) {
%0:
  %C = icmp eq i64 %X, -1
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test13_vector(<2 x i64> %X, <2 x *> %P) {
%0:
  %A = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 4, 4 }, 4 x <2 x i64> %X
  %B = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 0, 0 }
  %C = icmp eq <2 x *> %A, %B
  ret <2 x i1> %C
}
=>
define <2 x i1> @test13_vector(<2 x i64> %X, <2 x *> %P) {
%0:
  %C = icmp eq <2 x i64> %X, { -1, -1 }
  ret <2 x i1> %C
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test13_vector2(i64 %X, <2 x *> %P) {
%0:
  %A = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 4, 4 }, 4 x i64 %X
  %B = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 0, 0 }
  %C = icmp eq <2 x *> %A, %B
  ret <2 x i1> %C
}
=>
define <2 x i1> @test13_vector2(i64 %X, <2 x *> %P) {
%0:
  %.splatinsert = insertelement <2 x i64> undef, i64 %X, i32 0
  %1 = shl <2 x i64> %.splatinsert, { 2, undef }
  %2 = icmp eq <2 x i64> %1, { -4, undef }
  %C = shufflevector <2 x i1> %2, <2 x i1> undef, 0, 0
  ret <2 x i1> %C
}
Transformation seems to be correct!


----------------------------------------
define <2 x i1> @test13_vector3(i64 %X, <2 x *> %P) {
%0:
  %A = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 4, 4 }, 4 x i64 %X
  %B = gep inbounds <2 x *> %P, 404 x <2 x i64> { 0, 0 }, 1 x <2 x i64> { 4, 4 }, 4 x i64 1
  %C = icmp eq <2 x *> %A, %B
  ret <2 x i1> %C
}
=>
define <2 x i1> @test13_vector3(i64 %X, <2 x *> %P) {
%0:
  %.splatinsert = insertelement <2 x i64> undef, i64 %X, i32 0
  %1 = shl <2 x i64> %.splatinsert, { 2, undef }
  %2 = icmp eq <2 x i64> %1, { 4, undef }
  %C = shufflevector <2 x i1> %2, <2 x i1> undef, 0, 0
  ret <2 x i1> %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test13_i32(i32 %X, * %P) {
%0:
  %A = gep inbounds * %P, 404 x i32 0, 1 x i64 4, 4 x i32 %X
  %B = gep inbounds * %P, 404 x i32 0, 1 x i64 0
  %C = icmp eq * %A, %B
  ret i1 %C
}
=>
define i1 @test13_i32(i32 %X, * %P) {
%0:
  %C = icmp eq i32 %X, 4294967295
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test13_i16(i16 %X, * %P) {
%0:
  %A = gep inbounds * %P, 404 x i16 0, 1 x i64 4, 4 x i16 %X
  %B = gep inbounds * %P, 404 x i16 0, 1 x i64 0
  %C = icmp eq * %A, %B
  ret i1 %C
}
=>
define i1 @test13_i16(i16 %X, * %P) {
%0:
  %C = icmp eq i16 %X, 65535
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test13_i128(i128 %X, * %P) {
%0:
  %A = gep inbounds * %P, 404 x i128 0, 1 x i64 4, 4 x i128 %X
  %B = gep inbounds * %P, 404 x i128 0, 1 x i64 0
  %C = icmp eq * %A, %B
  ret i1 %C
}
=>
define i1 @test13_i128(i128 %X, * %P) {
%0:
  %1 = trunc i128 %X to i64
  %C = icmp eq i64 %1, -1
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
@G = global 3 bytes, align 1

define * @test14(i32 %idx) {
%0:
  %zext = zext i32 %idx to i64
  %__constexpr_0 = gep inbounds * @G, 3 x i32 0, 1 x i32 0
  %tmp = gep * %__constexpr_0, 1 x i64 %zext
  ret * %tmp
}
=>
@G = global 3 bytes, align 1

define * @test14(i32 %idx) {
%0:
  %zext = zext i32 %idx to i64
  %tmp = gep * @G, 3 x i64 0, 1 x i64 %zext
  ret * %tmp
}
Transformation seems to be correct!


----------------------------------------
@Array = global 160 bytes, align 4

define * @test15(i64 %X) {
%0:
  %__constexpr_0 = gep inbounds * @Array, 160 x i64 0, 4 x i64 0
  %A = gep * %__constexpr_0, 4 x i64 %X
  ret * %A
}
=>
@Array = global 160 bytes, align 4

define * @test15(i64 %X) {
%0:
  %A = gep * @Array, 160 x i64 0, 4 x i64 %X
  ret * %A
}
Transformation seems to be correct!


----------------------------------------
define * @test16(* %X, i32 %Idx) {
%0:
  %R = gep * %X, 4 x i32 %Idx
  ret * %R
}
=>
define * @test16(* %X, i32 %Idx) {
%0:
  %1 = sext i32 %Idx to i64
  %R = gep * %X, 4 x i64 %1
  ret * %R
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test17(* %P, i32 %I, i32 %J) {
%0:
  %X = gep inbounds * %P, 2 x i32 %I
  %Y = gep inbounds * %P, 2 x i32 %J
  %C = icmp ult * %X, %Y
  ret i1 %C
}
=>
define i1 @test17(* %P, i32 %I, i32 %J) {
%0:
  %C = icmp slt i32 %I, %J
  ret i1 %C
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i1 @test18(* %P, i32 %I) {
%0:
  %X = gep inbounds * %P, 2 x i32 %I
  %C = icmp ult * %X, %P
  ret i1 %C
}
=>
define i1 @test18(* %P, i32 %I) {
%0:
  %C = icmp slt i32 %I, 0
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test18_i16(* %P, i16 %I) {
%0:
  %X = gep inbounds * %P, 2 x i16 %I
  %C = icmp ult * %X, %P
  ret i1 %C
}
=>
define i1 @test18_i16(* %P, i16 %I) {
%0:
  %C = icmp slt i16 %I, 0
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test18_i64(* %P, i64 %I) {
%0:
  %X = gep inbounds * %P, 2 x i64 %I
  %C = icmp ult * %X, %P
  ret i1 %C
}
=>
define i1 @test18_i64(* %P, i64 %I) {
%0:
  %C = icmp slt i64 %I, 0
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i1 @test18_i128(* %P, i128 %I) {
%0:
  %X = gep inbounds * %P, 2 x i128 %I
  %C = icmp ult * %X, %P
  ret i1 %C
}
=>
define i1 @test18_i128(* %P, i128 %I) {
%0:
  %1 = trunc i128 %I to i64
  %C = icmp slt i64 %1, 0
  ret i1 %C
}
Transformation seems to be correct!


----------------------------------------
define i32 @test19(* %P, i32 %A, i32 %B) {
%0:
  %tmp.4 = gep inbounds * %P, 4 x i32 %A
  %tmp.9 = gep inbounds * %P, 4 x i32 %B
  %tmp.10 = icmp eq * %tmp.4, %tmp.9
  %tmp.11 = zext i1 %tmp.10 to i32
  ret i32 %tmp.11
}
=>
define i32 @test19(* %P, i32 %A, i32 %B) {
%0:
  %tmp.10 = icmp eq i32 %A, %B
  %tmp.11 = zext i1 %tmp.10 to i32
  ret i32 %tmp.11
}
Transformation seems to be correct!


----------------------------------------
define i32 @test20(* %P, i32 %A, i32 %B) {
%0:
  %tmp.4 = gep inbounds * %P, 4 x i32 %A
  %tmp.6 = icmp eq * %tmp.4, %P
  %tmp.7 = zext i1 %tmp.6 to i32
  ret i32 %tmp.7
}
=>
define i32 @test20(* %P, i32 %A, i32 %B) {
%0:
  %tmp.6 = icmp eq i32 %A, 0
  %tmp.7 = zext i1 %tmp.6 to i32
  ret i32 %tmp.7
}
Transformation seems to be correct!


----------------------------------------
define i32 @test21() {
%0:
  %pbob1 = alloca i64 4, align 8
  %pbob2 = gep * %pbob1
  %pbobel = gep * %pbob2, 4 x i64 0, 1 x i64 0
  %rval = load i32, * %pbobel, align 4
  ret i32 %rval
}
=>
define i32 @test21() {
%0:
  %pbob1 = alloca i64 4, align 8
  %pbobel = gep inbounds * %pbob1, 4 x i64 0, 1 x i64 0
  %rval = load i32, * %pbobel, align 8
  ret i32 %rval
}
Transformation seems to be correct!


----------------------------------------
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i1 @test22() {
%0:
  %__constexpr_0 = gep inbounds * @A, 4 x i64 1
  %__constexpr_1 = gep * @B, 4 x i64 2
  %C = icmp ult * %__constexpr_0, %__constexpr_1
  ret i1 %C
}
=>
@A = global 4 bytes, align 4
@B = global 4 bytes, align 4

define i1 @test22() {
%0:
  %__constexpr_1 = gep inbounds * @A, 4 x i64 1
  %__constexpr_2 = gep * @B, 4 x i64 2
  %__constexpr_0 = icmp ult * %__constexpr_1, %__constexpr_2
  ret i1 %__constexpr_0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test23() {
%0:
  %A = gep * null, 44 x i64 0, 1 x i64 0, 4 x i64 0
  %B = icmp ne * %A, null
  ret i1 %B
}
=>
define i1 @test23() {
%0:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define void @test25() {
%entry:
  %tmp = gep * null, 32 x i32 0, 1 x i64 24
  %tmp.upgrd.1 = load i64, * %tmp, align 4
  %tmp8.ui = load i64, * null, align 4
  %tmp8 = bitcast i64 %tmp8.ui to i64
  %tmp9 = and i64 %tmp8, %tmp.upgrd.1
  %sext = trunc i64 %tmp9 to i32
  %tmp27.i = sext i32 %sext to i64
  call void @foo25(i32 0, i64 %tmp27.i)
  assume i1 0
}
=>
define void @test25() {
%entry:
  store i64 undef, * null, align 536870912
  call void @foo25(i32 0, i64 0)
  assume i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @test26(* %arr) {
%0:
  %X = gep * %arr, 1 x i32 1
  %Y = gep * %arr, 1 x i32 1
  %test = icmp uge * %X, %Y
  ret i1 %test
}
=>
define i1 @test26(* %arr) {
%0:
  ret i1 1
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   %tmp360 = call i32 asm sideeffect "...", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"(i32 %tmp351, %struct.__large_struct* null, i32 -14, i32 0)
ERROR: Unsupported instruction:   %tmp360 = call i32 asm sideeffect "...", "=r,ir,*m,i,0,~{dirflag},~{fpsr},~{flags}"(i32 %tmp351, %struct.__large_struct* null, i32 -14, i32 0) #0

----------------------------------------
@.str = constant 6 bytes, align 1
@.str1 = constant 12 bytes, align 1

define i32 @test28() {
#init:
  store [6 x i8] { 77, 97, 105, 110, 33, 0 }, * @.str, align 1
  store [12 x i8] { 100, 101, 115, 116, 114, 111, 121, 32, 37, 112, 10, 0 }, * @.str1, align 1
  br label %entry

%entry:
  %orientations = alloca i64 1, align 8
  %__constexpr_0 = gep inbounds * @.str, 6 x i32 0, 1 x i32 0
  %tmp3 = call i32 @puts(* %__constexpr_0)	; WARNING: unknown known function
  %tmp45 = gep inbounds * %orientations, 1 x i32 1, 1 x i32 0, 1 x i32 0
  %orientations62 = gep * %orientations, 1 x i32 0, 1 x i32 0, 1 x i32 0
  br label %bb10

%bb10:
  %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ]
  %tmp.0.reg2mem.0.rec = mul i32 %indvar, 4294967295
  %tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, 4294967295
  %tmp12 = gep inbounds * %tmp45, 1 x i32 %tmp12.rec
  %__constexpr_1 = gep inbounds * @.str1, 12 x i32 0, 1 x i32 0
  %tmp16 = call i32 @printf(* %__constexpr_1, * %tmp12)	; WARNING: unknown known function
  %tmp84 = icmp eq * %tmp12, %orientations62
  %indvar.next = add i32 %indvar, 1
  br i1 %tmp84, label %bb17, label %bb10

%bb17:
  ret i32 0
}
=>
@.str = constant 6 bytes, align 1
@.str1 = constant 12 bytes, align 1

define i32 @test28() {
#init:
  store [6 x i8] { 77, 97, 105, 110, 33, 0 }, * @.str, align 1
  store [12 x i8] { 100, 101, 115, 116, 114, 111, 121, 32, 37, 112, 10, 0 }, * @.str1, align 1
  br label %entry

%entry:
  %orientations = alloca i64 1, align 8
  %__constexpr_0 = gep inbounds * @.str, 6 x i64 0, 1 x i64 0
  %tmp3 = call i32 @puts(* %__constexpr_0)	; WARNING: unknown known function
  br label %bb10

%bb10:
  %indvar = phi i32 [ 0, %entry ], [ %indvar.next, %bb10 ]
  %tmp12.rec = xor i32 %indvar, 4294967295
  %0 = sext i32 %tmp12.rec to i64
  %tmp12 = gep inbounds * %orientations, 1 x i64 1, 1 x i64 0, 1 x i64 %0
  %__constexpr_1 = gep inbounds * @.str1, 12 x i64 0, 1 x i64 0
  %tmp16 = call i32 @printf(* %__constexpr_1, * %tmp12)	; WARNING: unknown known function
  %tmp84 = icmp eq i32 %indvar, 0
  %indvar.next = add i32 %indvar, 1
  br i1 %tmp84, label %bb17, label %bb10

%bb17:
  ret i32 0
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define i32 @test29(* %start, i32 %X) {
%entry:
  %tmp3 = load i64, * null, align 4
  %add.ptr = gep * %start, 1 x i64 %tmp3
  %tmp158 = load i32, * null, align 4
  %add.ptr159 = gep * null, 24 x i32 %tmp158
  %add.ptr209 = gep * %start, 1 x i64 0
  %add.ptr212 = gep * %add.ptr209, 1 x i32 %X
  %cmp214 = icmp ugt * %add.ptr212, %add.ptr
  br i1 %cmp214, label %if.then216, label %if.end363

%if.end363:
  ret i32 0

%if.then216:
  ret i32 1
}
=>
define i32 @test29(* %start, i32 %X) {
%entry:
  store i64 undef, * null, align 536870912
  %add.ptr = gep * %start, 1 x i64 undef
  %0 = sext i32 %X to i64
  %add.ptr212 = gep * %start, 1 x i64 %0
  %cmp214 = icmp ugt * %add.ptr212, %add.ptr
  br i1 %cmp214, label %if.then216, label %if.end363

%if.end363:
  ret i32 0

%if.then216:
  ret i32 1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test30(i32 %m, i32 %n) {
%entry:
  %0 = alloca i64 4 x i32 %n, align 4
  %1 = bitcast * %0 to *
  call void @test30f(* %0)
  %2 = gep * %1, 0 x i32 0, 4 x i32 %m
  %3 = load i32, * %2, align 4
  ret i32 %3
}
=>
define i32 @test30(i32 %m, i32 %n) {
%entry:
  %0 = zext i32 %n to i64
  %1 = alloca i64 4 x i64 %0, align 4
  call void @test30f(* %1)
  %2 = sext i32 %m to i64
  %3 = gep * %1, 4 x i64 %2
  %4 = load i32, * %3, align 4
  ret i32 %4
}
Transformation seems to be correct!


----------------------------------------
define i1 @test31(* %A) {
%0:
  %B = gep * %A, 4 x i32 1
  %C = gep * %A, 4 x i64 1
  %V = icmp eq * %B, %C
  ret i1 %V
}
=>
define i1 @test31(* %A) {
%0:
  ret i1 1
}
Transformation seems to be correct!


----------------------------------------
define * @test32(* %v) {
%0:
  %A = alloca i64 32, align 16
  %B = gep * %A, 32 x i32 0, 8 x i32 0
  store * null, * %B, align 8
  %C = bitcast * %A to *
  %D = gep * %C, 16 x i32 0, 1 x i64 0, 1 x i32 8
  %E = bitcast * %D to *
  store * %v, * %E, align 8
  %F = gep * %A, 32 x i32 0, 8 x i32 2
  %G = load *, * %F, align 8
  ret * %G
}
=>
define * @test32(* %v) {
%0:
  %A = alloca i64 32, align 16
  %B = gep inbounds * %A, 32 x i64 0, 8 x i64 0
  store * null, * %B, align 16
  %D = gep inbounds * %A, 32 x i64 0, 8 x i64 1
  store * %v, * %D, align 8
  %F = gep inbounds * %A, 32 x i64 0, 8 x i64 2
  %G = load *, * %F, align 16
  ret * %G
}
Transformation seems to be correct!


----------------------------------------
define * @test33(* %A) {
%0:
  %B = bitcast * %A to *
  %C = gep * %B, 8 x i32 0, 1 x i64 4
  ret * %C
}
=>
define * @test33(* %A) {
%0:
  %1 = gep * %A, 8 x i64 0, 1 x i64 0, 1 x i64 4
  ret * %1
}
Transformation seems to be correct!


----------------------------------------
define * @test34(* %Val, i64 %V) {
%entry:
  %A = alloca i64 16, align 8
  %mrv_gep = bitcast * %A to *
  %B = gep * %A, 16 x i64 0, 1 x i64 0
  store i64 %V, * %mrv_gep, align 4
  %C = load *, * %B, align 8
  ret * %C
}
=>
define * @test34(* %Val, i64 %V) {
%entry:
  %C.cast = int2ptr i64 %V to *
  ret * %C.cast
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
@LC8 = constant 17 bytes, align 1
@s = global 32 bytes, align 8

define i32 @test35() {
%0:
  %__constexpr_0 = gep inbounds * @LC8, 17 x i32 0, 1 x i32 0
  %__constexpr_2 = bitcast * @s to *
  %__constexpr_1 = gep * %__constexpr_2, 8 x i32 0, 1 x i64 8, 1 x i32 0
  %1 = call i32 @printf(* %__constexpr_0, * %__constexpr_1)	; WARNING: unknown known function
  ret i32 0
}
=>
@LC8 = constant 17 bytes, align 1
@s = global 32 bytes, align 8

define i32 @test35() {
%0:
  %__constexpr_0 = gep inbounds * @LC8, 17 x i64 0, 1 x i64 0
  %__constexpr_1 = gep inbounds * @s, 32 x i64 0, 1 x i64 8, 1 x i64 0
  %1 = call i32 @printf(* %__constexpr_0, * %__constexpr_1)	; WARNING: unknown known function
  ret i32 0
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
@array = global 11 bytes, align 1

define * @test36() {
%0:
  %__constexpr_0 = gep * @array, 11 x i32 0, 1 x i64 -1
  ret * %__constexpr_0
}
=>
@array = global 11 bytes, align 1

define * @test36() {
%0:
  %__constexpr_0 = gep * @array, 11 x i64 0, 1 x i64 -1
  ret * %__constexpr_0
}
Transformation seems to be correct!


----------------------------------------
@A37 = constant 1 bytes, align 1

define i1 @test37() {
%0:
  %__constexpr_0 = gep inbounds * @A37, 1 x i64 1, 1 x i64 0
  %__constexpr_1 = gep inbounds * @A37, 1 x i64 1, 1 x i64 0
  %t = icmp eq * %__constexpr_0, %__constexpr_1
  ret i1 %t
}
=>
@A37 = constant 1 bytes, align 1

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


----------------------------------------
define * @test38(* %I, i32 %n) {
%0:
  %A = gep * %I, 4 x i32 %n
  ret * %A
}
=>
define * @test38(* %I, i32 %n) {
%0:
  %1 = sext i32 %n to i64
  %A = gep * %I, 4 x i64 %1
  ret * %A
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define void @pr10322_f1(* %foo) {
%entry:
  %arrayidx8 = gep inbounds * %foo, 8 x i64 2
  call void @pr10322_f2(* %arrayidx8)
  %tmp2 = gep inbounds * %arrayidx8, 8 x i64 0, 1 x i64 0
  call void @pr10322_f3(* %tmp2)
  ret void
}
=>
define void @pr10322_f1(* %foo) {
%entry:
  %arrayidx8 = gep inbounds * %foo, 8 x i64 2
  call void @pr10322_f2(* %arrayidx8)
  %tmp2 = gep inbounds * %arrayidx8, 8 x i64 0, 1 x i64 0
  call void @pr10322_f3(* %tmp2)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @three_gep_f(* %x) {
%0:
  %gep1 = gep * %x, 4 x i64 2
  call void @three_gep_h(* %gep1)
  %gep2 = gep * %gep1, 4 x i64 0, 1 x i64 0
  %gep3 = gep * %gep2, 4 x i64 0, 1 x i64 0
  call void @three_gep_g(* %gep3)
  ret void
}
=>
define void @three_gep_f(* %x) {
%0:
  %gep1 = gep * %x, 4 x i64 2
  call void @three_gep_h(* %gep1)
  %gep3 = gep * %gep1, 4 x i64 0, 1 x i64 0, 1 x i64 0
  call void @three_gep_g(* %gep3)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test39(* %arg, i8 %arg1) {
%0:
  %tmp = gep inbounds * %arg, 32 x i64 0, 1 x i64 16
  %tmp2 = load *, * %tmp, align 8
  %tmp3 = bitcast * %tmp2 to *
  %tmp4 = gep inbounds * %tmp3, 1 x i64 -8
  store i8 %arg1, * %tmp4, align 8
  ret void
}
=>
define void @test39(* %arg, i8 %arg1) {
%0:
  %tmp = gep inbounds * %arg, 32 x i64 0, 1 x i64 16
  %1 = bitcast * %tmp to *
  %tmp21 = load *, * %1, align 8
  %tmp4 = gep inbounds * %tmp21, 1 x i64 -8
  store i8 %arg1, * %tmp4, align 8
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i1 @pr16483(* %a, * %b) {
%0:
  %c = gep * %a, 1 x i32 0, 1 x i32 0
  %d = gep * %b, 1 x i32 0, 1 x i32 0
  %cmp = icmp ult * %c, %d
  ret i1 %cmp
}
=>
define i1 @pr16483(* %a, * %b) {
%0:
  %cmp = icmp ult * %a, %b
  ret i1 %cmp
}
Transformation seems to be correct!


----------------------------------------
define i64 @test_gep_bitcast_array_same_size_element(* %arr, i64 %N) {
%0:
  %cast = bitcast * %arr to *
  %V = mul i64 %N, 8
  %t = gep * %cast, 8 x i64 %V
  %x = load i64, * %t, align 4
  ret i64 %x
}
=>
define i64 @test_gep_bitcast_array_same_size_element(* %arr, i64 %N) {
%0:
  %V = shl i64 %N, 3
  %t1 = gep * %arr, 800 x i64 0, 8 x i64 %V
  %t = bitcast * %t1 to *
  %x = load i64, * %t, align 4
  ret i64 %x
}
Transformation doesn't verify!
ERROR: Timeout

ERROR: Unsupported instruction:   %cast = addrspacecast [100 x double]* %arr to i64 addrspace(3)*
ERROR: Unsupported instruction:   %t = addrspacecast i64* %1 to i64 addrspace(3)*

----------------------------------------
define i8 @test_gep_bitcast_array_different_size_element(* %arr, i64 %N) {
%0:
  %cast = bitcast * %arr to *
  %V = mul i64 %N, 8
  %t = gep * %cast, 1 x i64 %V
  %x = load i8, * %t, align 1
  ret i8 %x
}
=>
define i8 @test_gep_bitcast_array_different_size_element(* %arr, i64 %N) {
%0:
  %t1 = gep * %arr, 800 x i64 0, 8 x i64 %N
  %t = bitcast * %t1 to *
  %x = load i8, * %t, align 1
  ret i8 %x
}
Transformation seems to be correct!


----------------------------------------
define i64 @test40() {
%0:
  %array = alloca i64 12, align 4
  %gep = gep inbounds * %array, 12 x i64 0, 4 x i64 2
  %gepi8 = bitcast * %gep to *
  %p = ptrtoint * %array to i64
  %np = sub i64 0, %p
  %gep2 = gep * %gepi8, 1 x i64 %np
  %ret = ptrtoint * %gep2 to i64
  ret i64 %ret
}
=>
define i64 @test40() {
%0:
  ret i64 8
}
Transformation seems to be correct!


----------------------------------------
define * @test42(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %sub = sub i64 0, %ptrtoint
  %gep = gep inbounds * %c2, 1 x i64 %sub
  ret * %gep
}
=>
define * @test42(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %1 = ptrtoint * %c2 to i64
  %2 = sub i64 %1, %ptrtoint
  %gep = int2ptr i64 %2 to *
  ret * %gep
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define * @test43(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %sub = sub i64 0, %ptrtoint
  %shr = ashr i64 %sub, 1
  %gep = gep inbounds * %c2, 2 x i64 %shr
  ret * %gep
}
=>
define * @test43(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %1 = ptrtoint * %c2 to i64
  %2 = sub i64 %1, %ptrtoint
  %gep = int2ptr i64 %2 to *
  ret * %gep
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define * @test44(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %sub = sub i64 0, %ptrtoint
  %shr = sdiv i64 %sub, 7
  %gep = gep inbounds * %c2, 7 x i64 %shr
  ret * %gep
}
=>
define * @test44(* %c1, * %c2) {
%0:
  %ptrtoint = ptrtoint * %c1 to i64
  %1 = ptrtoint * %c2 to i64
  %2 = sub i64 %1, %ptrtoint
  %gep = int2ptr i64 %2 to *
  ret * %gep
}
Transformation doesn't verify!
ERROR: Invalid expr


----------------------------------------
define * @test45(* %c1, * %c2) {
%0:
  %ptrtoint1 = ptrtoint * %c1 to i64
  %ptrtoint2 = ptrtoint * %c2 to i64
  %sub = sub i64 %ptrtoint2, %ptrtoint1
  %shr = sdiv i64 %sub, 7
  %gep = gep inbounds * %c1, 7 x i64 %shr
  ret * %gep
}
=>
define * @test45(* %c1, * %c2) {
%0:
  %gep = bitcast * %c2 to *
  ret * %gep
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
* %c1 = pointer(non-local, block_id=1, offset=7790792235569643584)
* %c2 = pointer(non-local, block_id=0, offset=8251192938491543615)

Source:
i64 %ptrtoint1 = #x72907442c8000040 (8255225947142225984)
i64 %ptrtoint2 = #x72822042c800003f (8251192938491543615)
i64 %sub = #xfff1abffffffffff (18442711065058869247, -4033008650682369)
i64 %shr = #xfffdf40000000000 (18446167929616596992, -576144092954624)
* %gep = pointer(non-local, block_id=1, offset=7786759226918961216)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 64	alloc type: 0	address: 0
Block 1 >	size: 8091757595267765772	align: 4	alloc type: 0	address: 464433711572582400
Block 2 >	size: 432992287856263957	align: 2	alloc type: 0	address: 8719085045276516641

Target:
* %gep = pointer(non-local, block_id=0, offset=8251192938491543615)
Source value: pointer(non-local, block_id=1, offset=7786759226918961216)
Target value: pointer(non-local, block_id=0, offset=8251192938491543615)


------------------- SMT STATS -------------------
Num queries: 105
Num invalid: 6
Num skips:   0
Num trivial: 147 (58.3%)
Num timeout: 5 (4.8%)
Num errors:  0 (0.0%)
Num SAT:     56 (53.3%)
Num UNSAT:   44 (41.9%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/scripts/opt-alive.sh -instcombine -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/getelementptr.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/InstCombine/getelementptr.ll

 

<-- Back