Test Failure: Transforms/InferAlignment/propagate-assume.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. InferAlignmentPass

----------------------------------------
define void @simple_forwardpropagate(ptr %a) {
#0:
  %ptrint = ptrtoint ptr %a to i64
  %maskedptr = and i64 %ptrint, 31
  %maskcond = icmp eq i64 %maskedptr, 0
  assume i1 %maskcond
  %load.a = load i32, ptr %a, align 4
  store i32 345, ptr %a, align 4
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 3. InferAlignmentPass

----------------------------------------
define void @simple_forwardpropagate(ptr %a) {
#0:
  %ptrint = ptrtoint ptr %a to i64
  %maskedptr = and i64 %ptrint, 31
  %maskcond = icmp eq i64 %maskedptr, 0
  assume i1 %maskcond
  %load.a = load i32, ptr %a, align 4
  store i32 345, ptr %a, align 4
  ret void
}
=>
define void @simple_forwardpropagate(ptr %a) {
#0:
  %ptrint = ptrtoint ptr %a to i64
  %maskedptr = and i64 %ptrint, 31
  %maskcond = icmp eq i64 %maskedptr, 0
  assume i1 %maskcond
  %load.a = load i32, ptr %a, align 32
  store i32 345, ptr %a, align 32
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
ptr %a = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000020

Source:
i64 %ptrint = #x0000000000000020 (32)
i64 %maskedptr = #x0000000000000000 (0)
i1 %maskcond = #x1 (1)
i32 %load.a = poison

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 4	alloc type: 0	alive: false	address: 0
Block 1 >	size: 4	align: 1	alloc type: 0	alive: true	address: 32

Target:
i64 %ptrint = #x0000000000000020 (32)
i64 %maskedptr = #x0000000000000000 (0)
i1 %maskcond = #x1 (1)
i32 %load.a = UB triggered!


Pass: InferAlignmentPass
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=infer-alignment' '-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_fqk2rWG3_nRYm.bc"


------------------- SMT STATS -------------------
Num queries: 24
Num invalid: 0
Num skips:   0
Num trivial: 7 (22.6%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     16 (66.7%)
Num UNSAT:   8 (33.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/InferAlignment/propagate-assume.ll -passes=infer-alignment -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InferAlignment/propagate-assume.ll
+ /home/nlopes/alive2/build/opt-alive.sh -passes=infer-alignment -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InferAlignment/propagate-assume.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InferAlignment/propagate-assume.ll

 

<-- Back