Test Failure: Transforms/SimplifyCFG/preserve-branchweights.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define void @test1(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %Y, label %X

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Z, label %Y

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test1(i1 %a, i1 %b) {
%entry:
  %a.not = xor i1 %a, 1
  %c = or i1 %b, 0
  %or.cond = select i1 %a.not, i1 %c, i1 0
  br i1 %or.cond, label %Z, label %Y

%Y:
  call void @helper(i32 0)
  ret void

%Z:
  call void @helper(i32 1)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @fake_weights(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %Y, label %X

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Z, label %Y

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @fake_weights(i1 %a, i1 %b) {
%entry:
  %a.not = xor i1 %a, 1
  %c = or i1 %b, 0
  %or.cond = select i1 %a.not, i1 %c, i1 0
  br i1 %or.cond, label %Z, label %Y

%Y:
  call void @helper(i32 0)
  ret void

%Z:
  call void @helper(i32 1)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test2(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %X, label %Y

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Z, label %Y

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test2(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  %or.cond = select i1 %a, i1 %c, i1 0
  br i1 %or.cond, label %Z, label %Y

%Y:
  call void @helper(i32 0)
  ret void

%Z:
  call void @helper(i32 1)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test3(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %X, label %Y

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Z, label %Y

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test3(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  %or.cond = select i1 %a, i1 %c, i1 0
  br i1 %or.cond, label %Z, label %Y

%Y:
  call void @helper(i32 0)
  ret void

%Z:
  call void @helper(i32 1)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test4(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %X, label %Y

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Z, label %Y

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test4(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  %or.cond = select i1 %a, i1 %c, i1 0
  br i1 %or.cond, label %Z, label %Y

%Y:
  call void @helper(i32 0)
  ret void

%Z:
  call void @helper(i32 1)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test5(i32 %M, i32 %N) {
%entry:
  switch i32 %N, label %sw2 [
    i32 1, label %sw2
    i32 2, label %sw.bb
    i32 3, label %sw.bb1
  ]

%sw.bb1:
  call void @helper(i32 1)
  br label %sw.epilog

%sw.bb:
  call void @helper(i32 0)
  br label %sw.epilog

%sw2:
  call void @helper(i32 2)
  br label %sw.epilog

%sw.epilog:
  ret void
}
=>
define void @test5(i32 %M, i32 %N) {
%entry:
  switch i32 %N, label %sw2 [
    i32 3, label %sw.bb1
    i32 2, label %sw.bb
  ]

%sw.bb:
  call void @helper(i32 0)
  br label %sw.epilog

%sw.bb1:
  call void @helper(i32 1)
  br label %sw.epilog

%sw2:
  call void @helper(i32 2)
  br label %sw.epilog

%sw.epilog:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test6(i32 %M, i32 %N) {
%entry:
  switch i32 %N, label %sw2 [
    i32 1, label %sw2
    i32 2, label %sw.bb
    i32 3, label %sw.bb1
  ]

%sw.bb1:
  call void @helper(i32 1)
  br label %sw.epilog

%sw.bb:
  call void @helper(i32 0)
  br label %sw.epilog

%sw2:
  switch i32 %N, label %sw.epilog [
    i32 2, label %sw.bb4
    i32 4, label %sw.bb5
  ]

%sw.bb4:
  call void @helper(i32 2)
  br label %sw.epilog

%sw.bb5:
  call void @helper(i32 3)
  br label %sw.epilog

%sw.epilog:
  ret void
}
=>
define void @test6(i32 %M, i32 %N) {
%entry:
  switch i32 %N, label %sw.epilog [
    i32 3, label %sw.bb1
    i32 2, label %sw.bb
    i32 4, label %sw.bb5
  ]

%sw.bb5:
  call void @helper(i32 3)
  br label %sw.epilog

%sw.bb:
  call void @helper(i32 0)
  br label %sw.epilog

%sw.bb1:
  call void @helper(i32 1)
  br label %sw.epilog

%sw.epilog:
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test1_swap(i1 %a, i1 %b) {
%entry:
  br i1 %a, label %Y, label %X

%X:
  %c = or i1 %b, 0
  br i1 %c, label %Y, label %Z

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test1_swap(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  %or.cond = select i1 %a, i1 1, i1 %c
  br i1 %or.cond, label %Y, label %Z

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
Transformation seems to be correct!


----------------------------------------
define void @test7(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  br i1 %a, label %Y, label %X

%X:
  br i1 %c, label %Y, label %Z

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
=>
define void @test7(i1 %a, i1 %b) {
%entry:
  %c = or i1 %b, 0
  %brmerge = or i1 %a, %c
  br i1 %brmerge, label %Y, label %Z

%Z:
  call void @helper(i32 1)
  ret void

%Y:
  call void @helper(i32 0)
  ret void
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i1 %a = #x1 (1)
i1 %b = poison

Source:
i1 %c = poison

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

Target:
i1 %c = poison
i1 %brmerge = poison



------------------- SMT STATS -------------------
Num queries: 26
Num invalid: 0
Num skips:   0
Num trivial: 33 (55.9%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     10 (38.5%)
Num UNSAT:   16 (61.5%)
Alive2: Transform doesn't verify; aborting!

stderr:

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

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SimplifyCFG/preserve-branchweights.ll

 

<-- Back