[llvm] [MachineInstr] add insert method for variadic instructions (PR #67699)

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 27 16:04:37 PDT 2023


================
@@ -2475,3 +2475,45 @@ MachineInstr::getFirst5RegLLTs() const {
       Reg2, getRegInfo()->getType(Reg2), Reg3, getRegInfo()->getType(Reg3),
       Reg4, getRegInfo()->getType(Reg4));
 }
+
+void MachineInstr::insert(mop_iterator It, ArrayRef<MachineOperand> Ops) {
+  if (!It || Ops.empty())
+    return;
+
+  // Do one pass to untie operands.
+  DenseMap<unsigned, unsigned> TiedOpIndices;
----------------
MatzeB wrote:

Use `SmallDenseMap` to avoid allocation in the common case.

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


More information about the llvm-commits mailing list