File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
test/CodeGen/AArch64/GlobalISel Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -719,10 +719,15 @@ AArch64RegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
719
719
break ;
720
720
OpRegBankIdx = {PMI_FirstGPR, PMI_FirstFPR};
721
721
break ;
722
- case TargetOpcode::G_FCMP:
723
- OpRegBankIdx = {PMI_FirstGPR,
722
+ case TargetOpcode::G_FCMP: {
723
+ // If the result is a vector, it must use a FPR.
724
+ AArch64GenRegisterBankInfo::PartialMappingIdx Idx0 =
725
+ MRI.getType (MI.getOperand (0 ).getReg ()).isVector () ? PMI_FirstFPR
726
+ : PMI_FirstGPR;
727
+ OpRegBankIdx = {Idx0,
724
728
/* Predicate */ PMI_None, PMI_FirstFPR, PMI_FirstFPR};
725
729
break ;
730
+ }
726
731
case TargetOpcode::G_BITCAST:
727
732
// This is going to be a cross register bank copy and this is expensive.
728
733
if (OpRegBankIdx[0 ] != OpRegBankIdx[1 ])
Original file line number Diff line number Diff line change
1
+ # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2
+ # RUN: llc -mtriple=aarch64 -run-pass=regbankselect -verify-machineinstrs %s -o - | FileCheck %s
3
+
4
+ ...
5
+ ---
6
+ name : vector
7
+ legalized : true
8
+ tracksRegLiveness : true
9
+ body : |
10
+ bb.0:
11
+ liveins: $q0, $q1
12
+ ; Vectors should always end up on a FPR.
13
+
14
+ ; CHECK-LABEL: name: vector
15
+ ; CHECK: liveins: $q0, $q1
16
+ ; CHECK: %x:fpr(<2 x s64>) = COPY $q0
17
+ ; CHECK: %y:fpr(<2 x s64>) = COPY $q1
18
+ ; CHECK: %fcmp:fpr(<2 x s64>) = G_FCMP floatpred(olt), %x(<2 x s64>), %y
19
+ ; CHECK: $q0 = COPY %fcmp(<2 x s64>)
20
+ ; CHECK: RET_ReallyLR implicit $q0
21
+ %x:_(<2 x s64>) = COPY $q0
22
+ %y:_(<2 x s64>) = COPY $q1
23
+ %fcmp:_(<2 x s64>) = G_FCMP floatpred(olt), %x:_(<2 x s64>), %y:_
24
+ $q0 = COPY %fcmp
25
+ RET_ReallyLR implicit $q0
26
+ ...
You can’t perform that action at this time.
0 commit comments