Test Failure: Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll

Test source: git

Log:

Source: /home/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll

----------------------------------------
define i32 @test_out_of_bounds_store_local(i1 %c) {
%0:
  %d = alloca i64 4, align 4
  %arrayidx = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  store i32 10, * %arrayidx, align 4
  %arrayidx.1 = gep inbounds * %d, 4 x i64 0, 4 x i64 1
  store i32 20, * %arrayidx.1, align 4
  %arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  %lv1 = load i32, * %arrayidx1, align 4
  call void @use(i32 %lv1)
  ret i32 0
}
=>
define i32 @test_out_of_bounds_store_local(i1 %c) {
%0:
  %d = alloca i64 4, align 4
  %arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  %lv1 = load i32, * %arrayidx1, align 4
  call void @use(i32 %lv1)
  ret i32 0
}
Transformation seems to be correct!


----------------------------------------
define i32 @test_out_of_bounds_store_nonlocal(i1 %c) {
%0:
  %d = alloca i64 4, align 4
  br label %for.body

%for.body:
  %arrayidx = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  store i32 10, * %arrayidx, align 4
  br label %for.inc

%for.inc:
  br i1 %c, label %for.body.1, label %for.end

%for.body.1:
  %arrayidx.1 = gep inbounds * %d, 4 x i64 0, 4 x i64 1
  store i32 20, * %arrayidx.1, align 4
  ret i32 1

%for.end:
  %arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  %lv1 = load i32, * %arrayidx1, align 4
  call void @use(i32 %lv1)
  ret i32 0
}
=>
define i32 @test_out_of_bounds_store_nonlocal(i1 %c) {
%0:
  %d = alloca i64 4, align 4
  br label %for.body

%for.body:
  br label %for.inc

%for.inc:
  br i1 %c, label %for.body.1, label %for.end

%for.body.1:
  ret i32 1

%for.end:
  %arrayidx1 = gep inbounds * %d, 4 x i64 0, 4 x i64 0
  %lv1 = load i32, * %arrayidx1, align 4
  call void @use(i32 %lv1)
  ret i32 0
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %c = #x0 (0)

Source:
* %d = pointer(local, block_id=2, offset=0)
* %arrayidx = pointer(local, block_id=2, offset=0)
* %arrayidx.1 = pointer(local, block_id=2, offset=4)
* %arrayidx1 = pointer(local, block_id=2, offset=0)
i32 %lv1 = #x0000000a (10)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 4	alloc type: 0
Block 1 >	size: 0	align: 2	alloc type: 0

LOCAL BLOCKS:
Block 2 >	size: 4	align: 4	alloc type: 1

Target:
* %d = pointer(local, block_id=2, offset=0)
* %arrayidx1 = pointer(local, block_id=2, offset=0)
i32 %lv1 = poison

TARGET MEMORY STATE
===================
LOCAL BLOCKS:
Block 2 >	size: 4	align: 4	alloc type: 1



------------------- SMT STATS -------------------
Num queries: 3
Num invalid: 0
Num skips:   0
Num trivial: 6 (66.7%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     3 (100.0%)
Num UNSAT:   0 (0.0%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -dse -S /home/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll
+ /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/DeadStoreElimination/MSSA/out-of-bounds-stores.ll

 

<-- Back