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