Test Failure: Transforms/InstCombine/intptr7.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<llvm::Function> : Skipping NOP
-- 2. InstCombinePass

----------------------------------------
define void @matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  %cmp1 = icmp eq i1 %cond, 0
  %add.int = add i64 %a, 1
  %add = int2ptr i64 %add.int to ptr
  %addb = gep inbounds ptr %b, 4 x i64 2
  %addb.int = ptrtoint ptr %addb to i64
  br i1 %cmp1, label %bb1, label %bb2

bb2:
  store float 10.000000, ptr %add, align 4
  br label %bb3

bb1:
  br label %bb3

bb3:
  %a.addr.03 = phi ptr [ %addb, %bb1 ], [ %add, %bb2 ]
  %b.addr.02 = phi i64 [ %addb.int, %bb1 ], [ %add.int, %bb2 ]
  %i0 = int2ptr i64 %b.addr.02 to ptr
  %i1 = load float, ptr %i0, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define void @matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  %cmp1 = icmp eq i1 %cond, 0
  %add.int = add i64 %a, 1
  %add = int2ptr i64 %add.int to ptr
  %addb = gep inbounds ptr %b, 4 x i64 2
  %addb.int = ptrtoint ptr %addb to i64
  br i1 %cmp1, label %bb1, label %bb2

bb2:
  store float 10.000000, ptr %add, align 4
  br label %bb3

bb1:
  br label %bb3

bb3:
  %a.addr.03 = phi ptr [ %addb, %bb1 ], [ %add, %bb2 ]
  %b.addr.02 = phi i64 [ %addb.int, %bb1 ], [ %add.int, %bb2 ]
  %i0 = int2ptr i64 %b.addr.02 to ptr
  %i1 = load float, ptr %i0, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
=>
define void @matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  br i1 %cond, label %bb2, label %bb1

bb1:
  %addb = gep inbounds nuw ptr %b, 1 x i64 8
  br label %bb3

bb2:
  %add.int = add i64 %a, 1
  %add = int2ptr i64 %add.int to ptr
  store float 10.000000, ptr %add, align 4
  br label %bb3

bb3:
  %a.addr.03 = phi ptr [ %addb, %bb1 ], [ %add, %bb2 ]
  %i1 = load float, ptr %a.addr.03, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
Transformation doesn't verify! (not unsound)
ERROR: Timeout
-- 4. PassManager<llvm::Function> : Skipping NOP
-- 5. PassManager<llvm::Function> : Skipping NOP
-- 6. InstCombinePass

----------------------------------------
define void @no_matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  %cmp1 = icmp eq i1 %cond, 0
  %add.int = add i64 %a, 1
  %add = int2ptr i64 %add.int to ptr
  %addb = gep inbounds ptr %b, 4 x i64 2
  %addb.int = ptrtoint ptr %addb to i64
  br i1 %cmp1, label %A, label %B

B:
  store float 10.000000, ptr %add, align 4
  br label %C

A:
  br label %C

C:
  %a.addr.03 = phi ptr [ %addb, %A ], [ %add, %B ]
  %b.addr.02 = phi i64 [ %addb.int, %B ], [ %add.int, %A ]
  %i0 = int2ptr i64 %b.addr.02 to ptr
  %i1 = load float, ptr %i0, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 7. InstCombinePass

----------------------------------------
define void @no_matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  %cmp1 = icmp eq i1 %cond, 0
  %add.int = add i64 %a, 1
  %add = int2ptr i64 %add.int to ptr
  %addb = gep inbounds ptr %b, 4 x i64 2
  %addb.int = ptrtoint ptr %addb to i64
  br i1 %cmp1, label %A, label %B

B:
  store float 10.000000, ptr %add, align 4
  br label %C

A:
  br label %C

C:
  %a.addr.03 = phi ptr [ %addb, %A ], [ %add, %B ]
  %b.addr.02 = phi i64 [ %addb.int, %B ], [ %add.int, %A ]
  %i0 = int2ptr i64 %b.addr.02 to ptr
  %i1 = load float, ptr %i0, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
=>
define void @no_matching_phi(i64 %a, ptr %b, i1 %cond) {
entry:
  %add.int = add i64 %a, 1
  %addb = gep inbounds nuw ptr %b, 1 x i64 8
  br i1 %cond, label %B, label %A

A:
  %#0 = int2ptr i64 %add.int to ptr
  br label %C

B:
  %add = int2ptr i64 %add.int to ptr
  store float 10.000000, ptr %add, align 4
  br label %C

C:
  %a.addr.03 = phi ptr [ %addb, %A ], [ %add, %B ]
  %b.addr.02 = phi ptr [ %#0, %A ], [ %addb, %B ]
  %i1 = load float, ptr %b.addr.02, align 4
  %mul.i = fmul float %i1, 42.000000
  store float %mul.i, ptr %a.addr.03, align 4
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
i64 %a = #x0000000000000003 (3)
ptr %b = pointer(non-local, block_id=1, offset=3) / Address=#x0000000000000004
i1 %cond = #x1 (1)

Source:
i1 %cmp1 = #x0 (0)
i64 %add.int = #x0000000000000004 (4)
ptr %add = phy-ptr(addr=4) / Address=#x0000000000000004
ptr %addb = pointer(non-local, block_id=1, offset=11) / Address=#x000000000000000c
i64 %addb.int = #x000000000000000c (12)
  >> Jump to %B
  >> Jump to %C
ptr %a.addr.03 = phy-ptr(addr=4) / Address=#x0000000000000004
i64 %b.addr.02 = #x000000000000000c (12)
ptr %i0 = phy-ptr(addr=12) / Address=#x000000000000000c
float %i1 = poison
float %mul.i = poison

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 4	alloc type: 0	alive: false	address: 0
Block 1 >	size: 11	align: 1	alloc type: 0	alive: true	address: 1
Contents:
2: poison
*: poison

Block 2 >	size: 6	align: 1	alloc type: 0	alive: true	address: 12
Block 3 >	size: 0	align: 1	alloc type: 0	alive: true	address: 1

Target:
i64 %add.int = #x0000000000000004 (4)
ptr %addb = pointer(non-local, block_id=1, offset=11) / Address=#x000000000000000c
  >> Jump to %B
ptr %add = phy-ptr(addr=4) / Address=#x0000000000000004
  >> Jump to %C
ptr %a.addr.03 = phy-ptr(addr=4) / Address=#x0000000000000004
ptr %b.addr.02 = pointer(non-local, block_id=1, offset=11) / Address=#x000000000000000c
float %i1 = UB triggered!


Pass: InstCombinePass
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-passes=instcombine' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_TRdyYPcs_TtZk.bc"


------------------- SMT STATS -------------------
Num queries: 90
Num invalid: 0
Num skips:   0
Num trivial: 20 (18.2%)
Num timeout: 4 (4.4%)
Num errors:  3 (3.3%)
Num SAT:     65 (72.2%)
Num UNSAT:   18 (20.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr7.ll -passes=instcombine -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr7.ll
+ /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr7.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr7.ll

 

<-- Back