-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64] Remove copy in SVE/SME predicate spill and fill #81716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c0c0609
929b111
514b9b5
264a844
53a3177
6a4502c
808ddbb
ed8519e
6a55451
a229c76
8c5b567
a64ca22
9e59c45
1a398e1
2f6d418
f06c0ce
23b051b
a53aeb4
03aabd2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,6 +143,9 @@ DecodeMatrixTileListRegisterClass(MCInst &Inst, unsigned RegMask, | |
static DecodeStatus DecodePPRRegisterClass(MCInst &Inst, unsigned RegNo, | ||
uint64_t Address, | ||
const MCDisassembler *Decoder); | ||
static DecodeStatus DecodePPRorPNRRegisterClass(MCInst &Inst, unsigned RegNo, | ||
uint64_t Addr, | ||
const MCDisassembler *Decoder); | ||
static DecodeStatus DecodePNRRegisterClass(MCInst &Inst, unsigned RegNo, | ||
uint64_t Address, | ||
const MCDisassembler *Decoder); | ||
|
@@ -741,6 +744,18 @@ static DecodeStatus DecodeMatrixTile(MCInst &Inst, unsigned RegNo, | |
return Success; | ||
} | ||
|
||
static DecodeStatus DecodePPRorPNRRegisterClass(MCInst &Inst, unsigned RegNo, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleanup suggestion for a separate patch: All these decoder classes looks rather identical, it would be nice to clean this up with something like this:
And then remove the other functions and just specify e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That sounds good to me. We can do it in a separate patch. |
||
uint64_t Addr, | ||
const MCDisassembler *Decoder) { | ||
if (RegNo > 15) | ||
return Fail; | ||
|
||
unsigned Register = | ||
AArch64MCRegisterClasses[AArch64::PPRorPNRRegClassID].getRegister(RegNo); | ||
Inst.addOperand(MCOperand::createReg(Register)); | ||
return Success; | ||
} | ||
|
||
static DecodeStatus DecodePPRRegisterClass(MCInst &Inst, unsigned RegNo, | ||
uint64_t Addr, | ||
const MCDisassembler *Decoder) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -740,7 +740,7 @@ let hasNoSchedulingInfo = 1 in { | |
//===----------------------------------------------------------------------===// | ||
|
||
class sve_int_pfalse<bits<6> opc, string asm> | ||
: I<(outs PPR8:$Pd), (ins), | ||
: I<(outs PPRorPNR8:$Pd), (ins), | ||
asm, "\t$Pd", | ||
"", | ||
[]>, Sched<[]> { | ||
|
@@ -1848,7 +1848,7 @@ multiclass sve_int_sel_vvv<string asm, SDPatternOperator op> { | |
//===----------------------------------------------------------------------===// | ||
|
||
class sve_int_pred_log<bits<4> opc, string asm> | ||
: I<(outs PPR8:$Pd), (ins PPRAny:$Pg, PPR8:$Pn, PPR8:$Pm), | ||
: I<(outs PPRorPNR8:$Pd), (ins PPRorPNRAny:$Pg, PPRorPNR8:$Pn, PPRorPNR8:$Pm), | ||
asm, "\t$Pd, $Pg/z, $Pn, $Pm", | ||
"", | ||
[]>, Sched<[]> { | ||
|
@@ -6689,7 +6689,7 @@ multiclass sve_mem_z_spill<string asm> { | |
} | ||
|
||
class sve_mem_p_spill<string asm> | ||
: I<(outs), (ins PPRAny:$Pt, GPR64sp:$Rn, simm9:$imm9), | ||
: I<(outs), (ins PPRorPNRAny:$Pt, GPR64sp:$Rn, simm9:$imm9), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This removes the need for having the following InstAliases in AArch64SVEInstrInfo.td:
Can you remove them? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
asm, "\t$Pt, [$Rn, $imm9, mul vl]", | ||
"", | ||
[]>, Sched<[]> { | ||
|
@@ -6712,7 +6712,7 @@ multiclass sve_mem_p_spill<string asm> { | |
def NAME : sve_mem_p_spill<asm>; | ||
|
||
def : InstAlias<asm # "\t$Pt, [$Rn]", | ||
(!cast<Instruction>(NAME) PPRAny:$Pt, GPR64sp:$Rn, 0), 1>; | ||
(!cast<Instruction>(NAME) PPRorPNRAny:$Pt, GPR64sp:$Rn, 0), 1>; | ||
} | ||
|
||
//===----------------------------------------------------------------------===// | ||
|
@@ -7858,7 +7858,7 @@ multiclass sve_mem_z_fill<string asm> { | |
} | ||
|
||
class sve_mem_p_fill<string asm> | ||
: I<(outs PPRAny:$Pt), (ins GPR64sp:$Rn, simm9:$imm9), | ||
: I<(outs PPRorPNRAny:$Pt), (ins GPR64sp:$Rn, simm9:$imm9), | ||
asm, "\t$Pt, [$Rn, $imm9, mul vl]", | ||
"", | ||
[]>, Sched<[]> { | ||
|
@@ -7881,7 +7881,7 @@ multiclass sve_mem_p_fill<string asm> { | |
def NAME : sve_mem_p_fill<asm>; | ||
|
||
def : InstAlias<asm # "\t$Pt, [$Rn]", | ||
(!cast<Instruction>(NAME) PPRAny:$Pt, GPR64sp:$Rn, 0), 1>; | ||
(!cast<Instruction>(NAME) PPRorPNRAny:$Pt, GPR64sp:$Rn, 0), 1>; | ||
} | ||
|
||
class sve2_mem_gldnt_vs_base<bits<5> opc, dag iops, string asm, | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -57,11 +57,11 @@ tracksRegLiveness: true | |||||
body: | | ||||||
bb.1: | ||||||
; CHECK-LABEL: name: inlineasm_virt_reg_output | ||||||
; CHECK: INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1310730 /* regdef:PPR2_with_psub_in_PNR_3b_and_PPR2_with_psub1_in_PPR_p8to15 */, def %0 | ||||||
; CHECK: INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1769482 /* regdef:GPR32common */, def %0 | ||||||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0 | ||||||
; CHECK-NEXT: $w0 = COPY [[COPY]](s32) | ||||||
; CHECK-NEXT: RET_ReallyLR implicit $w0 | ||||||
INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1310730 /* regdef:GPR32common */, def %0:gpr32common | ||||||
INLINEASM &"mov ${0:w}, 7", 0 /* attdialect */, 1769482 /* regdef:GPR32common */, def %0:gpr32common | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(same in other places) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can only use the regex in a CHECK statement, not in the IR being tested. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I didn't spot the leading In that case, I would suggest not using a regex for these numbers, because they must match the ones from the MIR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, I've changed the .mir tests to explicitly match the regclass numbers. |
||||||
%1:_(s32) = COPY %0 | ||||||
$w0 = COPY %1(s32) | ||||||
RET_ReallyLR implicit $w0 | ||||||
|
@@ -75,12 +75,12 @@ tracksRegLiveness: true | |||||
body: | | ||||||
bb.1: | ||||||
; CHECK-LABEL: name: inlineasm_virt_mixed_types | ||||||
; CHECK: INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1310730 /* regdef:PPR2_with_psub_in_PNR_3b_and_PPR2_with_psub1_in_PPR_p8to15 */, def %0, 2162698 /* regdef:WSeqPairsClass */, def %1 | ||||||
; CHECK: INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1769482 /* regdef:GPR32common */, def %0, {{[0-9]+}} /* regdef:FPR64 */, def %1 | ||||||
; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr(s32) = COPY %0 | ||||||
; CHECK-NEXT: [[COPY1:%[0-9]+]]:fpr(s64) = COPY %1 | ||||||
; CHECK-NEXT: $d0 = COPY [[COPY1]](s64) | ||||||
; CHECK-NEXT: RET_ReallyLR implicit $d0 | ||||||
INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1310730 /* regdef:GPR32common */, def %0:gpr32common, 2162698 /* regdef:FPR64 */, def %1:fpr64 | ||||||
INLINEASM &"mov $0, #0; mov $1, #0", 0 /* attdialect */, 1769482 /* regdef:GPR32common */, def %0:gpr32common, 2621450 /* regdef:FPR64 */, def %1:fpr64 | ||||||
%3:_(s32) = COPY %0 | ||||||
%4:_(s64) = COPY %1 | ||||||
$d0 = COPY %4(s64) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
addPNRasPPRRegOperands
be removed now? Or perhaps I should ask: isPNRasPPR
still required, or can those instructions that use it also usePPRorPNRRegOperand
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PPRasPNR
can be removed. Thanks for the idea.