aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CMakeLists.txt
diff options
context:
space:
mode:
authorPaul Kirth <paulkirth@google.com>2022-12-20 00:25:21 +0000
committerPaul Kirth <paulkirth@google.com>2023-01-13 20:52:48 +0000
commit0a652c540556a118bbd9386ed3ab7fd9e60a9754 (patch)
tree4469de8ef6f025cac560d449d5b66e7a76f21d22 /llvm/lib/CodeGen/CMakeLists.txt
parente0f3a95f9d999b526a9e82bb1a4012fdcb09b364 (diff)
downloadllvm-0a652c540556a118bbd9386ed3ab7fd9e60a9754.zip
llvm-0a652c540556a118bbd9386ed3ab7fd9e60a9754.tar.gz
llvm-0a652c540556a118bbd9386ed3ab7fd9e60a9754.tar.bz2
[codegen] Add StackFrameLayoutAnalysisPass
Issue #58168 describes the difficulty diagnosing stack size issues identified by -Wframe-larger-than. For simple code, its easy to understand the stack layout and where space is being allocated, but in more complex programs, where code may be heavily inlined, unrolled, and have duplicated code paths, it is no longer easy to manually inspect the source program and understand where stack space can be attributed. This patch implements a machine function pass that emits remarks with a textual representation of stack slots, and also outputs any available debug information to map source variables to those slots. The new behavior can be used by adding `-Rpass-analysis=stack-frame-layout` to the compiler invocation. Like other remarks the diagnostic information can be saved to a file in a machine readable format by adding -fsave-optimzation-record. Fixes: #58168 Reviewed By: nickdesaulniers, thegameg Differential Revision: https://reviews.llvm.org/D135488
Diffstat (limited to 'llvm/lib/CodeGen/CMakeLists.txt')
-rw-r--r--llvm/lib/CodeGen/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CMakeLists.txt b/llvm/lib/CodeGen/CMakeLists.txt
index 275ee80..cac16e5 100644
--- a/llvm/lib/CodeGen/CMakeLists.txt
+++ b/llvm/lib/CodeGen/CMakeLists.txt
@@ -213,6 +213,7 @@ add_llvm_component_library(LLVMCodeGen
SpillPlacement.cpp
SplitKit.cpp
StackColoring.cpp
+ StackFrameLayoutAnalysisPass.cpp
StackMapLivenessAnalysis.cpp
StackMaps.cpp
StackProtector.cpp