OLD | NEW |
(Empty) | |
| 1 ; RUN: opt < %s -instcombine -S | FileCheck %s |
| 2 ; Test that instcombine does not introduce non-power-of-two integers into |
| 3 ; the module |
| 4 |
| 5 target datalayout = "p:32:32:32" |
| 6 |
| 7 ; This test is a counterpart to icmp_shl16 in |
| 8 ; test/Transforms/InstCombine/icmp.ll, which should still pass. |
| 9 ; CHECK: @icmp_shl31 |
| 10 ; CHECK-NOT: i31 |
| 11 define i1 @icmp_shl31(i32 %x) { |
| 12 %shl = shl i32 %x, 1 |
| 13 %cmp = icmp slt i32 %shl, 36 |
| 14 ret i1 %cmp |
| 15 } |
| 16 |
| 17 ; Check that we don't introduce i4, which is a power of 2 but still not allowed. |
| 18 ; CHECK: @icmp_shl4 |
| 19 ; CHECK-NOT: i4 |
| 20 define i1 @icmp_shl4(i32 %x) { |
| 21 %shl = shl i32 %x, 28 |
| 22 %cmp = icmp slt i32 %shl, 1073741824 |
| 23 ret i1 %cmp |
| 24 } |
OLD | NEW |