-
Notifications
You must be signed in to change notification settings - Fork 15k
[InstCombine] Add additional known bits info for self multiply #151202
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 4 commits
4d0e990
37dfb4b
116f88a
fe3b0d4
ec4791d
8c2754a
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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -888,11 +888,27 @@ KnownBits KnownBits::mul(const KnownBits &LHS, const KnownBits &RHS, | |||||||||||||
| Res.Zero |= (~BottomKnown).getLoBits(ResultBitsKnown); | ||||||||||||||
| Res.One = BottomKnown.getLoBits(ResultBitsKnown); | ||||||||||||||
|
|
||||||||||||||
| // If we're self-multiplying then bit[1] is guaranteed to be zero. | ||||||||||||||
| if (NoUndefSelfMultiply && BitWidth > 1) { | ||||||||||||||
| assert(Res.One[1] == 0 && | ||||||||||||||
| "Self-multiplication failed Quadratic Reciprocity!"); | ||||||||||||||
| Res.Zero.setBit(1); | ||||||||||||||
| // Self multiplying | ||||||||||||||
| if (NoUndefSelfMultiply) { | ||||||||||||||
| // bit[1] is guaranteed to be zero. | ||||||||||||||
| if (BitWidth > 1) { | ||||||||||||||
| assert(Res.One[1] == 0 && | ||||||||||||||
| "Self-multiplication failed Quadratic Reciprocity!"); | ||||||||||||||
| Res.Zero.setBit(1); | ||||||||||||||
| } | ||||||||||||||
|
||||||||||||||
| // bit[1] is guaranteed to be zero. | |
| if (BitWidth > 1) { | |
| assert(Res.One[1] == 0 && | |
| "Self-multiplication failed Quadratic Reciprocity!"); | |
| Res.Zero.setBit(1); | |
| } |
It is covered by the logic below.
macsencasaus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
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 X has exactly TZ trailing zeros, then bit (2 * TZ + 2) must also be | |
| // If X has exact TZ trailing zeros, then bit (2 * TZ + 2) must also be |
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.
I don't understand the problem with the previous wording
Uh oh!
There was an error while loading. Please reload this page.