-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[DAG] Add freeze(assertext(x)) -> assertext(x) folds #94491
base: main
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 | ||
---|---|---|---|---|
|
@@ -57,7 +57,10 @@ enum NodeType { | |||
/// been extended, and the second is a value type node indicating the width | ||||
/// of the extension. | ||||
/// NOTE: In case of the source value (or any vector element value) is | ||||
/// poisoned the assertion will not be true for that value. | ||||
/// poisoned the assertion will not be true for that value and the | ||||
/// corresponding result value will be poison. If a source value isn't | ||||
/// satisfying the condition being asserted (while not being poison), then | ||||
/// this is considered as immediate undefined behavior. | ||||
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 want to say that violating the assertion triggers IUB we also need to audit existing uses to comply with that. One obvious case that doesn't is fptoi legalization:
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. I thought that the fptoi legalization fulfilled this patch. That either the fptoi result is poison (and then it is still poison after the assert), or the result of fptoi would satisfy the assert. This patch is at least not breaking the regression tests related to #66603 . But maybe this whole idea isn't working anyway. Not sure how to protect from further simplifications of the code leading up to the assert, that could make it less poisonous. It would for example not be legal to just freeze the FP_TO_SINT introduced by legalization, without making sure that the frozen value fulfil the later assert. Now I'm just back into the mega-confused-state. And I can't really see how we possibly can handle the (freeze(assertext)) kind of regressions seen in #84924 . Maybe if we try to move the freeze in the other direction when there is an assert (or at least avoid moving it as aggressively in that direction when it might block optimizations. |
||||
AssertSext, | ||||
AssertZext, | ||||
|
||||
|
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.
Can you update the globalisel equivalent documentation to match whatever ends up here for G_ASSERT_SEXT/G_ASSERT_ZEXT?