1; REQUIRES: asserts 2; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu < %s \ 3; RUN: -verify-machineinstrs -debug 2>&1 | FileCheck %s 4 5define zeroext i1 @addiCmpiUnsigned(i32 zeroext %x) { 6entry: 7 %add = add nuw i32 10, %x 8 %cmp = icmp ugt i32 %add, 100 9 ret i1 %cmp 10 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 16} 17 18define zeroext i1 @addiCmpiSigned(i32 signext %x) { 19entry: 20 %add = add nsw i32 16, %x 21 %cmp = icmp sgt i32 %add, 30 22 ret i1 %cmp 23 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 29} 30 31define zeroext i1 @addiCmpiUnsignedOverflow(i32 zeroext %x) { 32entry: 33 %add = add nuw i32 110, %x 34 %cmp = icmp ugt i32 %add, 100 35 ret i1 %cmp 36 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 42} 43 44define zeroext i1 @addiCmpiSignedOverflow(i16 signext %x) { 45entry: 46 %add = add nsw i16 16, %x 47 %cmp = icmp sgt i16 %add, -32767 48 ret i1 %cmp 49 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 55} 56 57