This is an archive of the discontinued LLVM Phabricator instance.

Push isDereferenceableAndAlignedPointer down into isSafeToLoadUnconditionally
ClosedPublic

Authored by apilipenko on Jan 15 2016, 8:34 AM.

Details

Summary

Separated from D10920.

isSafeToLoadUnconditionally must take alignment into account. There are tests which check this behavior. That's why isDereferenceableAndAlignedPointer must be used instead of isDereferenceablePointer.

As a side effect optimizations which use isSafeToLoadUnconditionally will benefit from dereferenceable attribute. Corresponding test cases added.

Diff Detail

Repository
rL LLVM

Event Timeline

apilipenko updated this revision to Diff 44993.Jan 15 2016, 8:34 AM
apilipenko retitled this revision from to Push isDereferenceableAndAlignedPointer down into isSafeToLoadUnconditionally.
apilipenko updated this object.
apilipenko added reviewers: hfinkel, reames.
apilipenko added a subscriber: llvm-commits.
apilipenko updated this revision to Diff 44999.Jan 15 2016, 9:02 AM
reames accepted this revision.Jan 15 2016, 5:52 PM
reames edited edge metadata.

LGTM w/requested test.

test/Transforms/InstCombine/select.ll
1311 ↗(On Diff #44999)

Please add a test case that shows a argument which is not sufficiently dereferenceable. AKA, a negative test.

This revision is now accepted and ready to land.Jan 15 2016, 5:52 PM
This revision was automatically updated to reflect the committed changes.