1 ; Note: Test option to disable use of non-volatile CR to avoid CR spilling in prologue.
2 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -ppc-disable-non-volatile-cr\
3 ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck --check-prefix=CHECK-DISABLE %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu\
5 ; RUN: -ppc-asm-full-reg-names -ppc-vsr-nums-as-vr < %s | FileCheck --check-prefix=CHECK-ENABLE %s
7 ; Function Attrs: nounwind
8 define dso_local signext i32 @DisableNonVolatileCR(i32 signext %a, i32 signext %b) {
9 ; CHECK-DISABLE-LABEL: DisableNonVolatileCR:
10 ; CHECK-DISABLE: # %bb.0: # %entry
11 ; CHECK-DISABLE-NOT: mfocrf {{r[0-9]+}}
12 ; CHECK-DISABLE-NOT: stw {{r[0-9]+}}
13 ; CHECK-DISABLE: stdu r1
14 ; CHECK-DISABLE-DAG: mfocrf [[REG2:r[0-9]+]]
15 ; CHECK-DISABLE-DAG: stw [[REG2]]
16 ; CHECK-DISABLE: # %bb.1: # %if.then
18 ; CHECK-ENABLE-LABEL: DisableNonVolatileCR:
19 ; CHECK-ENABLE: # %bb.0: # %entry
20 ; CHECK-ENABLE-DAG: mfocrf [[REG1:r[0-9]+]]
21 ; CHECK-ENABLE-DAG: stw [[REG1]]
22 ; CHECK-ENABLE: stdu r1
23 ; CHECK-ENABLE-NOT: mfocrf {{r[0-9]+}}
24 ; CHECK-ENABLE-NOT: stw {{r[0-9]+}}
25 ; CHECK-ENABLE: # %bb.1: # %if.then
28 %cmp = icmp slt i32 %a, %b
29 br i1 %cmp, label %if.then, label %if.else
31 if.then: ; preds = %entry
35 if.else: ; preds = %entry
39 if.end: ; preds = %if.else, %if.then
40 %conv = zext i1 %cmp to i32
41 %call = tail call signext i32 @callee(i32 signext %conv)
47 declare signext i32 @callee(i32 signext)