From 51238cde191f6c5ec1a34f6e3a2ce4b9a001cc6c Mon Sep 17 00:00:00 2001 From: Jonas Paulsson Date: Tue, 11 Mar 2025 16:49:10 -0600 Subject: [PATCH] [SystemZ] Move disabling of arg verification to before isFullyInternal(). Fixes #130541 --- llvm/lib/Target/SystemZ/SystemZISelLowering.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) 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;