[llvm] [TableGen] Allow targets to enforce regunits assignment as intervals (PR #175823)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 03:04:42 PST 2026


================
@@ -511,6 +514,19 @@ class LLVM_ABI MCRegisterInfo {
 
   /// Returns true if the two registers are equal or alias each other.
   bool regsOverlap(MCRegister RegA, MCRegister RegB) const;
+
+  /// Returns true if this target uses regunit intervals.
+  bool hasRegUnitIntervals() const { return RegUnitIntervals != nullptr; }
+
+  /// Returns an iterator range over all native regunits in the RegUnitInterval
+  /// table for \p Reg.
+  iota_range<unsigned> regunits_interval(MCRegister Reg) const {
----------------
jayfoad wrote:

Should return a range of `MCRegUnit` instead of `unsigned`? Implicit conversions between the two were removed by @s-barannikov's #167943.

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


More information about the llvm-commits mailing list