[PATCH] D76135: [MachineLICM] Don't treat cross copies as cheap

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 13 08:33:58 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: efriedma, RKSimon, arsenm, qcolombet.
Herald added subscribers: kerbowa, asbirlea, hiraditya, nhaehnle, wdng, jvesely.

This adjusts the cost of cross register bank copy instructions in MachineLICM, no longer treating them as expensive in order to allow them to be pulled out of inner loops. This can be especially important for MVE code where we sink VDUP's into blocks attempting to fold them into register variants of vector instructions. Where this scalar is a float value we are left with a COPY from SPR to GPR which then needs to be hoisted.

This is an alternative to D76024 <https://reviews.llvm.org/D76024>.
The isCrossCopy code was taken from DetectDeadLanes with some adjustment/cleanup. I don't feel like an expert on some of these areas like subreg copies.
I'm not 100% sure all these test diffs are better, but most of them look OK to me.


https://reviews.llvm.org/D76135

Files:
  llvm/lib/CodeGen/MachineLICM.cpp
  llvm/test/CodeGen/AMDGPU/idiv-licm.ll
  llvm/test/CodeGen/AMDGPU/sdiv64.ll
  llvm/test/CodeGen/AMDGPU/sdwa-peephole.ll
  llvm/test/CodeGen/AMDGPU/srem64.ll
  llvm/test/CodeGen/AMDGPU/udiv64.ll
  llvm/test/CodeGen/AMDGPU/urem64.ll
  llvm/test/CodeGen/Thumb2/mve-floatregloops.ll
  llvm/test/CodeGen/Thumb2/mve-pred-threshold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76135.250204.patch
Type: text/x-patch
Size: 80736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200313/9a0d4920/attachment.bin>


More information about the llvm-commits mailing list