[PATCH] D93906: [LoopDeletion] Break backedge of loops when known not taken
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 3 14:47:51 PST 2021
reames added a comment.
In D93906#2476680 <https://reviews.llvm.org/D93906#2476680>, @nikic wrote:
> Isn't this already covered by the zero exit count optimization in IndVars?
No. I believe you're referring to optimizeLoopExits. That does not modify the CFG, it just folds conditions to constants. This will specifically modify the CFG and remove the loop.
================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:774
+
+ std::unique_ptr<MemorySSAUpdater> MSSAU;
+ if (MSSA)
----------------
fhahn wrote:
> I realize this is similar to what is done in `deleteDeadLoop`, but MSSA is only passed so it can be kept up-to-date, right? Can we just pass a pointer to the updater instead (making the intended use more explicit and avoids a dynamic allocation here)
Not quite sure I follow your request here. I'm happy to address this in a separate cleanup (if you clarify what you're looking for), but I'm going to land as is since the same pattern is already used in existing code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93906/new/
https://reviews.llvm.org/D93906
More information about the llvm-commits
mailing list