-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[InlineAsm] refactor InlineAsm class NFC #65649
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
I would like to steal one of these bits to denote whether a kind may be spilled by the register allocator or not, but I'm afraid to touch of any this code using bitwise operands. Make flags a first class type using bitfields, rather than launder data around via `unsigned`.
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.
Please run git clang-format
on this change.
@@ -241,6 +225,7 @@ class InlineAsm final : public Value { | |||
// Addresses are included here as they need to be treated the same by the | |||
// backend, the only difference is that they are not used to actaully | |||
// access memory by the instruction. | |||
// TODO: convert to enum? |
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.
+1.
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.
If it's ok with you, I'd prefer to do this in a distinct PR, akin to:
commit 2fad6e6 ("[InlineAsm] wrap Kind in enum class NFC")
oh yeah! done. Huh, I miss |
Ok, thanks all for the reviews+comments+feedback thus far. I think I've addressed everything; this should be ready for another round of reviews. |
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.
Nice clean-up!
Thanks.
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.
Just a sidenote: multiple overlapping Bitfield::Element could be used for "Data", if desired. I don't think it matters here, so approving as is. But, it would be useful if we wanted to add additional fields for only some of the options later (e.g. Mem Constraint code doesn't need as many bits as it's given, so other data could fit next to it in that case).
Oh right, good idea. Ok, I will clean that up too in follow up PRs. |
This change appears to have broken the MLIR Windows buildbot (and probably some other Windows bots).
|
@NathanielMcVicar thanks for the report. Should be fixed as of |
Appears to be fixed (now there's another break, but much later)! Thanks so much for the quick resolution. |
Similar to commit 2fad6e6 ("[InlineAsm] wrap Kind in enum class NFC") Fix the TODOs added in commit 93bd428 ("[InlineAsm] refactor InlineAsm class NFC (llvm#65649)")
Use multiple Bitfield::Element's to provide more meaningful access to the same slice of bits. "Data" used in different contexts is confusing. Try to be as clear as possible, and in that vein, update the comment block for this class, too. This was suggested by @bwendling in llvm#65649 (comment) and @jyknight in llvm#65649 (review)
…#66297) Use multiple Bitfield::Element's to provide more meaningful access to the same slice of bits. "Data" used in different contexts is confusing. Try to be as clear as possible, and in that vein, update the comment block for this class, too. This was suggested by @bwendling in #65649 (comment) and @jyknight in #65649 (review)
I would like to steal one of these bits to denote whether a kind may be spilled by the register allocator or not, but I'm afraid to touch of any this code using bitwise operands. Make flags a first class type using bitfields, rather than launder data around via `unsigned`.
Similar to commit 2fad6e6 ("[InlineAsm] wrap Kind in enum class NFC") Fix the TODOs added in commit 93bd428 ("[InlineAsm] refactor InlineAsm class NFC (llvm#65649)")
…llvm#66297) Use multiple Bitfield::Element's to provide more meaningful access to the same slice of bits. "Data" used in different contexts is confusing. Try to be as clear as possible, and in that vein, update the comment block for this class, too. This was suggested by @bwendling in llvm#65649 (comment) and @jyknight in llvm#65649 (review)
I would like to steal one of these bits to denote whether a kind may be
spilled by the register allocator or not, but I'm afraid to touch of any
this code using bitwise operands.
Make flags a first class type using bitfields, rather than launder data
around via
unsigned
.