[llvm] [MachineOutliner] Preserve regmasks in calls to outlined functions (PR #120940)

Zhaoxuan Jiang via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 16:58:40 PST 2024


================
@@ -1130,6 +1131,12 @@ bool MachineOutliner::outline(
           MachineInstr *MI = &*Iter;
           SmallSet<Register, 2> InstrUseRegs;
           for (MachineOperand &MOP : MI->operands()) {
+            // Collect all regmasks. Merge them in the end.
+            if (MOP.isRegMask()) {
----------------
nocchijiang wrote:

I believe 1-regmask is the most common case and the memory allocation in `MF->allocateRegMask()` should be avoided if possible.

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


More information about the llvm-commits mailing list