Skip to content

Commit 378739f

Browse files
authored
[SystemZ] Move disabling of arg verification to before isFullyInternal(). (#130693)
It has found to be quite a slowdown to traverse the users of a function from each call site when it is called many (~70k) times. This patch fixes this for now as long as this verification is disabled by default, but there is still a need to eventually cache the results to avoid recomputation. Fixes #130541
1 parent e619073 commit 378739f

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -10237,6 +10237,11 @@ static void printFunctionArgExts(const Function *F, raw_fd_ostream &OS) {
1023710237
void SystemZTargetLowering::
1023810238
verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs,
1023910239
const Function *F, SDValue Callee) const {
10240+
// Temporarily only do the check when explicitly requested, until it can be
10241+
// enabled by default.
10242+
if (!EnableIntArgExtCheck)
10243+
return;
10244+
1024010245
bool IsInternal = false;
1024110246
const Function *CalleeFn = nullptr;
1024210247
if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee))
@@ -10258,6 +10263,11 @@ verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs,
1025810263
void SystemZTargetLowering::
1025910264
verifyNarrowIntegerArgs_Ret(const SmallVectorImpl<ISD::OutputArg> &Outs,
1026010265
const Function *F) const {
10266+
// Temporarily only do the check when explicitly requested, until it can be
10267+
// enabled by default.
10268+
if (!EnableIntArgExtCheck)
10269+
return;
10270+
1026110271
if (!verifyNarrowIntegerArgs(Outs, isFullyInternal(F))) {
1026210272
errs() << "ERROR: Missing extension attribute of returned "
1026310273
<< "value from function:\n";
@@ -10274,11 +10284,6 @@ verifyNarrowIntegerArgs(const SmallVectorImpl<ISD::OutputArg> &Outs,
1027410284
if (IsInternal || !Subtarget.isTargetELF())
1027510285
return true;
1027610286

10277-
// Temporarily only do the check when explicitly requested, until it can be
10278-
// enabled by default.
10279-
if (!EnableIntArgExtCheck)
10280-
return true;
10281-
1028210287
if (EnableIntArgExtCheck.getNumOccurrences()) {
1028310288
if (!EnableIntArgExtCheck)
1028410289
return true;

0 commit comments

Comments
 (0)