[llvm] [LoopInterchange] Don't consider loops with BTC=0 (PR #167113)

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 03:16:11 PST 2025


================
@@ -602,14 +606,17 @@ struct LoopInterchange {
   DependenceInfo *DI = nullptr;
   DominatorTree *DT = nullptr;
   LoopStandardAnalysisResults *AR = nullptr;
-
   /// Interface to emit optimization remarks.
   OptimizationRemarkEmitter *ORE;
+  // A cache to avoid recalculating the backedge-taken count for a loop.
+  std::map<const Loop *, const SCEV *> LoopBTC;
----------------
sjoerdmeijer wrote:

Thanks for the info! I am completely getting rid of my own little caching mechanism here as per @kasuga-fj's remarks; I will let SCEV do the caching. 

https://github.com/llvm/llvm-project/pull/167113


More information about the llvm-commits mailing list