[llvm] [LoongArch] Add areInlineCompatible (PR #117144)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 21 04:07:15 PST 2024
================
@@ -19,6 +19,20 @@ using namespace llvm;
#define DEBUG_TYPE "loongarchtti"
+bool LoongArchTTIImpl::areInlineCompatible(const Function *Caller,
+ const Function *Callee) const {
+ const TargetMachine &TM = getTLI()->getTargetMachine();
+
+ const FeatureBitset &CallerBits =
+ TM.getSubtargetImpl(*Caller)->getFeatureBits();
+ const FeatureBitset &CalleeBits =
+ TM.getSubtargetImpl(*Callee)->getFeatureBits();
+
+ // Inline a callee if its target-features are a subset of the callers
+ // target-features.
+ return (CallerBits & CalleeBits) == CalleeBits;
+}
----------------
nikic wrote:
Can we make this the default implementation? I think every target copies some variant of this...
https://github.com/llvm/llvm-project/pull/117144
More information about the llvm-commits
mailing list