Test Failure: Transforms/SimplifyCFG/basictest.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define void @test1() {
%0:
  br label %1

%1:
  ret void
}
=>
define void @test1() {
%0:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test2() {
%0:
  ret void
}
=>
define void @test2() {
%0:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test3(i1 %T) {
%0:
  br i1 %T, label %1, label %1

%1:
  ret void
}
=>
define void @test3(i1 %T) {
%0:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test4_fold(i32 %a, i32 %b) {
%0:
  %cmp1 = icmp eq i32 %a, %b
  br i1 %cmp1, label %taken, label %untaken

%taken:
  %cmp2 = icmp ugt i32 %a, 0
  br i1 %cmp2, label %else, label %untaken

%else:
  call void @foo()
  ret void

%untaken:
  ret void
}
=>
define void @test4_fold(i32 %a, i32 %b) {
%0:
  %cmp1 = icmp eq i32 %a, %b
  %cmp2 = icmp ugt i32 %a, 0
  %or.cond = and i1 %cmp1, %cmp2
  br i1 %or.cond, label %else, label %untaken

%untaken:
  ret void

%else:
  call void @foo()
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test4_no_fold(i32 %a, i32 %b) {
%0:
  %cmp1 = icmp eq i32 %a, %b
  br i1 %cmp1, label %taken, label %untaken

%taken:
  %cmp2 = icmp ugt i32 %a, %b
  br i1 %cmp2, label %else, label %untaken

%else:
  call void @foo()
  ret void

%untaken:
  ret void
}
=>
define void @test4_no_fold(i32 %a, i32 %b) {
%untaken:
  %cmp1 = icmp eq i32 %a, %b
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test5(i32 %A) {
%0:
  switch i32 %A, label %return [
    i32 2, label %2
    i32 10, label %1
  ]

%1:
  ret void

%2:
  ret void

%return:
  ret void
}
=>
define void @test5(i32 %A) {
%0:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i8 @test6f() {
%bb0:
  %r = alloca i64 1, align 1
  %tmp = call i8 @test6g(* %r)
  %tmp1 = icmp eq i8 %tmp, 0
  br i1 %tmp1, label %bb2, label %bb1

%bb1:
  %tmp3 = load i8, * %r, align 1
  %range_l#0%tmp3 = icmp sge i8 %tmp3, 0
  %range_h#0%tmp3 = icmp slt i8 %tmp3, 2
  %range#0%tmp3 = and i1 %range_l#0%tmp3, %range_h#0%tmp3
  assume_non_poison i1 %range#0%tmp3
  %tmp4 = icmp eq i8 %tmp3, 1
  br i1 %tmp4, label %bb2, label %bb3

%bb2:
  br label %bb3

%bb3:
  %tmp6 = phi i8 [ 0, %bb2 ], [ 1, %bb1 ]
  ret i8 %tmp6
}
=>
define i8 @test6f() {
%bb0:
  %r = alloca i64 1, align 1
  %tmp = call i8 @test6g(* %r)
  %tmp1 = icmp eq i8 %tmp, 0
  %tmp3 = load i8, * %r, align 1
  %tmp4 = icmp eq i8 %tmp3, 1
  %or.cond = or i1 %tmp1, %tmp4
  %tmp6 = select i1 %or.cond, i8 0, i8 1
  ret i8 %tmp6
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:

Source:
* %r = pointer(local, block_id=2, offset=0)
i8 %tmp = #x00 (0)
i1 %tmp1 = #x1 (1)
i8 %tmp3 = poison
i1 %range_l#0%tmp3 = poison
i1 %range_h#0%tmp3 = poison
i1 %range#0%tmp3 = poison
i1 %tmp4 = poison
i8 %tmp6 = #x00 (0)

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

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

Target:
* %r = pointer(local, block_id=2, offset=0)
i8 %tmp = #x00 (0)
i1 %tmp1 = #x1 (1)
i8 %tmp3 = poison
i1 %tmp4 = poison
i1 %or.cond = poison
i8 %tmp6 = poison

TARGET MEMORY STATE
===================
LOCAL BLOCKS:
Block 2 >	size: 1	align: 1	alloc type: 1
Source value: #x00 (0)
Target value: poison


------------------- SMT STATS -------------------
Num queries: 11
Num invalid: 0
Num skips:   0
Num trivial: 35 (76.1%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     8 (72.7%)
Num UNSAT:   3 (27.3%)

stderr:

+ : 'RUN: at line 3'
+ /home/nlopes/alive2/build/opt-alive.sh -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S
+ /home/nlopes/llvm/build/bin/FileCheck --allow-unused-prefixes=false /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/basictest.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/SimplifyCFG/basictest.ll

 

<-- Back