[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 Jul 11 09:10:53 PDT 2017


fhahn added inline comments.


================
Comment at: lib/Target/ARM/ARMTargetTransformInfo.cpp:31
+  return CallerBits[ARM::ModeThumb] == CalleeBits[ARM::ModeThumb] &&
+         ((CallerBits & CalleeBits) | ThumbMode) == (CalleeBits | ThumbMode);
+}
----------------
efriedma wrote:
> Are you sure ModeThumb is the only feature we need to check for?  ModeSoftFloat in particular seems suspicious: VFP intrinsics in the callee could fail to compile.  (I'd be much happier if we were whitelisting features; I'm afraid of missing something.)
Thanks for pointing out ModeSoftFloat, which behaves similar to ModeThumb. They both force different modes, with different instructions available, depending whether they are set or unset.

I think ideally they shouldn't be subtarget features, as my understanding was that subtarget features should only provide additional capabilities/instructions when they are enabled. But I guess that would a far bigger change and a whitelist should be fine for now.


https://reviews.llvm.org/D34697





More information about the llvm-commits mailing list