[llvm] [ARM] Fix failure to register-allocate CMP_SWAP_64 pseudo-inst (PR #104039)

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 02:49:35 PDT 2024


================
@@ -1368,6 +1371,40 @@ void RegAllocFastImpl::findAndSortDefOperandIndexes(const MachineInstr &MI) {
   });
 }
 
+/// Compute \ref UseOperandIndexes so it contains the indices of "use" operands
+/// that are to be allocated. Those are ordered in a way that high-priority
+/// classes are allocated first.
+void RegAllocFastImpl::findAndSortUseOperandIndexes(const MachineInstr &MI) {
----------------
ostannard wrote:

I agree that it would be better for consistency, I'll add that code back in.

However, I think we still need to use `AllocationPriority` to fix #98222, because the class sizes heuristic cannot spot that two register classes contain overlapping (but not identical) registers. There's a FIXME comment in `addRegClassDefCounts` to take that into account, but I don't think that `TargetRegisterInfo` contains the information we'd need for that.

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


More information about the llvm-commits mailing list