File: restore-r30.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 1,998,492 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (30 lines) | stat: -rw-r--r-- 998 bytes parent folder | download | duplicates (27)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; RUN: llc -relocation-model=pic < %s | FileCheck %s

; The load restoring r30 at the end of the function was placed out of order
; relative to its uses as the PIC base pointer.
; This was because the r30 operand was not marked as "def" which allowed
; the post-RA scheduler to move it over other uses of r30.

; CHECK-LABEL: fred
; CHECK:       lwz 30, 24(1)
; R30 should not appear in an instruction after it's been restored.
; CHECK-NOT:   30,

target datalayout = "E-m:e-p:32:32-i64:64-n32"
target triple = "powerpc--"

define double @fred(i64 %a) #0 {
entry:
  %0 = lshr i64 %a, 32
  %conv = trunc i64 %0 to i32
  %conv1 = sitofp i32 %conv to double
  %mul = fmul double %conv1, 0x41F0000000000000
  %and = and i64 %a, 4294967295
  %or = or i64 %and, 4841369599423283200
  %sub = fadd double %mul, 0xC330000000000000
  %1 = bitcast i64 %or to double
  %add = fadd double %sub, %1
  ret double %add
}

attributes #0 = { norecurse nounwind readnone "target-cpu"="ppc" "use-soft-float"="false" }