Skip to content

Commit 64ae641

Browse files
JonPsson1llvmbot
authored andcommitted
[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 (cherry picked from commit 378739f)
1 parent 548d057 commit 64ae641

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10231,6 +10231,11 @@ static void printFunctionArgExts(const Function *F, raw_fd_ostream &OS) {
1023110231
void SystemZTargetLowering::
1023210232
verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs,
1023310233
const Function *F, SDValue Callee) const {
10234+
// Temporarily only do the check when explicitly requested, until it can be
10235+
// enabled by default.
10236+
if (!EnableIntArgExtCheck)
10237+
return;
10238+
1023410239
bool IsInternal = false;
1023510240
const Function *CalleeFn = nullptr;
1023610241
if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee))
@@ -10252,6 +10257,11 @@ verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs,
1025210257
void SystemZTargetLowering::
1025310258
verifyNarrowIntegerArgs_Ret(const SmallVectorImpl<ISD::OutputArg> &Outs,
1025410259
const Function *F) const {
10260+
// Temporarily only do the check when explicitly requested, until it can be
10261+
// enabled by default.
10262+
if (!EnableIntArgExtCheck)
10263+
return;
10264+
1025510265
if (!verifyNarrowIntegerArgs(Outs, isFullyInternal(F))) {
1025610266
errs() << "ERROR: Missing extension attribute of returned "
1025710267
<< "value from function:\n";
@@ -10268,11 +10278,6 @@ verifyNarrowIntegerArgs(const SmallVectorImpl<ISD::OutputArg> &Outs,
1026810278
if (IsInternal || !Subtarget.isTargetELF())
1026910279
return true;
1027010280

10271-
// Temporarily only do the check when explicitly requested, until it can be
10272-
// enabled by default.
10273-
if (!EnableIntArgExtCheck)
10274-
return true;
10275-
1027610281
if (EnableIntArgExtCheck.getNumOccurrences()) {
1027710282
if (!EnableIntArgExtCheck)
1027810283
return true;

0 commit comments

Comments
 (0)