1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
llvm-mirror/test/CodeGen/SystemZ/cond-move-04.mir
Jonas Paulsson 1b514619dd [RegAlloc, SystemZ] Increase number of LOCRs by passing "hard" regalloc hints.
* The method getRegAllocationHints() is now of bool type instead of void. If
true is returned, regalloc (AllocationOrder) will *only* try to allocate the
hints, as opposed to merely trying them before non-hinted registers.

* TargetRegisterInfo::getRegAllocationHints() is implemented for SystemZ with
an increase in number of LOCRs.

In this case, it is desired to force the hints even though there is a slight
increase in spilling, because if a non-hinted register would be allocated,
the LOCRMux pseudo would have to be expanded with a jump sequence. The LOCR
(Load On Condition) SystemZ instruction must have both operands in either the
low or high part of the 64 bit register.

Reviewers: Quentin Colombet and Ulrich Weigand
https://reviews.llvm.org/D36795

llvm-svn: 317879
2017-11-10 08:46:26 +00:00

76 lines
1.9 KiB
YAML

# RUN: llc -mtriple=s390x-linux-gnu -mcpu=z13 -start-before=greedy %s -o - \
# RUN: | FileCheck %s
#
# Test that regalloc manages (via regalloc hints) to avoid a LOCRMux jump
# sequence expansion.
--- |
declare i8* @foo(i8*, i32 signext, i32 signext) local_unnamed_addr
define i8* @fun(i8* returned) {
br label %2
; <label>:2: ; preds = %6, %1
%3 = zext i16 undef to i32
switch i32 %3, label %4 [
i32 15, label %6
i32 125, label %5
]
; <label>:4: ; preds = %2
br label %6
; <label>:5: ; preds = %2
br label %6
; <label>:6: ; preds = %5, %4, %2
%7 = phi i32 [ 4, %2 ], [ undef, %4 ], [ 10, %5 ]
%8 = call i8* @foo(i8* undef, i32 signext undef, i32 signext %7)
br label %2
}
...
# CHECK: locr
# CHECK-NOT: risblg
---
name: fun
alignment: 2
tracksRegLiveness: true
registers:
- { id: 0, class: gr32bit }
- { id: 1, class: gr64bit }
- { id: 2, class: grx32bit }
- { id: 3, class: grx32bit }
- { id: 4, class: grx32bit }
- { id: 5, class: grx32bit }
- { id: 6, class: grx32bit }
- { id: 7, class: gr64bit }
- { id: 8, class: gr64bit }
- { id: 9, class: gr64bit }
- { id: 10, class: gr64bit }
- { id: 11, class: gr32bit }
frameInfo:
hasCalls: true
body: |
bb.0 (%ir-block.1):
%3 = LHIMux 0
%2 = LHIMux 4
%5 = LHIMux 10
bb.1 (%ir-block.2):
CHIMux %3, 0, implicit-def %cc
%0 = LOCRMux undef %0, %5, 14, 6, implicit %cc
%0 = LOCRMux %0, %2, 14, 6, implicit killed %cc
ADJCALLSTACKDOWN 0, 0
%7 = LGFR %0
%r3d = LGHI 0
%r4d = COPY %7
CallBRASL @foo, undef %r2d, killed %r3d, killed %r4d, csr_systemz, implicit-def dead %r14d, implicit-def dead %cc, implicit-def dead %r2d
ADJCALLSTACKUP 0, 0
J %bb.1
...