1 ; RUN: llc -verify-machineinstrs -O2 < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-n32:64"
3 target triple = "powerpc64le-unknown-linux-gnu"
6 define i8 @test1(i32 %a) {
8 ; CHECK-NOT: rlwinm {{{[0-9]+}}}, {{[0-9]+}}, 0, 24, 27
9 ; CHECK: andi. [[REG:[0-9]+]], {{[0-9]+}}, 240
10 ; CHECK-NOT: cmplwi [[REG]], 0
13 %1 = icmp eq i32 %0, 0
14 br i1 %1, label %eq0, label %neq0
22 define i8 @test2(i32 %a) {
24 ; CHECK: rlwinm [[REG:[0-9]+]], {{[0-9]+}}, 0, 28, 23
25 ; CHECK: cmplwi [[REG]], 0
28 %1 = icmp eq i32 %0, 0
29 br i1 %1, label %eq0, label %neq0
36 declare {i32, i1} @llvm.ssub.with.overflow.i32(i32 %a, i32 %b)
39 define i8 @test3(i32 %a, i32 %b) {
41 ; CHECK-NOT: rlwnm {{{[0-9]+}}}, {{[0-9]+}}, {{{[0-9]+}}}, 28, 31
42 ; CHECK: rlwnm. [[REG:[0-9]+]], {{[0-9]+}}, 4, 28, 31
43 ; CHECK-NOT: cmplwi [[REG]], 0
45 %left = shl i32 %a, %b
46 %res = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 32, i32 %b)
47 %right_amount = extractvalue {i32, i1} %res, 0
48 %right = lshr i32 %a, %right_amount
49 %0 = or i32 %left, %right
51 %2 = icmp eq i32 %1, 0
52 br i1 %2, label %eq0, label %neq0