[llvm] CodeGen: Eliminate dynamic relocations in the register superclass tables. (PR #119122)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 8 08:56:20 PST 2024


================
@@ -42,11 +42,27 @@ class VirtRegMap;
 class LiveIntervals;
 class LiveInterval;
 
+/// TargetSuperClassIterator enumerates all super-registers of RegClass.
+class TargetSuperClassIterator
+    : public iterator_adaptor_base<TargetSuperClassIterator, const unsigned *> {
+public:
+  /// Constructs an end iterator.
+  TargetSuperClassIterator() = default;
+
+  TargetSuperClassIterator(const unsigned *V) { I = V; }
+
+  const unsigned &operator*() const { return *I; }
----------------
resistor wrote:

That's not an obstacle. The bigger problem is that you need a TargetRegisterInfo to do the mapping from IDs back to TargetRegisterClass's, which we can't easily get from inside the iterator.

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


More information about the llvm-commits mailing list