1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/CodeGen/PowerPC/schedule-addi-load.mir
Guillaume Chatelet d49cb60862 [Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67433

llvm-svn: 371608
2019-09-11 11:16:48 +00:00

124 lines
4.4 KiB
YAML

# RUN: llc -mcpu=pwr9 -mtriple powerpc64le-unknown-linux-gnu -start-before machine-scheduler -stop-after machine-scheduler -verify-machineinstrs %s -o - | FileCheck %s
# RUN: llc -mcpu=pwr9 -mtriple powerpc64le-unknown-linux-gnu -disable-ppc-sched-addi-load -start-before machine-scheduler -stop-after machine-scheduler \
# RUN: -verify-machineinstrs %s -o - | FileCheck --check-prefix=CHECK-DISABLE %s
# RUN: llc -mcpu=pwr8 -mtriple powerpc64le-unknown-linux-gnu -start-before machine-scheduler -stop-after machine-scheduler -verify-machineinstrs %s -o - | FileCheck --check-prefix=CHECK-P8 %s
# Test that if the scheduler moves the addi before the load.
--- |
target datalayout = "e-m:e-i64:64-n32:64"
define i64 @foo(i8* %p, i8* %q) {
entry:
br label %while.cond6.i
while.cond6.i:
%n.0 = phi i64 [ 0, %entry ], [ %n.1, %while.cond6.i ]
%conv = and i64 %n.0, 4294967295
%arrayidx = getelementptr inbounds i8, i8* %p, i64 %conv
%0 = load i8, i8* %arrayidx, align 1
%arrayidx4 = getelementptr inbounds i8, i8* %q, i64 %conv
%1 = load i8, i8* %arrayidx4, align 1
%cmp = icmp eq i8 %0, %1
%n.1 = add i64 %conv, 1
br i1 %cmp, label %while.cond6.i, label %while.end
while.end:
ret i64 %n.0
}
...
---
name: foo
alignment: 16
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers:
- { id: 0, class: g8rc, preferred-register: '' }
- { id: 1, class: g8rc, preferred-register: '' }
- { id: 2, class: g8rc_and_g8rc_nox0, preferred-register: '' }
- { id: 3, class: g8rc_and_g8rc_nox0, preferred-register: '' }
- { id: 4, class: g8rc, preferred-register: '' }
- { id: 5, class: g8rc_and_g8rc_nox0, preferred-register: '' }
- { id: 6, class: gprc, preferred-register: '' }
- { id: 7, class: gprc, preferred-register: '' }
- { id: 8, class: crrc, preferred-register: '' }
- { id: 9, class: g8rc, preferred-register: '' }
liveins:
- { reg: '$x3', virtual-reg: '%2' }
- { reg: '$x4', virtual-reg: '%3' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 4294967295
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
constants: []
machineFunctionInfo: {}
body: |
bb.0.entry:
successors: %bb.1(0x80000000)
liveins: $x3, $x4
%3:g8rc_and_g8rc_nox0 = COPY $x4
%2:g8rc_and_g8rc_nox0 = COPY $x3
%9:g8rc = LI8 0
bb.1.while.cond6.i:
successors: %bb.1(0x7c000000), %bb.2(0x04000000)
%0:g8rc = COPY %9
%5:g8rc_and_g8rc_nox0 = RLDICL %0, 0, 32
%6:gprc = LBZX %2, %5 :: (load 1 from %ir.arrayidx)
%7:gprc = LBZX %3, %5 :: (load 1 from %ir.arrayidx4)
%9:g8rc = ADDI8 %5, 1
%8:crrc = CMPLW %6, %7
BCC 76, %8, %bb.1
B %bb.2
; CHECK-LABEL: foo
; CHECK: %5:g8rc_and_g8rc_nox0 = RLDICL %0, 0, 32
; CHECK-NEXT: %9:g8rc = ADDI8 %5, 1
; CHECK-NEXT: %6:gprc = LBZX %2, %5 :: (load 1 from %ir.arrayidx)
; CHECK-NEXT: %7:gprc = LBZX %3, %5 :: (load 1 from %ir.arrayidx4)
; CHECK-NEXT: %8:crrc = CMPLW %6, %7
; CHECK-NEXT: BCC 76, %8
; CHECK-DISABLE-LABEL: foo
; CHECK-DISABLE: %5:g8rc_and_g8rc_nox0 = RLDICL %0, 0, 32
; CHECK-DISABLE-NEXT: %6:gprc = LBZX %2, %5 :: (load 1 from %ir.arrayidx)
; CHECK-DISABLE-NEXT: %7:gprc = LBZX %3, %5 :: (load 1 from %ir.arrayidx4)
; CHECK-DISABLE-NEXT: %9:g8rc = ADDI8 %5, 1
; CHECK-DISABLE-NEXT: %8:crrc = CMPLW %6, %7
; CHECK-DISABLE-NEXT: BCC 76, %8
; CHECK-P8-LABEL: foo
; CHECK-P8: %5:g8rc_and_g8rc_nox0 = RLDICL %0, 0, 32
; CHECK-P8-NEXT: %6:gprc = LBZX %2, %5 :: (load 1 from %ir.arrayidx)
; CHECK-P8-NEXT: %7:gprc = LBZX %3, %5 :: (load 1 from %ir.arrayidx4)
; CHECK-P8-NEXT: %8:crrc = CMPLW %6, %7
; CHECK-P8-NEXT: %9:g8rc = ADDI8 %5, 1
; CHECK-P8-NEXT: BCC 76, %8
bb.2.while.end:
$x3 = COPY %0
BLR8 implicit $lr8, implicit $rm, implicit $x3
...