1 ; RUN: llc < %s | FileCheck %s -check-prefix=NOIPRA
2 ; RUN: llc -enable-ipra < %s | FileCheck %s
4 target triple = "x86_64--"
6 define internal void @foo() norecurse {
7 ; When IPRA is not enabled R15 will be saved by foo as it is callee saved reg.
10 ; When IPRA is enabled none register should be saved as foo() is local function
11 ; so we optimize it to save no registers.
13 ; CHECK-NOT: pushq %r15
14 call void asm sideeffect "movl %r14d, %r15d", "~{r15}"()
18 define void @bar(i32 %X) {
19 call void asm sideeffect "movl %r12d, $0", "{r15}~{r12}"(i32 %X)
20 ; As R15 is clobbered by foo() when IPRA is enabled value of R15 should be
21 ; saved if register containing orignal value is also getting clobbered
22 ; and reloaded after foo(), here original value is loaded back into R15D after
27 ; CHECK-NEXT: movl %edi, %r15d
28 call void asm sideeffect "movl $0, %r12d", "{r15}~{r12}"(i32 %X)