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

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 08:56:41 PDT 2023


================
@@ -2475,3 +2475,24 @@ MachineInstr::getFirst5RegLLTs() const {
       Reg2, getRegInfo()->getType(Reg2), Reg3, getRegInfo()->getType(Reg3),
       Reg4, getRegInfo()->getType(Reg4));
 }
+
+void MachineInstr::insert(mop_iterator It, ArrayRef<MachineOperand> Ops) {
+  assert(isVariadic() && "can only modify variadic instructions");
----------------
MatzeB wrote:

Couldn't we just as well add more implicit operands to a non-variadic instrution or similar? Could be implicit operands or maybe there is a situation where not all operands have been added to an instruction yet. So if possible I'd just remove this constraint.

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


More information about the llvm-commits mailing list