[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
https://github.com/Radu2k edited https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
Radu2k wrote: That looks good to me, thought it needs to check line by line(flang/test/Driver/mlir-debug-pass-pipeline.f90 - lines 35-38) but will update, replacing ALL-NEXT to ALL at line 85. https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
banach-space wrote: Thanks for the explanation! > Therefore it is mandatory to add omitting frame pointer No. You can also update the expected output. So there are 2 options. And what would be preferred - this test is checking pass pipelines and including `-fomit-frame-pointer` suggests that that flag will impact those pipelines. That's not the case though. You can do this: ``` ! ALL-LABEL: Fortran::lower::VerifierPass ! ALL-NEXT: 'func.func' Pipeline ! ALL: InlineElementals ! ALL-NEXT: LowerHLFIROrderedAssignments ``` https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
@@ -1,9 +1,12 @@ ! Test that flang-new forwards -fno-omit-frame-pointer and -fomit-frame-pointer Flang frontend -! RUN: %flang -fno-omit-frame-pointer --target=x86-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s -! CHECK: "-mframe-pointer=all" +! RUN: %flang --target=aarch64-none-none -fsyntax-only -### %s -o %t 2>&1 | FileCheck %s --check-prefix=CHECK-NOVALUE +! CHECK-NOVALUE: "-mframe-pointer=non-leaf" banach-space wrote: See the comment at the top of the file: > ! Test that flang-new forwards -fno-omit-frame-pointer and > -fomit-frame-pointer Flang frontend In order to identify that this is indeed checking the **frontend** driver invocation (as per the comment, that's the intention), you need to check for `-fc1`. That's something that was missing here to begin with, so strictly speaking it's tangential to your change. But since you are updating these CHECK lines anyway ... https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[clang-tools-extra] [clang] [llvm] [flang] [flang] Pass to add frame pointer attribute (PR #74598)
@@ -245,6 +245,24 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions , opts.AliasAnalysis = opts.OptimizationLevel > 0; + if (const llvm::opt::Arg *a = + args.getLastArg(clang::driver::options::OPT_mframe_pointer_EQ)) { +llvm::StringRef s = a->getValue(); + +if (!(s == "none" || s == "non-leaf" || s == "all")) { + const auto debugWarningId = diags.getCustomDiagID( + clang::DiagnosticsEngine::Error, "Frame pointer: %0"); banach-space wrote: I couldn't find it - which one is it? https://github.com/llvm/llvm-project/pull/74598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits