Test Failure: Transforms/DeadStoreElimination/free.ll

Test source: git

Log:

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

----------------------------------------
declare void @free(nocapture ptr) allockind(free)

define void @test(ptr %Q, ptr %P) {
#0:
  %DEAD = load i32, ptr %Q, align 4
  store i32 %DEAD, ptr %P, align 4
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 3. DSEPass

----------------------------------------
declare void @free(nocapture ptr) allockind(free)

define void @test(ptr %Q, ptr %P) {
#0:
  %DEAD = load i32, ptr %Q, align 4
  store i32 %DEAD, ptr %P, align 4
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
=>
declare void @free(nocapture ptr) allockind(free)

define void @test(ptr %Q, ptr %P) {
#0:
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
Transformation seems to be correct!

-- 4. PassManager<Function> : Skipping NOP
-- 5. PassManager<Function> : Skipping NOP
-- 6. DSEPass

----------------------------------------
declare void @free(nocapture ptr) allockind(free)

define void @test2(ptr %P) {
#0:
  %Q = gep ptr %P, 8 x i32 0, 1 x i64 4
  store i32 4, ptr %Q, align 4
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 7. DSEPass

----------------------------------------
declare void @free(nocapture ptr) allockind(free)

define void @test2(ptr %P) {
#0:
  %Q = gep ptr %P, 8 x i32 0, 1 x i64 4
  store i32 4, ptr %Q, align 4
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
=>
declare void @free(nocapture ptr) allockind(free)

define void @test2(ptr %P) {
#0:
  call void @free(nocapture noundef allocptr ptr %P) nothrow willreturn alloc-family(malloc) allockind(free) memory(inaccessiblemem: readwrite)
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Mismatch in memory

Example:
ptr %P = pointer(non-local, block_id=1, offset=-1) / Address=#x000

Source:
ptr %Q = pointer(non-local, block_id=1, offset=3) / Address=#x004
Function @free returned

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


LOCAL BLOCKS:
Block 2 >	size: 0	align: 4	alloc type: 0	alive: false	address: 0

Target:
Function @free returned

TARGET MEMORY STATE
===================
LOCAL BLOCKS:
Block 2 >	size: 0	align: 4	alloc type: 0	alive: false	address: 0

Mismatch in pointer(non-local, block_id=1, offset=0)
Source value: #x00000004
Target value: poison

Pass: DSEPass
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=dse' '-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_phhaS0a6_lOfb.bc"


------------------- SMT STATS -------------------
Num queries: 28
Num invalid: 0
Num skips:   0
Num trivial: 10 (26.3%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     18 (64.3%)
Num UNSAT:   10 (35.7%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/free.ll -passes=dse -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/free.ll
+ /home/nlopes/alive2/build/opt-alive.sh -passes=dse -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/free.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/free.ll

 

<-- Back