Test source: git
Comments: Alive2 missing support for speculatable attribute
Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. SimplifyCFGPass
----------------------------------------
declare i32 @func() nofree memory(none)
define i32 @speculatable_attribute(i32 %a) {
entry:
%c = icmp sgt i32 %a, 64
br i1 %c, label %end, label %if
if:
%val = call i32 @func() nofree memory(none)
br label %end
end:
%ret = phi i32 [ %val, %if ], [ 0, %entry ]
ret i32 %ret
}
Transformation seems to be correct! (syntactically equal)
-- 3. SimplifyCFGPass
----------------------------------------
declare i32 @func() nofree memory(none)
define i32 @speculatable_attribute(i32 %a) {
entry:
%c = icmp sgt i32 %a, 64
br i1 %c, label %end, label %if
if:
%val = call i32 @func() nofree memory(none)
br label %end
end:
%ret = phi i32 [ %val, %if ], [ 0, %entry ]
ret i32 %ret
}
=>
declare i32 @func() nofree memory(none)
define i32 @speculatable_attribute(i32 %a) {
entry:
%c = icmp sgt i32 %a, 64
%val = call i32 @func() nofree memory(none)
%spec.select = select i1 %c, i32 0, i32 %val
ret i32 %spec.select
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target
Example:
i32 %a = #x00000041 (65)
Source:
i1 %c = #x1 (1)
>> Jump to %end
i32 %ret = #x00000000 (0)
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Target:
i1 %c = #x1 (1)
i32 %val = function did not return!
TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Pass: SimplifyCFGPass
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=simplifycfg' '-simplifycfg-require-and-preserve-domtree=1' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_Wf7cb5eT_93eT.bc"
------------------- SMT STATS -------------------
Num queries: 13
Num invalid: 0
Num skips: 0
Num trivial: 4 (23.5%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 10 (76.9%)
Num UNSAT: 3 (23.1%)
Alive2: Transform doesn't verify; aborting!
Transforms/SimplifyCFG/speculate-call.ll' FAILED ******************** Exit Code: 2 Command Output (stdout): -- # RUN: at line 1 /home/nlopes/alive2/build/opt-alive.sh -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/speculate-call.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/speculate-call.ll # executed command: /home/nlopes/alive2/build/opt-alive.sh -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 # .---command stderr------------ # `----------------------------- # error: command failed with exit status: 1 # executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/speculate-call.ll # .---command stderr------------ # | FileCheck error: '<stdin>' is empty. # | FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/speculate-call.ll # `----------------------------- # error: command failed with exit status: 2 --