[PATCH] D100168: [GreedyRA ORE] Add debug location for function level report
Serguei Katkov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 12 20:00:15 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc362179b0a12: [GreedyRA ORE] Add debug location for function level report (authored by skatkov).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D100168/new/
https://reviews.llvm.org/D100168
Files:
llvm/lib/CodeGen/RegAllocGreedy.cpp
llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
Index: llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
===================================================================
--- llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
+++ llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
@@ -23,7 +23,7 @@
; (loop:)
; REMARK: remark: /tmp/kk.c:1:20: 2 spills 2 reloads generated in loop{{$}}
; (func:)
-; REMARK: remark: <unknown>:0:0: 3 spills 3 reloads generated in function{{$}}
+; REMARK: remark: /tmp/kk.c:1:1: 3 spills 3 reloads generated in function{{$}}
; (loop3:)
; HOTNESS: remark: /tmp/kk.c:3:20: 1 spills 1 reloads generated in loop (hotness: 300)
@@ -79,6 +79,7 @@
; YAML: --- !Missed
; YAML: Pass: regalloc
; YAML: Name: SpillReload
+; YAML: DebugLoc: { File: '/tmp/kk.c', Line: 1, Column: 1 }
; YAML: Function: fpr128
; YAML: Hotness: 3
; YAML: Args:
@@ -104,7 +105,7 @@
; THRESHOLD_YAML: - String: generated in loop
; THRESHOLD_YAML: ...
-define void @fpr128(<4 x float>* %p) nounwind ssp !prof !11 {
+define void @fpr128(<4 x float>* %p) nounwind ssp !prof !11 !dbg !6 {
entry:
br label %loop, !dbg !8
Index: llvm/lib/CodeGen/RegAllocGreedy.cpp
===================================================================
--- llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -69,6 +69,7 @@
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/IR/DebugInfoMetadata.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
@@ -3215,7 +3216,10 @@
using namespace ore;
ORE->emit([&]() {
- MachineOptimizationRemarkMissed R(DEBUG_TYPE, "SpillReload", DebugLoc(),
+ DebugLoc Loc;
+ if (auto *SP = MF->getFunction().getSubprogram())
+ Loc = DILocation::get(SP->getContext(), SP->getLine(), 1, SP);
+ MachineOptimizationRemarkMissed R(DEBUG_TYPE, "SpillReload", Loc,
&MF->front());
Stats.report(R);
R << "generated in function";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100168.337028.patch
Type: text/x-patch
Size: 2056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210413/d7a3c834/attachment.bin>
More information about the llvm-commits
mailing list