[llvm] [LoopSafety] Cache whether block is guaranteed to execute (NFC) (PR #217943)
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 21 15:02:46 PDT 2026
================
@@ -204,6 +204,14 @@ bool LoopSafetyInfo::allLoopPathsLeadToBlock(const Loop *CurLoop,
if (BB == CurLoop->getHeader())
return true;
+ auto [It, Inserted] = GuaranteedToExecute.try_emplace(BB, false);
+ if (Inserted)
+ It->second = allLoopPathsLeadToBlockImpl(CurLoop, BB, DT);
----------------
efriedma-quic wrote:
Would it make sense to rework the algorithm to walk the whole loop once?
I guess we can leave that for a followup if it's still hot.
https://github.com/llvm/llvm-project/pull/217943
More information about the llvm-commits
mailing list