Skip to content

Commit 2a312fc

Browse files
committed
[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.
The destinations should be FPRs (for now). Differential Revision: https://reviews.llvm.org/D66184 llvm-svn: 368775
1 parent 216944e commit 2a312fc

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

llvm/lib/Target/AArch64/AArch64RegisterBankInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
768768
LLT SrcTy = MRI.getType(MI.getOperand(MI.getNumOperands()-1).getReg());
769769
// UNMERGE into scalars from a vector should always use FPR.
770770
// Likewise if any of the uses are FP instructions.
771-
if (SrcTy.isVector() ||
771+
if (SrcTy.isVector() || SrcTy == LLT::scalar(128) ||
772772
any_of(MRI.use_instructions(MI.getOperand(0).getReg()),
773773
[&](MachineInstr &MI) { return onlyUsesFP(MI, MRI, TRI); })) {
774774
// Set the register bank of every operand to FPR.

llvm/test/CodeGen/AArch64/GlobalISel/regbankselect-unmerge-vec.mir

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,27 @@ body: |
2424
RET_ReallyLR implicit $x0
2525
2626
...
27+
---
28+
name: unmerge_s128
29+
alignment: 2
30+
legalized: true
31+
tracksRegLiveness: true
32+
frameInfo:
33+
maxCallFrameSize: 0
34+
body: |
35+
bb.0:
36+
liveins: $q0
37+
38+
; s128 should be treated as an FPR/vector because it can't live on GPR bank.
39+
; CHECK-LABEL: name: unmerge_s128
40+
; CHECK: liveins: $q0
41+
; CHECK: [[COPY:%[0-9]+]]:fpr(s128) = COPY $q0
42+
; CHECK: [[UV:%[0-9]+]]:fpr(s64), [[UV1:%[0-9]+]]:fpr(s64) = G_UNMERGE_VALUES [[COPY]](s128)
43+
; CHECK: $x0 = COPY [[UV]](s64)
44+
; CHECK: RET_ReallyLR implicit $x0
45+
%0:_(s128) = COPY $q0
46+
%1:_(s64), %2:_(s64) = G_UNMERGE_VALUES %0(s128)
47+
$x0 = COPY %1(s64)
48+
RET_ReallyLR implicit $x0
49+
50+
...

0 commit comments

Comments
 (0)