add_cmp.ll
1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
; REQUIRES: asserts
; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \
; RUN: -verify-machineinstrs -debug 2>&1 | FileCheck %s
define zeroext i1 @addiCmpiUnsigned(i32 zeroext %x) {
entry:
%add = add nuw i32 10, %x
%cmp = icmp ugt i32 %add, 100
ret i1 %cmp
; CHECK: === addiCmpiUnsigned
; CHECK: Optimized lowered selection DAG: %bb.0 'addiCmpiUnsigned:entry'
; CHECK: [[REG1:t[0-9]+]]: i32 = truncate {{t[0-9]+}}
; CHECK: [[REG2:t[0-9]+]]: i32 = add nuw [[REG1]], Constant:i32<10>
; CHECK: {{t[0-9]+}}: i1 = setcc [[REG2]], Constant:i32<100>, setugt:ch
}
define zeroext i1 @addiCmpiSigned(i32 signext %x) {
entry:
%add = add nsw i32 16, %x
%cmp = icmp sgt i32 %add, 30
ret i1 %cmp
; CHECK: === addiCmpiSigned
; CHECK: Optimized lowered selection DAG: %bb.0 'addiCmpiSigned:entry'
; CHECK: [[REG1:t[0-9]+]]: i32 = truncate {{t[0-9]+}}
; CHECK: [[REG2:t[0-9]+]]: i32 = add nsw [[REG1]], Constant:i32<16>
; CHECK: {{t[0-9]+}}: i1 = setcc [[REG2]], Constant:i32<30>, setgt:ch
}
define zeroext i1 @addiCmpiUnsignedOverflow(i32 zeroext %x) {
entry:
%add = add nuw i32 110, %x
%cmp = icmp ugt i32 %add, 100
ret i1 %cmp
; CHECK: === addiCmpiUnsignedOverflow
; CHECK: Optimized lowered selection DAG: %bb.0 'addiCmpiUnsignedOverflow:entry'
; CHECK: [[REG1:t[0-9]+]]: i32 = truncate {{t[0-9]+}}
; CHECK: [[REG2:t[0-9]+]]: i32 = add nuw [[REG1]], Constant:i32<110>
; CHECK: {{t[0-9]+}}: i1 = setcc [[REG2]], Constant:i32<100>, setugt:ch
}
define zeroext i1 @addiCmpiSignedOverflow(i16 signext %x) {
entry:
%add = add nsw i16 16, %x
%cmp = icmp sgt i16 %add, -32767
ret i1 %cmp
; CHECK: === addiCmpiSignedOverflow
; CHECK: Optimized lowered selection DAG: %bb.0 'addiCmpiSignedOverflow:entry'
; CHECK: [[REG1:t[0-9]+]]: i16 = truncate {{t[0-9]+}}
; CHECK: [[REG2:t[0-9]+]]: i16 = add nsw [[REG1]], Constant:i16<16>
; CHECK: {{t[0-9]+}}: i1 = setcc [[REG2]], Constant:i16<-32767>, setgt:ch
}