[llvm] [M68k] Implement `CLR` instruction encoding and logic (PR #216636)

Dan Salvato via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 19:58:05 PDT 2026


================
@@ -609,6 +637,29 @@ bool M68kInstrInfo::ExpandMOVEM(MachineInstrBuilder &MIB,
   return true;
 }
 
+void M68kInstrInfo::buildClearRegister(Register Reg, MachineBasicBlock &MBB,
+                                       MachineBasicBlock::iterator Iter,
+                                       DebugLoc &DL,
+                                       bool AllowSideEffects) const {
+  // Clear an address register by subtracting it from itself.
+  if (M68k::AR32RegClass.contains(Reg)) {
----------------
dansalvato wrote:

Okay, all set for now. I think there are other things that can be improved with the way the `MOVI` pseudo is handled, but I'll leave it for a future patch.

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


More information about the llvm-commits mailing list