Test source: git
Source: <stdin>
----------------------------------------
declare i1 @pred(i32)
define void @test(ptr %P, i32 %STRIDE) {
#0:
br label %Loop
Loop:
%INDVAR = phi i32 [ 0, %#0 ], [ %INDVAR2, %Loop ]
%Idx = mul i32 %INDVAR, %STRIDE
%cond = call i1 @pred(i32 %Idx)
%INDVAR2 = add i32 %INDVAR, 1
br i1 %cond, label %Loop, label %Out
Out:
ret void
}
=>
declare i1 @pred(i32)
define void @test(ptr %P, i32 %STRIDE) {
#0:
%#1 = sub i32 0, %STRIDE
br label %Loop
Loop:
%lsr.iv = phi i32 [ %lsr.iv.next, %Loop ], [ %#1, %#0 ]
%lsr.iv.next = add i32 %lsr.iv, %STRIDE
%cond = call i1 @pred(i32 %lsr.iv.next)
br i1 %cond, label %Loop, label %Out
Out:
ret void
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target
Example:
ptr %P = poison
i32 %STRIDE = undef
Source:
>> Jump to %Loop
i32 %INDVAR = #x00000000 (0)
i32 %Idx = #x00000000 (0)
i1 %cond = 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: 0 alive: true address: #x1
Block 2 > size: 0 align: 8 alloc type: 0 alive: true address: #x8
Target:
i32 %#1 = #xffffffff (4294967295, -1)
>> Jump to %Loop
i32 %lsr.iv = #xffffffff (4294967295, -1)
i32 %lsr.iv.next = #xffffffff (4294967295, -1)
i1 %cond = 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: 0 alive: true address: #x1
Block 2 > size: 0 align: 8 alloc type: 0 alive: true address: #x8
Pass:
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-tv' '-loop-reduce' '-S' '-tv' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
------------------- SMT STATS -------------------
Num queries: 23
Num invalid: 0
Num skips: 0
Num trivial: 6 (20.7%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 21 (91.3%)
Num UNSAT: 2 (8.7%)
Alive2: Transform doesn't verify; aborting!
Transforms/LoopStrengthReduce/variable_stride.ll' FAILED ******************** Exit Code: 1 Command Output (stdout): -- # RUN: at line 2 /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopStrengthReduce/variable_stride.ll -loop-reduce -S | /bitbucket/nlopes/llvm/build/bin/not grep mul # executed command: /home/nlopes/alive2/build/opt-alive.sh -loop-reduce -S # .---command stderr------------ # `----------------------------- # error: command failed with exit status: 1 # executed command: /bitbucket/nlopes/llvm/build/bin/not grep mul --
NOTE: This test would pass if undef didn't exist!