This is an archive of the discontinued LLVM Phabricator instance.

Fix an assert in legalization caused by r238503
ClosedPublic

Authored by escha on May 29 2015, 10:25 AM.

Details

Summary

r238503 fixed the problem of too-small shift types by promoting them during legalization, but failed to consider the case in which the shift type is too large. On an out of tree target, the shift type is i64 (because that's the pointer type, and pre-legalization, shifts are created with shift type == pointer type). But i64 isn't legal, so it tries to extend it and crashes.

This attempts to fix the problem by only performing the zext promotion if the shift-amount type is smaller than the result type; if it's both illegal and larger, we don't want to touch it at this point.

Diff Detail

Repository
rL LLVM

Event Timeline

escha updated this revision to Diff 26793.May 29 2015, 10:25 AM
escha retitled this revision from to Fix an assert in legalization caused by 81f64c04.
escha updated this object.
escha edited the test plan for this revision. (Show Details)
escha added reviewers: resistor, majnemer.
escha set the repository for this revision to rL LLVM.
escha added a subscriber: Unknown Object (MLST).
escha retitled this revision from Fix an assert in legalization caused by 81f64c04 to Fix an assert in legalization caused by r238503.May 29 2015, 10:33 AM
escha updated this object.
escha updated this revision to Diff 26835.May 29 2015, 4:10 PM

Updated per majnemer's comments.

majnemer accepted this revision.May 29 2015, 4:14 PM
majnemer edited edge metadata.

LGTM

This revision is now accepted and ready to land.May 29 2015, 4:14 PM
escha accepted this revision.May 29 2015, 4:41 PM
escha closed this revision.
escha added a reviewer: escha.