diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp index bb584b7bb5c9a..1e0c303a2e4da 100644 --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -10237,6 +10237,11 @@ static void printFunctionArgExts(const Function *F, raw_fd_ostream &OS) { void SystemZTargetLowering:: verifyNarrowIntegerArgs_Call(const SmallVectorImpl &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(Callee)) @@ -10258,6 +10263,11 @@ verifyNarrowIntegerArgs_Call(const SmallVectorImpl &Outs, void SystemZTargetLowering:: verifyNarrowIntegerArgs_Ret(const SmallVectorImpl &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"; @@ -10274,11 +10284,6 @@ verifyNarrowIntegerArgs(const SmallVectorImpl &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;