Page MenuHomePhabricator

[GlobalISel][KnownBits] Early return on out of bound shift amounts

Authored by kschwarz on Oct 12 2020, 4:22 AM.



If the known shift amount is bigger than or equal to the bitwidth of the type of the value to be shifted,
the result is target dependent, so don't try to infer any bits.

This fixes a crash we've seen in one of our internal test suites.

Diff Detail

Unit TestsFailed

4,160 mswindows > Clang-Unit.DirectoryWatcher/_/DirectoryWatcherTests_exe::DirectoryWatcherTest.AddFiles
Note: Google Test filter = DirectoryWatcherTest.AddFiles [==========] Running 1 test from 1 test case.
3,950 mswindows > Clang-Unit.DirectoryWatcher/_/DirectoryWatcherTests_exe::DirectoryWatcherTest.DeleteFile
Note: Google Test filter = DirectoryWatcherTest.DeleteFile [==========] Running 1 test from 1 test case.

Event Timeline

kschwarz created this revision.Oct 12 2020, 4:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2020, 4:22 AM
kschwarz requested review of this revision.Oct 12 2020, 4:22 AM
arsenm added inline comments.Oct 12 2020, 7:51 AM

getScalarSizeInBits. This should also be >=


Also add and equal sized case

kschwarz updated this revision to Diff 297603.Oct 12 2020, 8:39 AM
kschwarz edited the summary of this revision. (Show Details)

Address review comments

arsenm accepted this revision.Oct 12 2020, 8:58 AM
This revision is now accepted and ready to land.Oct 12 2020, 8:58 AM
This revision was landed with ongoing or failed builds.Oct 12 2020, 9:39 AM
This revision was automatically updated to reflect the committed changes.