-
Notifications
You must be signed in to change notification settings - Fork 14.3k
AMDGPU: Fix tracking subreg defs when folding through reg_sequence #140608
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
AMDGPU: Fix tracking subreg defs when folding through reg_sequence #140608
Conversation
@llvm/pr-subscribers-backend-amdgpu Author: Matt Arsenault (arsenm) ChangesWe weren't fully respecting the type of a def of an immediate vs. Fixes #139317 Patch is 34.59 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/140608.diff 4 Files Affected:
|
4021541
to
ad698bf
Compare
045021f
to
4ec9c56
Compare
ping |
ad698bf
to
8a6cb7b
Compare
4ec9c56
to
6e7ab22
Compare
8a6cb7b
to
999939f
Compare
6e7ab22
to
1a8e2fb
Compare
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.
The idea seems good. I haven't reviewed it all in detail.
999939f
to
6deba1d
Compare
83141b8
to
686562f
Compare
ping |
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.
ping
ping |
686562f
to
7aab391
Compare
ping |
ping |
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.
LGTM. I suspect the idea of separating the functional changes from refactoring was there at some point, but maybe just too late. :)
FoldCandidate(MachineInstr *MI, unsigned OpNo, FoldableDef Def, | ||
bool Commuted_ = false, int ShrinkOp = -1) | ||
: UseMI(MI), Def(Def), ShrinkOpcode(ShrinkOp), UseOpNo(OpNo), | ||
Commuted(Commuted_) {} |
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.
nit: Rename Commuted_
to Commuted
while here?
: UseMI(MI), Def(Def), ShrinkOpcode(ShrinkOp), UseOpNo(OpNo), | ||
Commuted(Commuted_) {} | ||
|
||
bool isFI() const { return Def.Kind == MachineOperand::MO_FrameIndex; } |
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.
bool isFI() const { return Def.Kind == MachineOperand::MO_FrameIndex; } | |
bool isFI() const { return Def.isFI(); } |
7aab391
to
00ac742
Compare
We weren't fully respecting the type of a def of an immediate vs. the type at the use point. Refactor the folding logic to track the value to fold, as well as a subregister to apply to the underlying value. This is similar to how PeepholeOpt tracks subregisters (though only for pure copy-like instructions, no constants). Fixes #139317
00ac742
to
b7db917
Compare
…lvm#140608) We weren't fully respecting the type of a def of an immediate vs. the type at the use point. Refactor the folding logic to track the value to fold, as well as a subregister to apply to the underlying value. This is similar to how PeepholeOpt tracks subregisters (though only for pure copy-like instructions, no constants). Fixes llvm#139317
We weren't fully respecting the type of a def of an immediate vs.
the type at the use point. Refactor the folding logic to track the
value to fold, as well as a subregister to apply to the underlying
value. This is similar to how PeepholeOpt tracks subregisters (though
only for pure copy-like instructions, no constants).
Fixes #139317