[PATCH] D118918: [nfc][regalloc] const LiveIntervals within the allocator

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 3 09:54:18 PST 2022


MatzeB accepted this revision.
MatzeB added a comment.
This revision is now accepted and ready to land.

It's a lot of code churn. But I agree that it's a good thing to be explicit and add a `const` here. Thanks, LGTM.



================
Comment at: llvm/lib/CodeGen/SplitKit.h:349-366
   /// Find a subrange corresponding to the exact lane mask @p LM in the live
   /// interval @p LI. The interval @p LI is assumed to contain such a subrange.
   /// This function is used to find corresponding subranges between the
   /// original interval and the new intervals.
-  LiveInterval::SubRange &getSubRangeForMaskExact(LaneBitmask LM,
-                                                  LiveInterval &LI);
+  static const LiveInterval::SubRange &
+  getSubRangeForMaskExact(LaneBitmask LM, const LiveInterval &LI);
+
----------------
May just as well make them simple static helper functions in `SplitKit.cpp` no other files appear to use them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118918/new/

https://reviews.llvm.org/D118918



More information about the llvm-commits mailing list