[PATCH] D34697: [ARM] Inline callee if its target-features are a subset of the caller

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 09:33:23 PDT 2017


fhahn created this revision.
Herald added subscribers: eraman, arichardson, javed.absar, sdardis, aemerson.

Similar to X86, it should be safe to inline callees if their
target-features are a subset of the caller. Only the thumb-mode target
feature needs to be treated separately, as it forces either ARM or Thumb
code generation and it's not clear if we want to potentially switch to
mode of a function when inlining.

Maybe it would be a good idea to add a separate use-thumb function
attribute to indicate that Thumb code should be generated and keep the
thumb-mode target-feature just to indicate if the CPU supports Thumb?
It seems like the MIPS backend uses similar `mips16` and `nomips16` function
attributes to control MIPS16 code generation.


https://reviews.llvm.org/D34697

Files:
  lib/Target/ARM/ARMTargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.h
  test/Transforms/Inline/ARM/inline-target-attr.ll
  test/Transforms/Inline/ARM/lit.local.cfg

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34697.104195.patch
Type: text/x-patch
Size: 3508 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/bcafbe05/attachment.bin>


More information about the llvm-commits mailing list