Test Failure: Transforms/InstCombine/sext.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define i64 @test1(i32 %x) {
%0:
  %t = ctpop i32 %x
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test1(i32 %x) {
%0:
  %t = ctpop i32 %x
  %range_l#0%t = icmp sge i32 %t, 0
  %range_h#0%t = icmp slt i32 %t, 33
  %range#0%t = and i1 %range_l#0%t, %range_h#0%t
  assume_non_poison i1 %range#0%t
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test2(i32 %x) {
%0:
  %t = ctlz i32 %x, 1
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test2(i32 %x) {
%0:
  %t = ctlz i32 %x, 1
  %range_l#0%t = icmp sge i32 %t, 0
  %range_h#0%t = icmp slt i32 %t, 33
  %range#0%t = and i1 %range_l#0%t, %range_h#0%t
  assume_non_poison i1 %range#0%t
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i64 @test3(i32 %x) {
%0:
  %t = cttz i32 %x, 1
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test3(i32 %x) {
%0:
  %t = cttz i32 %x, 1
  %range_l#0%t = icmp sge i32 %t, 0
  %range_h#0%t = icmp slt i32 %t, 33
  %range#0%t = and i1 %range_l#0%t, %range_h#0%t
  assume_non_poison i1 %range#0%t
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i64 @test4(i32 %x) {
%0:
  %t = udiv i32 %x, 3
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test4(i32 %x) {
%0:
  %t = udiv i32 %x, 3
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i64 @test5(i32 %x) {
%0:
  %t = urem i32 %x, 30000
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test5(i32 %x) {
%0:
  %t = urem i32 %x, 30000
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i64 @test6(i32 %x) {
%0:
  %u = lshr i32 %x, 3
  %t = mul i32 %u, 3
  %s = sext i32 %t to i64
  ret i64 %s
}
=>
define i64 @test6(i32 %x) {
%0:
  %u = lshr i32 %x, 3
  %t = mul nsw nuw i32 %u, 3
  %s = zext i32 %t to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i64 @test7(i32 %x) {
%0:
  %t = and i32 %x, 511
  %u = sub i32 20000, %t
  %s = sext i32 %u to i64
  ret i64 %s
}
=>
define i64 @test7(i32 %x) {
%0:
  %t = and i32 %x, 511
  %u = sub nsw nuw i32 20000, %t
  %s = zext i32 %u to i64
  ret i64 %s
}
Transformation seems to be correct!


----------------------------------------
define i32 @test8(i8 %a, i32 %f, i1 %p, * %z) {
%0:
  %d = lshr i32 %f, 24
  %e = select i1 %p, i32 %d, i32 0
  %s = trunc i32 %e to i16
  %n = sext i16 %s to i32
  ret i32 %n
}
=>
define i32 @test8(i8 %a, i32 %f, i1 %p, * %z) {
%0:
  %d = lshr i32 %f, 24
  %n = select i1 %p, i32 %d, i32 0
  ret i32 %n
}
Transformation seems to be correct!


----------------------------------------
define i16 @test9(i16 %t, i1 %cond) {
%entry:
  br i1 %cond, label %T, label %F

%T:
  %t2 = sext i16 %t to i32
  br label %F

%F:
  %V = phi i32 [ %t2, %T ], [ 42, %entry ]
  %W = trunc i32 %V to i16
  ret i16 %W
}
=>
define i16 @test9(i16 %t, i1 %cond) {
%entry:
  br i1 %cond, label %T, label %F

%T:
  br label %F

%F:
  %V.off0 = phi i16 [ %t, %T ], [ 42, %entry ]
  ret i16 %V.off0
}
Transformation seems to be correct!


----------------------------------------
define i32 @test10(i32 %i) {
%0:
  %tmp12 = trunc i32 %i to i8
  %tmp16 = shl i8 %tmp12, 6
  %a = ashr i8 %tmp16, 6
  %b = sext i8 %a to i32
  ret i32 %b
}
=>
define i32 @test10(i32 %i) {
%0:
  %b1 = shl i32 %i, 30
  %b = ashr exact i32 %b1, 30
  ret i32 %b
}
Transformation seems to be correct!


----------------------------------------
define void @test11(<2 x i16> %srcA, <2 x i16> %srcB, * %dst) {
%0:
  %cmp = icmp eq <2 x i16> %srcB, %srcA
  %sext = sext <2 x i1> %cmp to <2 x i16>
  %tmask = ashr <2 x i16> %sext, { 15, 15 }
  store <2 x i16> %tmask, * %dst, align 4
  ret void
}
=>
define void @test11(<2 x i16> %srcA, <2 x i16> %srcB, * %dst) {
%0:
  %cmp = icmp eq <2 x i16> %srcB, %srcA
  %sext = sext <2 x i1> %cmp to <2 x i16>
  store <2 x i16> %sext, * %dst, align 4
  ret void
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i64 @test12(i32 %x) {
%0:
  %shr = lshr i32 %x, 1
  %sub = sub nsw i32 0, %shr
  %conv = sext i32 %sub to i64
  ret i64 %conv
}
=>
define i64 @test12(i32 %x) {
%0:
  %shr = lshr i32 %x, 1
  %sub = sub nsw i32 0, %shr
  %conv = sext i32 %sub to i64
  ret i64 %conv
}
Transformation seems to be correct!


----------------------------------------
define i32 @test13(i32 %x) {
%0:
  %and = and i32 %x, 8
  %cmp = icmp eq i32 %and, 0
  %ext = sext i1 %cmp to i32
  ret i32 %ext
}
=>
define i32 @test13(i32 %x) {
%0:
  %and = lshr i32 %x, 3
  %1 = and i32 %and, 1
  %sext = add nsw i32 %1, 4294967295
  ret i32 %sext
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test14(i16 %x) {
%0:
  %and = and i16 %x, 16
  %cmp = icmp ne i16 %and, 16
  %ext = sext i1 %cmp to i32
  ret i32 %ext
}
=>
define i32 @test14(i16 %x) {
%0:
  %and = lshr i16 %x, 4
  %1 = and i16 %and, 1
  %sext = add nsw i16 %1, 65535
  %ext = sext i16 %sext to i32
  ret i32 %ext
}
Transformation seems to be correct!


----------------------------------------
define i32 @test15(i32 %x) {
%0:
  %and = and i32 %x, 16
  %cmp = icmp ne i32 %and, 0
  %ext = sext i1 %cmp to i32
  ret i32 %ext
}
=>
define i32 @test15(i32 %x) {
%0:
  %and = shl i32 %x, 27
  %sext = ashr i32 %and, 31
  ret i32 %sext
}
Transformation doesn't verify!
ERROR: Timeout


----------------------------------------
define i32 @test16(i16 %x) {
%0:
  %and = and i16 %x, 8
  %cmp = icmp eq i16 %and, 8
  %ext = sext i1 %cmp to i32
  ret i32 %ext
}
=>
define i32 @test16(i16 %x) {
%0:
  %and = shl i16 %x, 12
  %sext = ashr i16 %and, 15
  %ext = sext i16 %sext to i32
  ret i32 %ext
}
Transformation seems to be correct!


----------------------------------------
define i32 @test17(i1 %x) {
%0:
  %c1 = sext i1 %x to i32
  %c2 = sub i32 0, %c1
  ret i32 %c2
}
=>
define i32 @test17(i1 %x) {
%0:
  %c1.neg = zext i1 %x to i32
  ret i32 %c1.neg
}
Transformation seems to be correct!


----------------------------------------
define i32 @test18(i16 %x) {
%0:
  %cmp = icmp slt i16 %x, 0
  %sel = select i1 %cmp, i16 0, i16 %x
  %ext = sext i16 %sel to i32
  ret i32 %ext
}
=>
define i32 @test18(i16 %x) {
%0:
  %1 = icmp sgt i16 %x, 0
  %sel = select i1 %1, i16 %x, i16 0
  %ext = zext i16 %sel to i32
  ret i32 %ext
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
i16 %x = undef

Source:
i1 %cmp = undef
i16 %sel = undef
i32 %ext = #x00000000 (0)	[based on undef value]

Target:
i1 %1 = #x1 (1)
i16 %sel = #x8000 (32768, -32768)
i32 %ext = #x00008000 (32768)
Source value: #x00000000 (0)
Target value: #x00008000 (32768)


------------------- SMT STATS -------------------
Num queries: 51
Num invalid: 0
Num skips:   0
Num trivial: 38 (42.7%)
Num timeout: 4 (7.8%)
Num errors:  0 (0.0%)
Num SAT:     20 (39.2%)
Num UNSAT:   27 (52.9%)

stderr:

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

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back