[PATCH] D98659: [MachineCopyPropagation] Do more backward copy propagations

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 16 07:08:04 PDT 2021


foad added inline comments.


================
Comment at: llvm/lib/CodeGen/MachineCopyPropagation.cpp:331
+          MachineInstr *Copy = findCopyDefViaUnit(*RUI, TRI);
+          MCRegister Src = Copy->getOperand(1).getReg().asMCReg();
+          MCRegister Def = Copy->getOperand(0).getReg().asMCReg();
----------------
yshui wrote:
> yshui wrote:
> > foad wrote:
> > > Hi, I tried testing this on AMDGPU but quite a lot of tests crash here because Copy is nullptr.
> > Thanks, I will have a look.
> Looks like I made an assumption that was stronger than what `CopyTracker` actually guaranteed.
> 
> This should be fixed now.
Yes that fixes the crashes thanks. There are no affected tests for AMDGPU -- of course I was hoping for some massive codegen improvents!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98659



More information about the llvm-commits mailing list