Test Failure: Transforms/SimplifyCFG/UnreachableEliminate.ll

Test source: git

Log:

Source: <stdin>
ERROR: Unsupported instruction:   invoke void @test2()
          to label %N unwind label %U
ERROR: Unsupported instruction:   call void undef()
ERROR: Unsupported instruction:   call void %phi()
ERROR: Unsupported instruction:   call void %phi()

----------------------------------------
define void @test1(i1 %C, * %BP) {
%entry:
  br i1 %C, label %T, label %F

%F:
  ret void

%T:
  store i1 %C, * %BP, align 1
  assume i1 0
}
=>
define void @test1(i1 %C, * %BP) {
%entry:
  %0 = xor i1 %C, 1
  assume i1 %0
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i32 @test3(i32 %v) {
%entry:
  switch i32 %v, label %default [
    i32 1, label %U
    i32 2, label %T
  ]

%T:
  ret i32 2

%U:
  assume i1 0

%default:
  ret i32 1
}
=>
define i32 @test3(i32 %v) {
%entry:
  %cond = icmp eq i32 %v, 2
  %spec.select = select i1 %cond, i32 2, i32 1
  ret i32 %spec.select
}
Transformation seems to be correct!


----------------------------------------
define void @test5(i1 %cond, * %ptr) {
%entry:
  br i1 %cond, label %bb1, label %bb3

%bb3:
  br label %bb2

%bb1:
  br label %bb2

%bb2:
  %ptr.2 = phi * [ %ptr, %bb3 ], [ null, %bb1 ]
  store i8 2, * %ptr.2, align 8
  ret void
}
=>
define void @test5(i1 %cond, * %ptr) {
%entry:
  %0 = xor i1 %cond, 1
  assume i1 %0
  store i8 2, * %ptr, align 8
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test5_no_null_opt(i1 %cond, * %ptr) {
%entry:
  br i1 %cond, label %bb1, label %bb3

%bb3:
  br label %bb2

%bb1:
  br label %bb2

%bb2:
  %ptr.2 = phi * [ %ptr, %bb3 ], [ null, %bb1 ]
  store i8 2, * %ptr.2, align 8
  ret void
}
=>
define void @test5_no_null_opt(i1 %cond, * %ptr) {
%entry:
  %ptr.2 = select i1 %cond, * null, * %ptr
  store i8 2, * %ptr.2, align 8
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test6(i1 %cond, * %ptr) {
%entry:
  br i1 %cond, label %bb1, label %bb2

%bb1:
  br label %bb2

%bb2:
  %ptr.2 = phi * [ %ptr, %entry ], [ null, %bb1 ]
  store i8 2, * %ptr.2, align 8
  ret void
}
=>
define void @test6(i1 %cond, * %ptr) {
%entry:
  %0 = xor i1 %cond, 1
  assume i1 %0
  store i8 2, * %ptr, align 8
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test6_no_null_opt(i1 %cond, * %ptr) {
%entry:
  br i1 %cond, label %bb1, label %bb2

%bb1:
  br label %bb2

%bb2:
  %ptr.2 = phi * [ %ptr, %entry ], [ null, %bb1 ]
  store i8 2, * %ptr.2, align 8
  ret void
}
=>
define void @test6_no_null_opt(i1 %cond, * %ptr) {
%entry:
  %spec.select = select i1 %cond, * null, * %ptr
  store i8 2, * %spec.select, align 8
  ret void
}
Transformation seems to be correct!

ERROR: Unsupported instruction:   call void %Y()
ERROR: Unsupported instruction:   call void %spec.select()

----------------------------------------
define void @test9(i1 %X, * %Y) {
%entry:
  br i1 %X, label %if, label %else

%if:
  br label %else

%else:
  %phi = phi * [ %Y, %entry ], [ null, %if ]
  %0 = call * @fn_nonnull_noundef_arg(nonnull noundef * %phi)
  ret void
}
=>
define void @test9(i1 %X, * %Y) {
%entry:
  %0 = xor i1 %X, 1
  assume i1 %0
  %1 = call * @fn_nonnull_noundef_arg(nonnull noundef * %Y)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test9_deref(i1 %X, * %Y) {
%entry:
  br i1 %X, label %if, label %else

%if:
  br label %else

%else:
  %phi = phi * [ %Y, %entry ], [ null, %if ]
  %0 = call * @fn_nonnull_deref_arg(nonnull dereferenceable(4) * %phi)
  ret void
}
=>
define void @test9_deref(i1 %X, * %Y) {
%entry:
  %0 = xor i1 %X, 1
  assume i1 %0
  %1 = call * @fn_nonnull_deref_arg(nonnull dereferenceable(4) * %Y)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test9_deref_or_null(i1 %X, * %Y) {
%entry:
  br i1 %X, label %if, label %else

%if:
  br label %else

%else:
  %phi = phi * [ %Y, %entry ], [ null, %if ]
  %0 = call * @fn_nonnull_deref_or_null_arg(nonnull * %phi)
  ret void
}
=>
define void @test9_deref_or_null(i1 %X, * %Y) {
%entry:
  %0 = xor i1 %X, 1
  assume i1 %0
  %1 = call * @fn_nonnull_deref_or_null_arg(nonnull * %Y)
  ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %X = #x1 (1)
* %Y = poison

Source:
* %phi = null
* %0 = poison

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

Target:
i1 %0 = #x0 (0)
* %1 = poison



------------------- SMT STATS -------------------
Num queries: 18
Num invalid: 0
Num skips:   0
Num trivial: 40 (69.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     10 (55.6%)
Num UNSAT:   8 (44.4%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll

Alive2: Transform doesn't verify; aborting!
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/UnreachableEliminate.ll

 

<-- Back