This is an archive of the discontinued LLVM Phabricator instance.

[IndVars] LCSSA Phi users should not prevent widening
ClosedPublic

Authored by mkazantsev on Nov 17 2020, 12:28 AM.

Details

Summary

When widening an IndVar that has LCSSA Phi users outside
the loop, we can safely widen it as usual and then truncate
the result outside the loop without hurting the performance.

Diff Detail

Event Timeline

mkazantsev created this revision.Nov 17 2020, 12:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2020, 12:28 AM
mkazantsev planned changes to this revision.Nov 17 2020, 12:52 AM
skatkov accepted this revision.Nov 19 2020, 7:03 PM

lgtm

llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
1645

I doubt that someone can change the content of this set after creation :)

1648

".wide"?

mkazantsev requested review of this revision.Nov 19 2020, 8:24 PM
This revision is now accepted and ready to land.Nov 19 2020, 8:24 PM
mkazantsev added inline comments.Nov 26 2020, 12:22 AM
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
1645

Just in case if this code changes later.

mkazantsev marked an inline comment as done.

Rebased, fixed '.wide name.

This revision was automatically updated to reflect the committed changes.
yrouban added inline comments.
llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
1653

must be

Builder.SetInsertPoint(&*User->getParent()->getFirstInsertionPt());