Page MenuHomePhabricator

[ValueTracking] Check that alignment is non-zero in computeKnownBitsFromAssume (PR48713).
Needs ReviewPublic

Authored by rmansfield on Jan 11 2021, 10:36 AM.


Diff Detail

Event Timeline

rmansfield created this revision.Jan 11 2021, 10:36 AM
rmansfield requested review of this revision.Jan 11 2021, 10:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2021, 10:36 AM

Adding more potential reviewers based on D88669 (where this code was added).

Updated diff with context

No doubt there is a problem here somewhere, not sure if this is the best fix though or just hides it one level deeper.

I wonder if align(0) in the input is not already broken.
I'm trying to see if the Clang ppl are interested in changing the behavior that I think is at fault here:
When we warn, we should not create the alignment assumption because in IR things depend on the fact that it is a power of two.

If we modify clang we should teach the verifier about the test case above and introduce an assertion isPowerOfTwo(RK.ArgValue).