-
Notifications
You must be signed in to change notification settings - Fork 353
[InstCombine] Don't sink if it would require dropping deref assumptio… #11828
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: swift/release/6.3
Are you sure you want to change the base?
Conversation
|
@swift-ci please test |
358a805 to
05b2e8c
Compare
|
@swift-ci please test |
|
@swift-ci please test llvm |
| // Do not sink if there are dereferenceable assumes that would be | ||
| // removed. | ||
| auto II = dyn_cast<IntrinsicInst>(User); | ||
| if (II->getIntrinsicID() != Intrinsic::assume || |
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.
dyn_cast must always have a nullptr check
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.
yeah done. (I think currently the only droppable uses appear to be intrinsics)
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.
or you could do just cast<> if you think that’s better. I’m happy either way.
jroelofs
left a comment
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 with a check on the dyn_cast's result.
…ns. (llvm#166945) Currently sinking assumes in instcombine drops assumes if they would prevent sinking. Removing dereferenceable assumptions earlier on can inhibit vectorization of early-exit loops in practice. Special-case deferenceable assumptions so that they block sinking. This can be combined with a separate change to drop dereferencebale assumptions after vectorization: https://clang.godbolt.org/z/jGqcx3sbs PR: llvm#166945 (cherry picked from commit 700b77b)
05b2e8c to
1c40539
Compare
|
@swift-ci please test |
…ns. (llvm#166945)
Currently sinking assumes in instcombine drops assumes if they would prevent sinking. Removing dereferenceable assumptions earlier on can inhibit vectorization of early-exit loops in practice.
Special-case deferenceable assumptions so that they block sinking. This can be combined with a separate change to drop dereferencebale assumptions after vectorization: https://clang.godbolt.org/z/jGqcx3sbs
PR: llvm#166945
(cherry picked from commit 700b77b)