-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[ARM][MVE] Invalid tail predication in LowOverheadLoop pass #163217
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
base: main
Are you sure you want to change the base?
Changes from all commits
f050ab5
7dc18e7
477af29
0dc637a
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 |
---|---|---|
|
@@ -805,6 +805,19 @@ int llvm::findFirstVPTPredOperandIdx(const MachineInstr &MI) { | |
return -1; | ||
} | ||
|
||
int llvm::findVPTInactiveOperandIdx(const MachineInstr &MI) { | ||
const MCInstrDesc &MCID = MI.getDesc(); | ||
|
||
for (unsigned i = 0, e = MCID.getNumOperands(); i != e; ++i) | ||
if (MCID.operands()[i].OperandType == ARM::OPERAND_VPRED_R) { | ||
assert(MCID.getOperandConstraint(i + 3, MCOI::TIED_TO) != -1 && | ||
"Operand #3 of VPRED_R is the one tied to the output register"); | ||
return i + 3; | ||
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. Can we use a named constant for this magic '3'? 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. There's no existing set of constant definitions I know of at the moment which tells you what sub-operands a The number of them changed in 9cb8f4d, adding a new one just before the tied operand I'm referring to here – before that commit my function here would have had to return I could imagine making Tablegen write out some constants of this kind into a header file. The definition of On the theory that the main aim of removing magic numbers is to make sure everything is updated correctly when (if) the right number changes, I can add an assert here, which checks that operand 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. Okay, cheers, this seems good enough to me. |
||
} | ||
|
||
return -1; | ||
} | ||
|
||
ARMVCC::VPTCodes llvm::getVPTInstrPredicate(const MachineInstr &MI, | ||
Register &PredReg) { | ||
int PIdx = findFirstVPTPredOperandIdx(MI); | ||
|
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.
So, can we now completely remove VMOVCopies?
(And, not to be part of this patch, but I wonder if the MQPRCopy instruction could also be removed.)