llvm.org GIT mirror llvm / 8f89f72
Merging r302183: ------------------------------------------------------------------------ r302183 | kparzysz | 2017-05-04 15:14:54 -0400 (Thu, 04 May 2017) | 7 lines [PPC] When restoring R30 (PIC base pointer), mark it as <def> This happened on the PPC32/SVR4 path and was discovered when building FreeBSD on PPC32. It was a typo-class error in the frame lowering code. This fixes PR26519. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_40@304150 91177308-0d34-0410-b5e6-96231b3b80d8 Tom Stellard 2 years ago
2 changed file(s) with 31 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
14661466 }
14671467
14681468 if (FI->usesPICBase())
1469 BuildMI(MBB, MBBI, dl, LoadInst)
1470 .addReg(PPC::R30)
1469 BuildMI(MBB, MBBI, dl, LoadInst, PPC::R30)
14711470 .addImm(PBPOffset)
14721471 .addReg(RBReg);
14731472
0 ; RUN: llc -march=ppc32 -relocation-model=pic < %s | FileCheck %s
1
2 ; The load restoring r30 at the end of the function was placed out of order
3 ; relative to its uses as the PIC base pointer.
4 ; This was because the r30 operand was not marked as "def" which allowed
5 ; the post-RA scheduler to move it over other uses of r30.
6
7 ; CHECK-LABEL: fred
8 ; CHECK: lwz 30, 24(1)
9 ; R30 should not appear in an instruction after it's been restored.
10 ; CHECK-NOT: 30,
11
12 target datalayout = "E-m:e-p:32:32-i64:64-n32"
13 target triple = "powerpc"
14
15 define double @fred(i64 %a) #0 {
16 entry:
17 %0 = lshr i64 %a, 32
18 %conv = trunc i64 %0 to i32
19 %conv1 = sitofp i32 %conv to double
20 %mul = fmul double %conv1, 0x41F0000000000000
21 %and = and i64 %a, 4294967295
22 %or = or i64 %and, 4841369599423283200
23 %sub = fadd double %mul, 0xC330000000000000
24 %1 = bitcast i64 %or to double
25 %add = fadd double %sub, %1
26 ret double %add
27 }
28
29 attributes #0 = { norecurse nounwind readnone "target-cpu"="ppc" "use-soft-float"="false" }