Test Failure: Transforms/CorrelatedValuePropagation/basic.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i32 @test1(i1 %C) {
%0:
  br i1 %C, label %exit, label %body

%body:
  %A = select i1 %C, i32 10, i32 11
  ret i32 %A

%exit:
  ret i32 10
}
=>
define i32 @test1(i1 %C) {
%0:
  br i1 %C, label %exit, label %body

%body:
  ret i32 11

%exit:
  ret i32 10
}
Transformation seems to be correct!


----------------------------------------
define i1 @test2() {
%entry:
  %cond = call i1 @ext()
  br i1 %cond, label %bb1, label %bb2

%bb1:
  %cond2 = call i1 @ext()
  br i1 %cond2, label %bb3, label %bb2

%bb3:
  %res = call i1 @ext()
  ret i1 %res

%bb2:
  %cond_merge = phi i1 [ %cond, %entry ], [ 0, %bb1 ]
  ret i1 %cond_merge
}
=>
define i1 @test2() {
%entry:
  %cond = call i1 @ext()
  br i1 %cond, label %bb1, label %bb2

%bb1:
  %cond2 = call i1 @ext()
  br i1 %cond2, label %bb3, label %bb2

%bb3:
  %res = call i1 @ext()
  ret i1 %res

%bb2:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
@gv = constant 1 bytes, align 1

define i8 @test3(* %a) {
#init:
  store i8 7, * @gv, align 1
  br label %entry

%entry:
  %cond = icmp eq * %a, @gv
  br i1 %cond, label %bb2, label %bb

%bb:
  ret i8 0

%bb2:
  %should_be_const = load i8, * %a, align 1
  ret i8 %should_be_const
}
=>
@gv = constant 1 bytes, align 1

define i8 @test3(* %a) {
#init:
  store i8 7, * @gv, align 1
  br label %entry

%entry:
  %cond = icmp eq * %a, @gv
  br i1 %cond, label %bb2, label %bb

%bb:
  ret i8 0

%bb2:
  %should_be_const = load i8, * @gv, align 1
  ret i8 %should_be_const
}
Transformation seems to be correct!


----------------------------------------
define i32 @test4(i32 %0) {
%EntryBlock:
  %.demorgan = icmp sgt i32 %0, 2
  br i1 %.demorgan, label %GreaterThanTwo, label %LessThanOrEqualToTwo

%LessThanOrEqualToTwo:
  ret i32 0

%GreaterThanTwo:
  %1 = icmp eq i32 %0, 2
  br i1 %1, label %Impossible, label %NotTwoAndGreaterThanTwo

%Impossible:
  ret i32 1

%NotTwoAndGreaterThanTwo:
  ret i32 2
}
=>
define i32 @test4(i32 %0) {
%EntryBlock:
  %.demorgan = icmp sgt i32 %0, 2
  br i1 %.demorgan, label %GreaterThanTwo, label %LessThanOrEqualToTwo

%LessThanOrEqualToTwo:
  ret i32 0

%GreaterThanTwo:
  br i1 0, label %Impossible, label %NotTwoAndGreaterThanTwo

%Impossible:
  ret i32 1

%NotTwoAndGreaterThanTwo:
  ret i32 2
}
Transformation seems to be correct!


----------------------------------------
define void @test5(* %x, * %y) {
%entry:
  %pre = icmp eq * %x, null
  br i1 %pre, label %return, label %loop

%loop:
  %phi = phi * [ %x, %entry ], [ %sel, %loop ]
  %f = call * @f(* %phi)
  %cmp1 = icmp ne * %f, %y
  %sel = select i1 %cmp1, * %f, * null
  %cmp2 = icmp eq * %sel, null
  br i1 %cmp2, label %return, label %loop

%return:
  ret void
}
=>
define void @test5(* %x, * %y) {
%entry:
  %pre = icmp eq * %x, null
  br i1 %pre, label %return, label %loop

%loop:
  %phi = phi * [ %x, %entry ], [ %f, %loop ]
  %f = call * @f(* %phi)
  %cmp1 = icmp ne * %f, %y
  %sel = select i1 %cmp1, * %f, * null
  %cmp2 = icmp eq * %sel, null
  br i1 %cmp2, label %return, label %loop

%return:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i32 @switch1(i32 %s) {
%entry:
  %cmp = icmp slt i32 %s, 0
  br i1 %cmp, label %negative, label %out

%negative:
  switch i32 %s, label %out [
    i32 0, label %out
    i32 1, label %out
    i32 4294967295, label %next
    i32 4294967294, label %next
    i32 2, label %out
    i32 3, label %out
  ]

%out:
  %p = phi i32 [ 1, %entry ], [ 4294967295, %negative ], [ 4294967295, %negative ], [ 4294967295, %negative ], [ 4294967295, %negative ], [ 4294967295, %negative ]
  ret i32 %p

%next:
  %q = phi i32 [ 0, %negative ], [ 0, %negative ]
  ret i32 %q
}
=>
define i32 @switch1(i32 %s) {
%entry:
  %cmp = icmp slt i32 %s, 0
  br i1 %cmp, label %negative, label %out

%negative:
  switch i32 %s, label %out [
    i32 4294967294, label %next
    i32 4294967295, label %next
  ]

%out:
  %p = phi i32 [ 1, %entry ], [ 4294967295, %negative ]
  ret i32 %p

%next:
  ret i32 0
}
Transformation seems to be correct!


----------------------------------------
define i32 @switch2(i32 %s) {
%entry:
  %cmp = icmp sgt i32 %s, 0
  br i1 %cmp, label %positive, label %out

%positive:
  switch i32 %s, label %out [
    i32 0, label %out
    i32 4294967295, label %next
    i32 4294967294, label %next
  ]

%out:
  %p = phi i32 [ 4294967295, %entry ], [ 1, %positive ], [ 1, %positive ]
  ret i32 %p

%next:
  %q = phi i32 [ 0, %positive ], [ 0, %positive ]
  ret i32 %q
}
=>
define i32 @switch2(i32 %s) {
%entry:
  %cmp = icmp sgt i32 %s, 0
  br i1 %cmp, label %positive, label %out

%next:
  ret i32 0

%positive:
  br label %out

%out:
  %p = phi i32 [ 4294967295, %entry ], [ 1, %positive ]
  ret i32 %p
}
Transformation seems to be correct!


----------------------------------------
define i32 @switch3(i32 %s) {
%entry:
  %cmp = icmp sgt i32 %s, 0
  br i1 %cmp, label %positive, label %out

%positive:
  switch i32 %s, label %out [
    i32 4294967295, label %out
    i32 4294967294, label %next
    i32 4294967293, label %next
  ]

%out:
  %p = phi i32 [ 4294967295, %entry ], [ 1, %positive ], [ 1, %positive ]
  ret i32 %p

%next:
  %q = phi i32 [ 0, %positive ], [ 0, %positive ]
  ret i32 %q
}
=>
define i32 @switch3(i32 %s) {
%entry:
  %cmp = icmp sgt i32 %s, 0
  br i1 %cmp, label %positive, label %out

%next:
  ret i32 0

%positive:
  br label %out

%out:
  %p = phi i32 [ 4294967295, %entry ], [ 1, %positive ]
  ret i32 %p
}
Transformation seems to be correct!


----------------------------------------
define void @switch4(i32 %s) {
%entry:
  %cmp = icmp eq i32 %s, 0
  br i1 %cmp, label %zero, label %out

%zero:
  switch i32 %s, label %out [
    i32 0, label %next
    i32 1, label %out
    i32 4294967295, label %out
  ]

%out:
  ret void

%next:
  ret void
}
=>
define void @switch4(i32 %s) {
%entry:
  %cmp = icmp eq i32 %s, 0
  br i1 %cmp, label %zero, label %out

%out:
  ret void

%zero:
  br label %next

%next:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define i1 @arg_attribute(* nonnull %a) {
%0:
  %cmp = icmp eq * nonnull %a, null
  br label %exit

%exit:
  ret i1 %cmp
}
=>
define i1 @arg_attribute(* nonnull %a) {
%0:
  br label %exit

%exit:
  ret i1 0
}
Transformation seems to be correct!


----------------------------------------
define i1 @call_attribute() {
%0:
  %a = call * @return_nonnull()
  %cmp = icmp eq * %a, null
  br label %exit

%exit:
  ret i1 %cmp
}
=>
define i1 @call_attribute() {
%0:
  %a = call * @return_nonnull()
  %cmp = icmp eq * %a, null
  br label %exit

%exit:
  ret i1 0
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:

Source:
* %a = null
i1 %cmp = #x1 (1)

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

Target:
* %a = null
i1 %cmp = #x1 (1)
Source value: #x1 (1)
Target value: #x0 (0)


------------------- SMT STATS -------------------
Num queries: 30
Num invalid: 0
Num skips:   0
Num trivial: 24 (44.4%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     12 (40.0%)
Num UNSAT:   18 (60.0%)

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/scripts/opt-alive.sh -correlated-propagation -S
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/CorrelatedValuePropagation/basic.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/CorrelatedValuePropagation/basic.ll

 

<-- Back