-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Remove GCNRewritePartialRegUsesImpl::getOperandRegClass #135153
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
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Jay Foad (jayfoad) ChangesFull diff: https://github.com/llvm/llvm-project/pull/135153.diff 1 Files Affected:
diff --git a/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp b/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
index c58d1b00a1002..4988eaa1a947d 100644
--- a/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNRewritePartialRegUses.cpp
@@ -105,9 +105,6 @@ class GCNRewritePartialRegUsesImpl {
/// Helper methods.
- /// Return reg class expected by a MO's parent instruction for a given MO.
- const TargetRegisterClass *getOperandRegClass(MachineOperand &MO) const;
-
/// Find right-shifted by RShift amount version of the SubReg if it exists,
/// return 0 otherwise.
unsigned shiftSubReg(unsigned SubReg, unsigned RShift) const;
@@ -404,13 +401,6 @@ void GCNRewritePartialRegUsesImpl::updateLiveIntervals(
LIS->removeInterval(OldReg);
}
-const TargetRegisterClass *
-GCNRewritePartialRegUsesImpl::getOperandRegClass(MachineOperand &MO) const {
- MachineInstr *MI = MO.getParent();
- return TII->getRegClass(TII->get(MI->getOpcode()), MI->getOperandNo(&MO), TRI,
- *MI->getParent()->getParent());
-}
-
bool GCNRewritePartialRegUsesImpl::rewriteReg(Register Reg) const {
auto Range = MRI->reg_nodbg_operands(Reg);
if (Range.empty() || any_of(Range, [](MachineOperand &MO) {
@@ -436,14 +426,6 @@ bool GCNRewritePartialRegUsesImpl::rewriteReg(Register Reg) const {
if (Inserted)
SubRegRC = TRI->getSubRegisterClass(RC, SubReg);
- if (SubRegRC) {
- if (const TargetRegisterClass *OpDescRC = getOperandRegClass(MO)) {
- LLVM_DEBUG(dbgs() << TRI->getRegClassName(SubRegRC) << " & "
- << TRI->getRegClassName(OpDescRC) << " = ");
- SubRegRC = TRI->getCommonSubClass(SubRegRC, OpDescRC);
- }
- }
-
if (!SubRegRC) {
LLVM_DEBUG(dbgs() << "couldn't find target regclass\n");
return false;
|
@@ -436,14 +426,6 @@ bool GCNRewritePartialRegUsesImpl::rewriteReg(Register Reg) const { | |||
if (Inserted) | |||
SubRegRC = TRI->getSubRegisterClass(RC, SubReg); | |||
|
|||
if (SubRegRC) { | |||
if (const TargetRegisterClass *OpDescRC = getOperandRegClass(MO)) { |
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.
I can't find any test case where this is needed. If getSubRegisterClass returns an exact match (i.e. not a superclass of what you ask for) then I guess it doesn't need to be constrained any more than the original RC was.
SubRegRC = TRI->getCommonSubClass(SubRegRC, OpDescRC); | ||
} | ||
} | ||
|
||
if (!SubRegRC) { |
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.
I suspect this can be an assert now.
Superseded by #135199. |
No description provided.