1 ; RUN: llc -relocation-model=pic < %s | FileCheck %s
3 ; The load restoring r30 at the end of the function was placed out of order
4 ; relative to its uses as the PIC base pointer.
5 ; This was because the r30 operand was not marked as "def" which allowed
6 ; the post-RA scheduler to move it over other uses of r30.
10 ; R30 should not appear in an instruction after it's been restored.
13 target datalayout = "E-m:e-p:32:32-i64:64-n32"
14 target triple = "powerpc--"
16 define double @fred(i64 %a) #0 {
19 %conv = trunc i64 %0 to i32
20 %conv1 = sitofp i32 %conv to double
21 %mul = fmul double %conv1, 0x41F0000000000000
22 %and = and i64 %a, 4294967295
23 %or = or i64 %and, 4841369599423283200
24 %sub = fadd double %mul, 0xC330000000000000
25 %1 = bitcast i64 %or to double
26 %add = fadd double %sub, %1
30 attributes #0 = { norecurse nounwind readnone "target-cpu"="ppc" "use-soft-float"="false" }