[libc-commits] [libc] [NFC][CodeGen] Create method to clear registers (PR #66958)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Thu Sep 21 13:29:08 PDT 2023


================
@@ -2057,6 +2057,14 @@ class TargetInstrInfo : public MCInstrInfo {
         "Target didn't implement TargetInstrInfo::insertOutlinedCall!");
   }
 
+  /// Insert an architecture-specific instruction to clear a register.
+  virtual void buildClearRegister(Register Reg, MachineBasicBlock &MBB,
+                                  MachineBasicBlock::iterator Iter,
----------------
nickdesaulniers wrote:

In the interest of passing one less parameter, if `Iter`'s `->getParent() == MBB`, then consider just passing `Iter` (not `MBB`) and get `MBB` in `buildClearRegister` via `Iter->getParent()`. Not sure if that's the case though. If not, feel free to reject the suggestion.

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


More information about the libc-commits mailing list