File: ppc-redzone-alignment-bug.ll

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (32 lines) | stat: -rw-r--r-- 1,075 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
31
32
; Note the formula for negative number alignment calculation should be y = x & ~(n-1) rather than y = (x + (n-1)) & ~(n-1).
; after patch https://reviews.llvm.org/D34337, we could save 16 bytes in the best case.
; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-BE
; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s -check-prefix=CHECK-LE

define signext i32 @bar(i32 signext %ii) {
entry:
  %0 = tail call i32 asm sideeffect "add $0, $1, $2\0A", "=r,r,r,~{f14},~{r15},~{v20}"(i32 %ii, i32 10)
  ret i32 %0
; Before the fix by patch D34337:
; stdu 1, -544(1)
; std 15, 264(1)
; stfd 14, 400(1)
; stdu 1, -560(1)
; std 15, 280(1)
; stfd 14, 416(1)

; After the fix by patch D34337:
; CHECK-LE: stdu 1, -528(1)
; CHECK-LE:std 15, 248(1)
; CHECK-LE:stfd 14, 384(1)
; CHECK-BE: stdu 1, -544(1)
; CHECK-BE:std 15, 264(1)
; CHECK-BE:stfd 14, 400(1)
}

define signext i32 @foo() {
entry:
  %call = tail call signext i32 @bar(i32 signext 5)
  ret i32 %call
}