-
Notifications
You must be signed in to change notification settings - Fork 77
Wave Transform to generate SSA Exec mask manipulation instrs #789
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: amd-feature/wave-transform
Are you sure you want to change the base?
Changes from all commits
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -674,3 +674,16 @@ bool MachineRegisterInfo::isReservedRegUnit(MCRegUnit Unit) const { | |||||
| } | ||||||
| return false; | ||||||
| } | ||||||
|
|
||||||
| MachineBasicBlock::iterator MachineRegisterInfo::getDomVRegDefInBasicBlock( | ||||||
| Register Reg, MachineBasicBlock &MBB, MachineBasicBlock::iterator I) const { | ||||||
| if (I == MBB.begin()) | ||||||
|
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 code can be simplified into a while (I != MBB.begin()) { .... } loop, right? also return a pointer of MachineInstr seems more straightforward? 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. Yep. Turn it into a for/while loop and add this condition check as the loop terminator. I second that idea of returning a MachineInstr*. All the machinery of checking I != MBB.end() at the call-sites (after this function returns) can be simplified with a !MI. |
||||||
| return MBB.end(); | ||||||
| // Iterate backwards from I (exclusive) to the beginning of the basic block | ||||||
| do { | ||||||
| --I; | ||||||
| if (I->modifiesRegister(Reg, getTargetRegisterInfo())) | ||||||
|
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
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. If you looking for those instructions only that fully define |
||||||
| return I; | ||||||
| } while (I != MBB.begin()); | ||||||
| return MBB.end(); | ||||||
| } | ||||||
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 comment seems bit misleading, as the last instruction while searching backward implies the very first definition in the MBB. I think you can separate the two lines : the last instruction encountered in the MBB & you search in the backward manner from I.