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

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


dmgreen added a comment.

In D76024#1918460 <https://reviews.llvm.org/D76024#1918460>, @efriedma wrote:

> I'm not sure what, exactly, is specific to Cortex-M here.  Copies between int and SIMD registers aren't really cheaper on other CPUs, relatively speaking.  I don't really like adding a new target hook without a better justification for why Cortex-M is different from other targets; having target-specific codepaths is going to make it harder for anyone to make improvements here in the future.


Good point about cross copies. I was really thinking that _any_ instruction on Cortex-M isn't really much cheaper than any other (with some obvious exceptions for divisions and the like). That's different from many CPU's where movs become essentially free.

> Maybe we should revisit the assumption that copies are cheap, in MachineLICMBase::IsCheapInstruction?  Or maybe we should revisit the assumption that we should avoid hoisting cheap instructions?

I've tried some alternatives and put together D76135 <https://reviews.llvm.org/D76135>. Let me know what you think, or if anything else would be preferable.


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

https://reviews.llvm.org/D76024





More information about the llvm-commits mailing list