-
Notifications
You must be signed in to change notification settings - Fork 15k
[CodeGen] Ensure clearRegisterKills clears inside bundles. #149177
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
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 |
---|---|---|
|
@@ -880,9 +880,9 @@ class MachineInstr | |
/// queries but they are bundle aware. | ||
|
||
enum QueryType { | ||
IgnoreBundle, // Ignore bundles | ||
AnyInBundle, // Return true if any instruction in bundle has property | ||
AllInBundle // Return true if all instructions in bundle have property | ||
IgnoreBundle, // Ignore bundles | ||
AnyInBundle, // Check/update property for any instruction in bundle | ||
AllInBundle // Check/update property for all instructions in bundle | ||
}; | ||
|
||
/// Return true if the instruction (or in the case of a bundle, | ||
|
@@ -1700,7 +1700,8 @@ class MachineInstr | |
/// Clear all kill flags affecting Reg. If RegInfo is provided, this includes | ||
/// all aliasing registers. | ||
LLVM_ABI void clearRegisterKills(Register Reg, | ||
const TargetRegisterInfo *RegInfo); | ||
const TargetRegisterInfo *RegInfo, | ||
QueryType Type = AllInBundle); | ||
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. @arsenm For now I've reused the pre-existing QueryType. If you think it would be better to define a separate type for updates, please let me know. 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. Should the default be IgnoreBundle to match the previous behaviour? (And maybe that would help for compile-time, I'm not sure how much it makes a difference) 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 we go that route, would we then override the default in I'm happy with that as it solves the direct issue in #149092, but I would assume that not clearing kills in bundles could be an issue elsewhere. 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 the code calling clearRegisterKills already iterates over all instructions they might be fine already. It's hard to tell from the code which is which, but I think the Arm uses are probably OK (there are many more bundles used there, they are rarer on AArch64 before movprfx). 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. Sounds good, thanks for the suggestion. I'll open a separate PR to iterate through all instructions in AArch64LoadStoreOptimizer instead. |
||
|
||
/// We have determined MI defined a register without a use. | ||
/// Look for the operand that defines it and mark it as IsDead. If | ||
|
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.
These formatting changes were made to avoid code formatter errors.