Test source: git
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. StraightLineStrengthReducePass ---------------------------------------- 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 ---------------------------------------- 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 } => 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 = #x00000000 (0) i32 %b = undef i32 %c = #x00000000 (0) Source: i32 %ab = #x00000000 (0) [based on undef value] i32 %abc = #x00000000 (0) Function @foo returned i32 %b2 = #x00000000 (0) [based on undef value] i32 %ab2 = #x00000000 (0) i32 %ab2c = #x00000000 (0) Function @foo returned i32 %b3 = #x00000000 (0) [based on undef value] i32 %ab3 = #x00000000 (0) i32 %ab3c = #x00000000 (0) void = function did not return! SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 1 alloc type: 0 address: 0 Block 1 > size: 0 align: 1 alloc type: 0 address: 0 Target: i32 %ab = #x01aea302 (28222210) i32 %abc = #x01aea302 (28222210) Function @foo triggered UB 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_skqcE1Q4_RSAp.bc" ------------------- SMT STATS ------------------- Num queries: 4 Num invalid: 0 Num skips: 0 Num trivial: 13 (76.5%) 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,nary-reassociate -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/NaryReassociate/NVPTX/nary-slsr.ll 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
NOTE: This test would pass if undef didn't exist!