[all-commits] [llvm/llvm-project] fc018e: [IR] make -warn-frame-size into a module attr

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Thu Jun 10 16:15:46 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fc018ebb608ee0c1239b405460e49f1835ab6175
      https://github.com/llvm/llvm-project/commit/fc018ebb608ee0c1239b405460e49f1835ab6175
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2021-06-10 (Thu, 10 Jun 2021)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    A clang/test/Driver/Wframe-larger-than.c
    M clang/test/Frontend/backend-diagnostic.c
    M clang/test/Misc/backend-stack-frame-diagnostics-fallback.cpp
    M llvm/include/llvm/IR/Module.h
    M llvm/lib/CodeGen/PrologEpilogInserter.cpp
    M llvm/lib/IR/Module.cpp
    M llvm/test/CodeGen/ARM/warn-stack.ll
    M llvm/test/CodeGen/X86/warn-stack.ll
    A llvm/test/Linker/warn-stack-frame.ll

  Log Message:
  -----------
  [IR] make -warn-frame-size into a module attr

-Wframe-larger-than= is an interesting warning; we can't know the frame
size until PrologueEpilogueInsertion (PEI); very late in the compilation
pipeline.

-Wframe-larger-than= was propagated through CC1 as an -mllvm flag, then
was a cl::opt in LLVM's PEI pass; this meant it was dropped during LTO
and needed to be re-specified via -plugin-opt.

Instead, make it part of the IR proper as a module level attribute,
similar to D103048. Introduce -fwarn-stack-size CC1 option.

Reviewed By: rsmith, qcolombet

Differential Revision: https://reviews.llvm.org/D103928




More information about the All-commits mailing list