[PATCH] D133636: [M68k] Fix the crash of fast register allocator

Min-Yih Hsu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 22:21:40 PDT 2022


myhsu added inline comments.


================
Comment at: llvm/lib/Target/M68k/M68kInstrInfo.cpp:705
     if (M68k::DR8RegClass.hasSubClassEq(RC))
-      return load ? M68k::MOVM8mp_P : M68k::MOVM8pm_P;
+      return load ? M68k::MOV8dp : M68k::MOV8pd;
     if (M68k::CCRCRegClass.hasSubClassEq(RC))
----------------
Oh I didn't notice this, thanks for spotting


================
Comment at: llvm/lib/Target/M68k/M68kInstrInfo.cpp:748
                                         const TargetRegisterInfo *TRI) const {
-  const MachineFunction &MF = *MBB.getParent();
-  assert(MF.getFrameInfo().getObjectSize(FrameIndex) == 4 &&
----------------
Instead of remove these assertions completely, can we check if the object size matches the spill size of the given register class (like [[ https://github.com/llvm/llvm-project/blob/79fa0ec8c4bfeeb21f7b44ebd9a66e7ec9781798/llvm/lib/Target/X86/X86InstrInfo.cpp#L3907 | what X86 is doing ]]). Ditto for loadRegFromStackSlot.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133636/new/

https://reviews.llvm.org/D133636



More information about the llvm-commits mailing list