Author: Jonas Paulsson Date: 2025-03-12T17:50:33Z New Revision: 64ae6413559e2f0fa9218b2f83919ec757404f3b
URL: https://github.com/llvm/llvm-project/commit/64ae6413559e2f0fa9218b2f83919ec757404f3b DIFF: https://github.com/llvm/llvm-project/commit/64ae6413559e2f0fa9218b2f83919ec757404f3b.diff LOG: [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 378739f18208165f9831571a57f34d82f6663bc6) Added: Modified: llvm/lib/Target/SystemZ/SystemZISelLowering.cpp Removed: ################################################################################ diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index 1fb31c26e20d3..2b8269e440e90 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -10231,6 +10231,11 @@ static void printFunctionArgExts(const Function *F, raw_fd_ostream &OS) { void SystemZTargetLowering:: verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs, const Function *F, SDValue Callee) const { + // Temporarily only do the check when explicitly requested, until it can be + // enabled by default. + if (!EnableIntArgExtCheck) + return; + bool IsInternal = false; const Function *CalleeFn = nullptr; if (auto *G = dyn_cast<GlobalAddressSDNode>(Callee)) @@ -10252,6 +10257,11 @@ verifyNarrowIntegerArgs_Call(const SmallVectorImpl<ISD::OutputArg> &Outs, void SystemZTargetLowering:: verifyNarrowIntegerArgs_Ret(const SmallVectorImpl<ISD::OutputArg> &Outs, const Function *F) const { + // Temporarily only do the check when explicitly requested, until it can be + // enabled by default. + if (!EnableIntArgExtCheck) + return; + if (!verifyNarrowIntegerArgs(Outs, isFullyInternal(F))) { errs() << "ERROR: Missing extension attribute of returned " << "value from function:\n"; @@ -10268,11 +10278,6 @@ verifyNarrowIntegerArgs(const SmallVectorImpl<ISD::OutputArg> &Outs, if (IsInternal || !Subtarget.isTargetELF()) return true; - // Temporarily only do the check when explicitly requested, until it can be - // enabled by default. - if (!EnableIntArgExtCheck) - return true; - if (EnableIntArgExtCheck.getNumOccurrences()) { if (!EnableIntArgExtCheck) return true; _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits