Test source: git
Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. StraightLineStrengthReducePass
----------------------------------------
declare void @foo(i32)
define void @nary_reassociate_after_slsr(i32 %a, i32 %b, i32 %c) {
#0:
%ab = add i32 %a, %b
%abc = add i32 %ab, %c
call void @foo(i32 %abc)
%b2 = shl i32 %b, 1
%ab2 = add i32 %a, %b2
%ab2c = add i32 %ab2, %c
call void @foo(i32 %ab2c)
%b3 = mul i32 %b, 3
%ab3 = add i32 %a, %b3
%ab3c = add i32 %ab3, %c
call void @foo(i32 %ab3c)
ret void
}
Transformation seems to be correct! (syntactically equal)
-- 3. StraightLineStrengthReducePass
----------------------------------------
declare void @foo(i32)
define void @nary_reassociate_after_slsr(i32 %a, i32 %b, i32 %c) {
#0:
%ab = add i32 %a, %b
%abc = add i32 %ab, %c
call void @foo(i32 %abc)
%b2 = shl i32 %b, 1
%ab2 = add i32 %a, %b2
%ab2c = add i32 %ab2, %c
call void @foo(i32 %ab2c)
%b3 = mul i32 %b, 3
%ab3 = add i32 %a, %b3
%ab3c = add i32 %ab3, %c
call void @foo(i32 %ab3c)
ret void
}
=>
declare void @foo(i32)
define void @nary_reassociate_after_slsr(i32 %a, i32 %b, i32 %c) {
#0:
%ab = add i32 %a, %b
%abc = add i32 %ab, %c
call void @foo(i32 %abc)
%ab2 = add i32 %ab, %b
%ab2c = add i32 %ab2, %c
call void @foo(i32 %ab2c)
%ab3 = add i32 %ab2, %b
%ab3c = add i32 %ab3, %c
call void @foo(i32 %ab3c)
ret void
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target
Example:
i32 %a = #x00000003 (3)
i32 %b = undef
i32 %c = #x00000003 (3)
Source:
i32 %ab = #x00000006 (6) [based on undef]
i32 %abc = #x00000009 (9) [based on undef]
Function @foo returned
i32 %b2 = #x00000006 (6) [based on undef]
i32 %ab2 = #x00000009 (9) [based on undef]
i32 %ab2c = #x0000000c (12) [based on undef]
void = function did not return!
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Block 1 > size: 0 align: 1 alloc type: 4 alive: true address: #x3
Target:
i32 %ab = #x00000003 (3)
i32 %abc = #x00000006 (6)
Function @foo returned
i32 %ab2 = #x00000004 (4)
i32 %ab2c = #x00000007 (7)
void = function did not return!
TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x0
Block 1 > size: 0 align: 1 alloc type: 4 alive: true address: #x3
Pass: StraightLineStrengthReducePass
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=slsr,nary-reassociate' '-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_2gWcdXCf_vOZR.bc"
------------------- SMT STATS -------------------
Num queries: 50
Num invalid: 0
Num skips: 0
Num trivial: 12 (19.4%)
Num timeout: 10 (20.0%)
Num errors: 0 (0.0%)
Num SAT: 38 (76.0%)
Num UNSAT: 2 (4.0%)
Alive2: Transform doesn't verify; aborting!
Transforms/NaryReassociate/NVPTX/nary-slsr.ll' FAILED ******************** Exit Code: 2 Command Output (stdout): -- # RUN: at line 1 /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll -passes=slsr,nary-reassociate -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll # executed command: /home/nlopes/alive2/build/opt-alive.sh -passes=slsr,nary-reassociate -S # .---command stderr------------ # `----------------------------- # error: command failed with exit status: 1 # executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll # .---command stderr------------ # | FileCheck error: '<stdin>' is empty. # | FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll # `----------------------------- # error: command failed with exit status: 2 --
NOTE: This test would pass if undef didn't exist!