[PATCH] D76024: [MachineLICM] Let targets decide to hoist cheap instructions

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 14:07:34 PDT 2020


dmgreen created this revision.
dmgreen added reviewers: samparker, SjoerdMeijer, efriedma, simon_tatham, ostannard, t.p.northover.
Herald added subscribers: asbirlea, hiraditya.
Herald added a project: LLVM.

MachineLICM can hoist instructions out of loop, but will chooses not to do so for Cheap instructions, including all COPY instructions. Under Cortex-M cpus, where there isn't really a big difference between a MOV and any other instruction, we should really hoist these out of loops, even if they increase the immediate register pressure. MachineLICM will still test if the register pressure limit has been reached, but this puts a shouldHoistCheapInsts target hook in for hoisting instructions that wouldn't otherwise be.

This is especially true 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 needs to be hoisted. Other than that this did not seem to cause a lot of changes.


https://reviews.llvm.org/D76024

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/MachineLICM.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
  llvm/lib/Target/ARM/ARMBaseInstrInfo.h
  llvm/test/CodeGen/Thumb2/mve-floatregloops.ll
  llvm/test/CodeGen/Thumb2/mve-pred-threshold.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76024.249739.patch
Type: text/x-patch
Size: 22454 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200311/b772aac3/attachment-0001.bin>


More information about the llvm-commits mailing list