Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. StraightLineStrengthReducePass ---------------------------------------- define void @slsr1(i32 %b, i32 %s) { %0: %mul0 = mul i32 %b, %s call void @foo(i32 %mul0) %b1 = add i32 %b, 1 %mul1 = mul i32 %b1, %s call void @foo(i32 %mul1) %b2 = add i32 %b, 2 %mul2 = mul i32 %b2, %s call void @foo(i32 %mul2) ret void } Transformation seems to be correct! (syntactically equal) -- 3. StraightLineStrengthReducePass ---------------------------------------- define void @slsr1(i32 %b, i32 %s) { %0: %mul0 = mul i32 %b, %s call void @foo(i32 %mul0) %b1 = add i32 %b, 1 %mul1 = mul i32 %b1, %s call void @foo(i32 %mul1) %b2 = add i32 %b, 2 %mul2 = mul i32 %b2, %s call void @foo(i32 %mul2) ret void } => define void @slsr1(i32 %b, i32 %s) { %0: %mul0 = mul i32 %b, %s call void @foo(i32 %mul0) %mul1 = add i32 %mul0, %s call void @foo(i32 %mul1) %mul2 = add i32 %mul1, %s call void @foo(i32 %mul2) ret void } Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: i32 %b = #xac580041 (2891448385, -1403518911) i32 %s = undef Source: i32 %mul0 = #x00000000 (0) [based on undef value] Function @foo returned i32 %b1 = #xac580042 (2891448386, -1403518910) i32 %mul1 = #x00000000 (0) [based on undef value] void = function did not return! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 Block 1 > size: 0 align: 1 alloc type: 0 Target: i32 %mul0 = #x61002e8a (1627401866) Function @foo triggered UB i32 %mul1 = UB triggered! 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,gvn' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' ------------------- SMT STATS ------------------- Num queries: 4 Num invalid: 0 Num skips: 0 Num trivial: 6 (60.0%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 4 (100.0%) Num UNSAT: 0 (0.0%) Alive2: Transform doesn't verify; aborting!
+ : 'RUN: at line 1' + /home/nlopes/alive2/build/opt-alive.sh -passes=slsr,gvn -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
NOTE: This test would pass if undef didn't exist!