Test Failure: Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll

Test source: git

Log:

Source: /home/nlopes/llvm/llvm/test/Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll

----------------------------------------
define i32 @test1(i32 %a, i32 %b) {
%0:
  %cond = icmp uge i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb2, label %bb3

%bb2:
  ret i32 %r1

%bb3:
  ret i32 0
}
=>
define i32 @test1(i32 %a, i32 %b) {
%0:
  %cond.not = icmp ult i32 %a, %b
  br i1 %cond.not, label %bb3, label %bb1

%bb1:
  br i1 0, label %bb2, label %bb3

%bb2:
  ret i32 undef

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


----------------------------------------
define i32 @test2(i32 %a, i32 %b) {
%0:
  %cond = icmp uge i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test2(i32 %a, i32 %b) {
%0:
  %cond.not = icmp ult i32 %a, %b
  br i1 %cond.not, label %bb3, label %bb1

%bb1:
  br i1 0, label %bb3, label %bb2

%bb2:
  %sub1 = sub nuw i32 %a, %b
  ret i32 %sub1

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


----------------------------------------
define i32 @test3(i32 %a, i32 %b) {
%0:
  %cond = icmp ugt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb2, label %bb3

%bb2:
  ret i32 %r1

%bb3:
  ret i32 0
}
=>
define i32 @test3(i32 %a, i32 %b) {
%0:
  %cond = icmp ugt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  br i1 0, label %bb2, label %bb3

%bb2:
  ret i32 undef

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


----------------------------------------
define i32 @test4(i32 %a, i32 %b) {
%0:
  %cond = icmp ugt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test4(i32 %a, i32 %b) {
%0:
  %cond = icmp ugt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  br i1 0, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  %sub1 = sub nuw i32 %a, %b
  ret i32 %sub1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test5(i32 %a, i32 %b) {
%0:
  %cond = icmp eq i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test5(i32 %a, i32 %b) {
%0:
  %cond = icmp eq i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  br i1 0, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  %sub1 = sub nuw i32 %a, %b
  ret i32 %sub1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test6(i32 %a, i32 %b) {
%0:
  %cond = icmp ult i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test6(i32 %a, i32 %b) {
%0:
  %cond = icmp ult i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  br i1 1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 undef
}
Transformation seems to be correct!


----------------------------------------
define i32 @test7(i32 %a, i32 %b) {
%0:
  %cond = icmp slt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test7(i32 %a, i32 %b) {
%0:
  %cond = icmp slt i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  ret i32 %r1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test8(i32 %a, i32 %b) {
%0:
  %cond = icmp ne i32 %a, %b
  br i1 %cond, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test8(i32 %a, i32 %b) {
%0:
  %cond.not = icmp eq i32 %a, %b
  br i1 %cond.not, label %bb3, label %bb1

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb2:
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  ret i32 %r1

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


----------------------------------------
define i32 @test9(i32 %a, i32 %b, i1 %cond2) {
%0:
  %cond = icmp ugt i32 %a, %b
  %and = and i1 %cond, %cond2
  br i1 %and, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test9(i32 %a, i32 %b, i1 %cond2) {
%0:
  %cond = icmp ugt i32 %a, %b
  %and = and i1 %cond, %cond2
  br i1 %and, label %bb1, label %bb3

%bb1:
  br i1 0, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  %sub1 = sub nuw i32 %a, %b
  ret i32 %sub1
}
Transformation seems to be correct!


----------------------------------------
define i32 @test9_logical(i32 %a, i32 %b, i1 %cond2) {
%0:
  %cond = icmp ugt i32 %a, %b
  %and = select i1 %cond, i1 %cond2, i1 0
  br i1 %and, label %bb1, label %bb3

%bb1:
  %sub1 = usub_overflow {i32, i1, i24} %a, %b
  %r1 = extractvalue {i32, i1, i24} %sub1, 0
  %c1 = extractvalue {i32, i1, i24} %sub1, 1
  br i1 %c1, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  ret i32 %r1
}
=>
define i32 @test9_logical(i32 %a, i32 %b, i1 %cond2) {
%0:
  %cond = icmp ugt i32 %a, %b
  %and = and i1 %cond, %cond2
  br i1 %and, label %bb1, label %bb3

%bb1:
  br i1 0, label %bb3, label %bb2

%bb3:
  ret i32 0

%bb2:
  %sub1 = sub nuw i32 %a, %b
  ret i32 %sub1
}
Transformation doesn't verify!
ERROR: Source is more defined than target

Example:
i32 %a = #x006cbc81 (7126145)
i32 %b = #x30595d40 (811162944)
i1 %cond2 = poison

Source:
i1 %cond = #x0 (0)
i1 %and = #x0 (0)
{i32, i1, i24} %sub1 = { #xd0135f41 (3490930497, -804036799), #x1 (1), poison }
i32 %r1 = #xd0135f41 (3490930497, -804036799)
i1 %c1 = #x1 (1)

Target:
i1 %cond = #x0 (0)
i1 %and = poison
i32 %sub1 = poison



------------------- SMT STATS -------------------
Num queries: 35
Num invalid: 0
Num skips:   0
Num trivial: 39 (52.7%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     11 (31.4%)
Num UNSAT:   24 (68.6%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 3'
+ /home/nlopes/alive2/build/opt-alive.sh -instcombine -S /home/nlopes/llvm/llvm/test/Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/InstCombine/usub-overflow-known-by-implied-cond.ll

 

<-- Back