This is an archive of the discontinued LLVM Phabricator instance.

[LICM] Avoid repeating expensive call while promoting loads. NFC
ClosedPublic

Authored by anna on Jun 23 2016, 7:03 PM.

Details

Summary

We can avoid repeating the check isGuaranteedToExecute when it's already called once while checking if the alignment can be widened for the load/store being hoisted.

The function is invariant for the same instruction UI in isGuaranteedToExecute(*UI, DT, CurLoop, SafetyInfo);

Diff Detail

Repository
rL LLVM

Event Timeline

anna updated this revision to Diff 61751.Jun 23 2016, 7:03 PM
anna retitled this revision from to [LICM] Avoid repeating expensive call while promoting loads. NFC.
anna updated this object.
anna added reviewers: hfinkel, eli.friedman.
anna set the repository for this revision to rL LLVM.
anna added a subscriber: llvm-commits.
eli.friedman accepted this revision.Jun 23 2016, 7:09 PM
eli.friedman edited edge metadata.

Nit: in an if-else if, please use braces consistently.

Otherwise LGTM.

This revision is now accepted and ready to land.Jun 23 2016, 7:09 PM
This revision was automatically updated to reflect the committed changes.