Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<llvm::Function> : Skipping NOP -- 2. InstCombinePass ---------------------------------------- define void @test1(ptr %a, ptr noread nowrite %a_end, ptr %b.i) { entry: %cmp1 = icmp ult ptr %a, noread nowrite %a_end br i1 %cmp1, label %for.body.preheader, label %for.end for.body.preheader: %b = ptrtoint ptr %b.i to i64 br label %for.body for.body: %a.addr.03 = phi ptr [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ] %b.addr.02 = phi i64 [ %add.int, %for.body ], [ %b, %for.body.preheader ] %tmp = int2ptr i64 %b.addr.02 to ptr %tmp1 = load float, ptr %tmp, align 4 %mul.i = fmul float %tmp1, 42.000000 store float %mul.i, ptr %a.addr.03, align 4 %add = gep inbounds ptr %tmp, 4 x i64 1 %add.int = ptrtoint ptr %add to i64 %incdec.ptr = gep inbounds ptr %a.addr.03, 4 x i64 1 %cmp = icmp ult ptr %incdec.ptr, noread nowrite %a_end br i1 %cmp, label %for.body, label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 3. InstCombinePass ---------------------------------------- define void @test1(ptr %a, ptr noread nowrite %a_end, ptr %b.i) { entry: %cmp1 = icmp ult ptr %a, noread nowrite %a_end br i1 %cmp1, label %for.body.preheader, label %for.end for.body.preheader: %b = ptrtoint ptr %b.i to i64 br label %for.body for.body: %a.addr.03 = phi ptr [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ] %b.addr.02 = phi i64 [ %add.int, %for.body ], [ %b, %for.body.preheader ] %tmp = int2ptr i64 %b.addr.02 to ptr %tmp1 = load float, ptr %tmp, align 4 %mul.i = fmul float %tmp1, 42.000000 store float %mul.i, ptr %a.addr.03, align 4 %add = gep inbounds ptr %tmp, 4 x i64 1 %add.int = ptrtoint ptr %add to i64 %incdec.ptr = gep inbounds ptr %a.addr.03, 4 x i64 1 %cmp = icmp ult ptr %incdec.ptr, noread nowrite %a_end br i1 %cmp, label %for.body, label %for.end for.end: ret void } => define void @test1(ptr %a, ptr noread nowrite %a_end, ptr %b.i) { entry: %cmp1 = icmp ult ptr %a, noread nowrite %a_end br i1 %cmp1, label %for.body.preheader, label %for.end for.body.preheader: br label %for.body for.body: %a.addr.03 = phi ptr [ %incdec.ptr, %for.body ], [ %a, %for.body.preheader ] %b.addr.02.in = phi ptr [ %add, %for.body ], [ %b.i, %for.body.preheader ] %tmp1 = load float, ptr %b.addr.02.in, align 4 %mul.i = fmul float %tmp1, 42.000000 store float %mul.i, ptr %a.addr.03, align 4 %add = gep inbounds nuw ptr %b.addr.02.in, 1 x i64 4 %incdec.ptr = gep inbounds nuw ptr %a.addr.03, 1 x i64 4 %cmp = icmp ult ptr %incdec.ptr, noread nowrite %a_end br i1 %cmp, label %for.body, label %for.end for.end: ret void } WARNING: slow vcgen! Took 80.41 s Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: ptr %a = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008 ptr noread nowrite %a_end = pointer(non-local, block_id=0, offset=9, attrs=3) / Address=#x0000000000000009 ptr %b.i = pointer(non-local, block_id=0, offset=8) / Address=#x0000000000000008 Source: i1 %cmp1 = #x1 (1) >> Jump to %for.body.preheader i64 %b = #x0000000000000008 (8) >> Jump to %for.body ptr %a.addr.03 = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008 i64 %b.addr.02 = #x0000000000000008 (8) ptr %tmp = phy-ptr(addr=8) / Address=#x0000000000000008 float %tmp1 = poison float %mul.i = poison ptr %add = poison i64 %add.int = poison ptr %incdec.ptr = pointer(non-local, block_id=1, offset=4) / Address=#x000000000000000c i1 %cmp = #x0 (0) >> Jump to %for.end SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 4 alloc type: 0 alive: false address: 0 Block 1 > size: 4 align: 1 alloc type: 0 alive: true address: 8 Block 2 > size: 0 align: 1 alloc type: 0 alive: true address: 12 Block 3 > size: 0 align: 1 alloc type: 0 alive: true address: 1 Block 4 > size: 0 align: 1 alloc type: 0 alive: true address: 13 Target: i1 %cmp1 = #x1 (1) >> Jump to %for.body.preheader >> Jump to %for.body ptr %a.addr.03 = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008 ptr %b.addr.02.in = pointer(non-local, block_id=0, offset=8) / Address=#x0000000000000008 float %tmp1 = 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_Y82RsErr_0HZh.bc" ------------------- SMT STATS ------------------- Num queries: 50 Num invalid: 0 Num skips: 0 Num trivial: 13 (20.6%) Num timeout: 5 (10.0%) Num errors: 0 (0.0%) Num SAT: 35 (70.0%) Num UNSAT: 10 (20.0%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr2.ll -passes=instcombine -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr2.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=instcombine -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr2.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/intptr2.ll