[llvm] [MachineLICM] Allow hoisting loads from invariant address (PR #70796)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 06:13:05 PST 2023


================
@@ -772,6 +779,32 @@ void MachineLICMBase::HoistOutOfLoop(MachineDomTreeNode *HeaderN,
   BackTrace.clear();
   InitRegPressure(Preheader);
 
+  // Compute information about whether it is allowed to move load instruction
+  // out of the current loop or one of the inner loops
+  SmallDenseMap<MachineLoop *, bool> AllowedToHoistLoads;
----------------
david-arm wrote:

If you made this map a member variable of `MachineLICMBase` then you can probably avoid all the function interface changes and just query this map in IsLICMCandidate. What do you think?

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


More information about the llvm-commits mailing list