-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[CodeGen][Remarks] Add the function name to the stack size remark #69346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-backend-aarch64 Author: Jon Roelofs (jroelofs) ChangesIt is already present in the yaml, but missing from the printed diagnostics. Full diff: https://github.com/llvm/llvm-project/pull/69346.diff 3 Files Affected:
diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
index 9514a0875a7854b..dd33b47a02609ff 100644
--- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp
@@ -337,7 +337,8 @@ bool PEI::runOnMachineFunction(MachineFunction &MF) {
return MachineOptimizationRemarkAnalysis(DEBUG_TYPE, "StackSize",
MF.getFunction().getSubprogram(),
&MF.front())
- << ore::NV("NumStackBytes", StackSize) << " stack bytes in function";
+ << ore::NV("NumStackBytes", StackSize) << " stack bytes in function '"
+ << ore::NV("Function", MF.getFunction().getName()) << "'";
});
delete RS;
diff --git a/llvm/test/CodeGen/AArch64/prologue-epilogue-remarks.mir b/llvm/test/CodeGen/AArch64/prologue-epilogue-remarks.mir
index 4bc1b968d17089e..223719d44d169d8 100644
--- a/llvm/test/CodeGen/AArch64/prologue-epilogue-remarks.mir
+++ b/llvm/test/CodeGen/AArch64/prologue-epilogue-remarks.mir
@@ -11,7 +11,9 @@ stack:
# CHECK: Function: fun0
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '16'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun0
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
body: |
@@ -29,7 +31,9 @@ stack:
# CHECK: Function: fun1
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '32'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun1
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
body: |
@@ -47,7 +51,9 @@ stack:
# CHECK: Function: fun2
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '1040'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun2
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
body: |
diff --git a/llvm/test/CodeGen/X86/prologue-epilogue-remarks.mir b/llvm/test/CodeGen/X86/prologue-epilogue-remarks.mir
index f0c6121bd98e775..39d06c2909f9e0b 100644
--- a/llvm/test/CodeGen/X86/prologue-epilogue-remarks.mir
+++ b/llvm/test/CodeGen/X86/prologue-epilogue-remarks.mir
@@ -17,7 +17,9 @@ stack:
# CHECK-NEXT: Function: fun0
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '8'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun0
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
@@ -36,7 +38,9 @@ stack:
# CHECK-NEXT: Function: fun1
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '20'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun1
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
body: |
@@ -54,7 +58,9 @@ stack:
# CHECK-NEXT: Function: fun2
# CHECK-NEXT: Args:
# CHECK-NEXT: - NumStackBytes: '1024'
-# CHECK-NEXT: - String: ' stack bytes in function'
+# CHECK-NEXT: - String: ' stack bytes in function '''
+# CHECK-NEXT: - Function: fun2
+# CHECK-NEXT: - String: ''''
# CHECK-NEXT: ...
constants:
body: |
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
It is already present in the yaml, but missing from the printed diagnostics.
e75117c
to
b6b7d5d
Compare
Isn't the diagnostic shown at the beginning of the function? |
If the function has debuginfo, it points at the
Compiler-generated functions without debug info explaining where they came from are even worse:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM then, thanks
It is already present in the yaml, but missing from the printed diagnostics.