Test source: git
Source: <stdin> -- 1. PGOIndirectCallPromotion -- 2. PGOIndirectCallPromotion ---------------------------------------- define i64 @func2(i64 %a) { #0: ret i64 undef } Transformation seems to be correct! (syntactically equal) ---------------------------------------- define ptr @func4(ptr %a) { #0: ret ptr undef } Transformation seems to be correct! (syntactically equal) ---------------------------------------- @foo = global 8 bytes, align 8 define ptr @bar(ptr %arg) { #0: %tmp = load ptr, ptr @foo, align 8 %call = call ptr %tmp(nonnull ptr %arg) noalias ret ptr %call } => declare ptr @func4(ptr) declare i64 @func2(i64) @foo = global 8 bytes, align 8 @func4 = constant ? bytes, align 8 @func2 = constant ? bytes, align 8 define ptr @bar(ptr %arg) { #0: %tmp = load ptr, ptr @foo, align 8 %#1 = icmp eq ptr %tmp, @func4 br i1 %#1, label %if.true.direct_targ, label %if.false.orig_indirect if.false.orig_indirect: %#2 = icmp eq ptr %tmp, @func2 br i1 %#2, label %if.true.direct_targ1, label %if.false.orig_indirect2 if.true.direct_targ1: %#3 = ptrtoint ptr %arg to i64 %#4 = call i64 @func2(i64 %#3) %#5 = int2ptr i64 %#4 to ptr br label %if.end.icp3 if.false.orig_indirect2: %call = call ptr %tmp(nonnull ptr %arg) noalias br label %if.end.icp3 if.end.icp3: %#6 = phi ptr [ %call, %if.false.orig_indirect2 ], [ %#5, %if.true.direct_targ1 ] br label %if.end.icp if.true.direct_targ: %#7 = call ptr @func4(nonnull ptr %arg) noalias br label %if.end.icp if.end.icp: %#8 = phi ptr [ %#6, %if.end.icp3 ], [ %#7, %if.true.direct_targ ] ret ptr %#8 } Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: ptr %arg = null Source: ptr %tmp = phy-ptr(addr=8) / Address=#x0000000000000008 ptr %call = function did not return! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 8 alloc type: 0 alive: false address: 0 Block 1 > size: 1 align: 8 alloc type: 0 alive: true address: 8 const Contents: *: phy-ptr(addr=8), byte offset=0 Block 2 > size: 1 align: 8 alloc type: 0 alive: true address: 192 const Contents: *: phy-ptr(addr=8), byte offset=0 Block 3 > size: 8 align: 8 alloc type: 0 alive: true address: 128 Contents: phy-ptr(addr=8), byte offset=0 Block 4 > size: 2 align: 1 alloc type: 0 alive: true address: 9 Contents: *: phy-ptr(addr=8), byte offset=0 Block 5 > size: 2 align: 1 alloc type: 0 alive: true address: 2 Contents: *: phy-ptr(addr=8), byte offset=0 Block 6 > size: 2 align: 1 alloc type: 0 alive: true address: 11 Contents: *: phy-ptr(addr=8), byte offset=0 Block 7 > size: 5 align: 1 alloc type: 0 alive: true address: 14 Contents: *: phy-ptr(addr=8), byte offset=0 LOCAL BLOCKS: Block 8 > size: 0 align: 1 alloc type: 2 alive: false address: 9223372036854775808 Target: ptr %tmp = phy-ptr(addr=8) / Address=#x0000000000000008 i1 %#1 = #x1 (1) >> Jump to %if.true.direct_targ ptr %#7 = function did not return! TARGET MEMORY STATE =================== LOCAL BLOCKS: Block 8 > size: 0 align: 1 alloc type: 2 alive: false address: 9223372036854775808 Block 9 > size: 0 align: 1 alloc type: 2 alive: false address: 9223372036854775808 Pass: PGOIndirectCallPromotion 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' '-S' '-passes=pgo-icall-prom' '-icp-total-percent-threshold=0' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_SQCQAGbu_kFMf.bc" ------------------- SMT STATS ------------------- Num queries: 70 Num invalid: 0 Num skips: 0 Num trivial: 4 (5.4%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 45 (64.3%) Num UNSAT: 25 (35.7%) Alive2: Transform doesn't verify; aborting!
RUN: at line 1: /home/nlopes/alive2/build/opt-alive.sh -S -passes=pgo-icall-prom -icp-total-percent-threshold=0 < /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll 2>&1 | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll + /home/nlopes/alive2/build/opt-alive.sh -S -passes=pgo-icall-prom -icp-total-percent-threshold=0 + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll:22:10: error: CHECK: expected string not found in input ; CHECK: call noalias ptr @func4(ptr nonnull ^ <stdin>:1:1: note: scanning from here ^ <stdin>:1:40: note: possible intended match here ^ Input file: <stdin> Check file: /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll -dump-input=help explains the following input dump. Input was: <<<<<< 1: check:22'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found check:22'1 ? possible intended match >>>>>>