[llvm] [ARM] Add a method to clear registers (PR #69659)

Bill Wendling via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 14:41:42 PDT 2023


================
@@ -6735,6 +6735,15 @@ MachineBasicBlock::iterator ARMBaseInstrInfo::insertOutlinedCall(
   return CallPt;
 }
 
+void ARMBaseInstrInfo::buildClearRegister(Register DstReg,
+                                          MachineBasicBlock &MBB,
+                                          MachineBasicBlock::iterator Iter,
+                                          DebugLoc &DL,
+                                          bool AllowSideEffects) const {
+  unsigned Opc = Subtarget.isThumb2() ? ARM::t2MOVi32imm : ARM::MOVi32imm;
----------------
bwendling wrote:

> Should floating-point registers also be covered by this method?

Yes. I forgot about them. :-(

> Also, do we care about Thumb1?

I can change this to `isThumb()`, but I want to avoid using `tMOVi32imm`, because it modifies `CPSR` (I want to avoid side effects even if `AllowSideEffects` is `true`).

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


More information about the llvm-commits mailing list