Test source: git
Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. AlignmentFromAssumptionsPass
----------------------------------------
define i32 @foo(ptr nocapture %a) nofree memory(read) {
entry:
assume_align ptr nocapture %a, i64 32
assume i1 1
%#0 = load i32, ptr nocapture %a, align 4
ret i32 %#0
}
Transformation seems to be correct! (syntactically equal)
-- 3. AlignmentFromAssumptionsPass
----------------------------------------
define i32 @foo(ptr nocapture %a) nofree memory(read) {
entry:
assume_align ptr nocapture %a, i64 32
%#0 = load i32, ptr nocapture %a, align 4
ret i32 %#0
}
=>
define i32 @foo(ptr nocapture %a) nofree memory(read) {
entry:
assume_align ptr nocapture %a, i64 32
%#0 = load i32, ptr nocapture %a, align 32
ret i32 %#0
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target
Example:
ptr nocapture %a = pointer(non-local, block_id=1, offset=123, attrs=3) / Address=#x80
Source:
i32 %#0 = poison
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 4 alloc type: 0 alive: false address: 0
Block 1 > size: 128 align: 1 alloc type: 0 alive: true address: 5
Target:
i32 %#0 = UB triggered!
Pass: AlignmentFromAssumptionsPass
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=alignment-from-assumptions' '-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_TlJQB2S2_jTqj.bc"
------------------- SMT STATS -------------------
Num queries: 20
Num invalid: 0
Num skips: 0
Num trivial: 1 (4.8%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 12 (60.0%)
Num UNSAT: 8 (40.0%)
Alive2: Transform doesn't verify; aborting!
RUN: at line 3: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/AlignmentFromAssumptions/simple32.ll -passes=alignment-from-assumptions -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/AlignmentFromAssumptions/simple32.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=alignment-from-assumptions -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/AlignmentFromAssumptions/simple32.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/AlignmentFromAssumptions/simple32.ll