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, exec, align 8
@func2 = constant ? bytes, exec, 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 = inttoptr 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: #x0000000000000000
Block 1 > size: 9 align: 8 alloc type: 0 alive: true address: #x0000000000000008 const
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 2 > size: 9 align: 8 alloc type: 0 alive: true address: #x0000000000000020 const
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 3 > size: 8 align: 8 alloc type: 0 alive: true address: #x0000000000000090
Contents:
phy-ptr(addr=8), byte offset=0
Block 4 > size: 0 align: 1 alloc type: 4 alive: true address: #x0000000000000004
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 5 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 6 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 7 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
LOCAL BLOCKS:
Block 8 > size: 0 align: 1 alloc type: 2 alive: false address: #x8000000000000000
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
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 8 alloc type: 0 alive: false address: #x0000000000000000
Block 1 > size: 9 align: 8 alloc type: 0 alive: true address: #x0000000000000008 const
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 2 > size: 9 align: 8 alloc type: 0 alive: true address: #x0000000000000020 const
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 3 > size: 8 align: 8 alloc type: 0 alive: true address: #x0000000000000090
Contents:
phy-ptr(addr=8), byte offset=0
Block 4 > size: 0 align: 1 alloc type: 4 alive: true address: #x0000000000000004
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 5 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 6 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
Block 7 > size: 0 align: 1 alloc type: 1 alive: true address: #x0000000000000001
Contents:
*: phy-ptr(addr=8), byte offset=0
LOCAL BLOCKS:
Block 8 > size: 0 align: 1 alloc type: 2 alive: false address: #x8000000000000000
Block 9 > size: 0 align: 1 alloc type: 2 alive: false address: #x8000000000000000
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_QdLJfY68_0Gh6.bc"
------------------- SMT STATS -------------------
Num queries: 78
Num invalid: 0
Num skips: 0
Num trivial: 4 (4.9%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 53 (67.9%)
Num UNSAT: 25 (32.1%)
Alive2: Transform doesn't verify; aborting!
Transforms/Util/call-promotion-utils-ptrcast-attribute.ll' FAILED ******************** Exit Code: 1 Command Output (stdout): -- # 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 # executed command: /home/nlopes/alive2/build/opt-alive.sh -S -passes=pgo-icall-prom -icp-total-percent-threshold=0 # note: command had no output on stdout or stderr # error: command failed with exit status: 1 # executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/Util/call-promotion-utils-ptrcast-attribute.ll # .---command stderr------------ # | /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: # | <<<<<< # | check:22'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found # | check:22'1 ? possible intended match # | >>>>>> # `----------------------------- # error: command failed with exit status: 1 --