Test source: git
Comments: LLVM bug: introduces load type punning
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. GVNPass ---------------------------------------- define i64 @foo(ptr %arrayidx) { entry: %p = load ptr, ptr %arrayidx, align 8 %cmpnull = icmp eq ptr %p, null br label %BB2 entry2: br label %BB2 BB2: %load = load i64, ptr %arrayidx, align 8 ret i64 %load } Transformation seems to be correct! (syntactically equal) -- 3. GVNPass ---------------------------------------- define i64 @foo(ptr %arrayidx) { entry: %p = load ptr, ptr %arrayidx, align 8 br label %BB2 BB2: %load = load i64, ptr %arrayidx, align 8 ret i64 %load } => define i64 @foo(ptr %arrayidx) { entry: %p = load ptr, ptr %arrayidx, align 8 %#0 = ptrtoint ptr %p to i64 br label %BB2 BB2: ret i64 %#0 } Transformation doesn't verify! (unsound) ERROR: Target is more poisonous than source Example: ptr %arrayidx = pointer(non-local, block_id=1, offset=0) Source: ptr %p = poison >> Jump to %BB2 i64 %load = #x0000000000000001 (1) SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 8 alloc type: 0 alive: false address: 0 Block 1 > size: 8 align: 1 alloc type: 0 alive: true address: 8 Contents: *: #x0000000000000001 Block 2 > size: 2 align: 1 alloc type: 0 alive: true address: 1 Contents: *: #x0000000000000001 Target: ptr %p = poison i64 %#0 = poison >> Jump to %BB2 Source value: #x0000000000000001 (1) Target value: poison Pass: GVNPass 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=gvn' '-disable-output' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_Ab50ZUjn_J7Zr.bc" ------------------- SMT STATS ------------------- Num queries: 25 Num invalid: 0 Num skips: 0 Num trivial: 5 (16.7%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 17 (68.0%) Num UNSAT: 8 (32.0%) Alive2: Transform doesn't verify; aborting!
RUN: at line 1: /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -disable-output < /bitbucket/nlopes/llvm/llvm/test/Transforms/GVN/pr24397.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=gvn -disable-output