@@ -46,6 +46,16 @@ static cl::opt<unsigned>
46
46
NeonNonConstStrideOverhead (" neon-nonconst-stride-overhead" , cl::init(10 ),
47
47
cl::Hidden);
48
48
49
+ static cl::opt<unsigned > CallPenaltyChangeSM (
50
+ " call-penalty-sm-change" , cl::init(5 ), cl::Hidden,
51
+ cl::desc(
52
+ " Penalty of calling a function that requires a change to PSTATE.SM" ));
53
+
54
+ static cl::opt<unsigned > InlineCallPenaltyChangeSM (
55
+ " inline-call-penalty-sm-change" , cl::init(10 ), cl::Hidden,
56
+ cl::desc(
57
+ " Penalty of inlining a call that requires a change to PSTATE.SM" ));
58
+
49
59
namespace {
50
60
class TailFoldingOption {
51
61
// These bitfields will only ever be set to something non-zero in operator=,
@@ -295,9 +305,9 @@ AArch64TTIImpl::getInlineCallPenalty(const Function *F, const CallBase &Call,
295
305
SMEAttrs CalleeAttrs (Call);
296
306
if (FAttrs.requiresSMChange (CalleeAttrs)) {
297
307
if (F == Call.getCaller ()) // (1)
298
- return 5 * DefaultCallPenalty;
308
+ return CallPenaltyChangeSM * DefaultCallPenalty;
299
309
if (FAttrs.requiresSMChange (SMEAttrs (*Call.getCaller ()))) // (2)
300
- return 10 * DefaultCallPenalty;
310
+ return InlineCallPenaltyChangeSM * DefaultCallPenalty;
301
311
}
302
312
303
313
return DefaultCallPenalty;
0 commit comments