[llvm] 680f3d6 - Revert "[GreedyRA ORE] Add Cost of spill locations into remark"
Serguei Katkov via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 19 21:09:30 PDT 2021
Author: Serguei Katkov
Date: 2021-04-20T11:08:24+07:00
New Revision: 680f3d6de79f7dd75ee0cda256a541d18e504a22
URL: https://github.com/llvm/llvm-project/commit/680f3d6de79f7dd75ee0cda256a541d18e504a22
DIFF: https://github.com/llvm/llvm-project/commit/680f3d6de79f7dd75ee0cda256a541d18e504a22.diff
LOG: Revert "[GreedyRA ORE] Add Cost of spill locations into remark"
This reverts commit 328377307ad2da961b3be0f2bbf1814a6f1f4ed3.
This commit causes buildbot failures due to some clang tests are not updated.
Temporary revert to fix clang tests.
Added:
Modified:
llvm/lib/CodeGen/RegAllocGreedy.cpp
llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll
llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
llvm/test/CodeGen/X86/statepoint-ra.ll
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 340453b9af113..c1da51e6f5934 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -555,11 +555,6 @@ class RAGreedy : public MachineFunctionPass,
unsigned Spills = 0;
unsigned FoldedSpills = 0;
unsigned Copies = 0;
- float ReloadsCost = 0.0f;
- float FoldedReloadsCost = 0.0f;
- float SpillsCost = 0.0f;
- float FoldedSpillsCost = 0.0f;
- float CopiesCost = 0.0f;
bool isEmpty() {
return !(Reloads || FoldedReloads || Spills || FoldedSpills ||
@@ -573,11 +568,6 @@ class RAGreedy : public MachineFunctionPass,
Spills += other.Spills;
FoldedSpills += other.FoldedSpills;
Copies += other.Copies;
- ReloadsCost += other.ReloadsCost;
- FoldedReloadsCost += other.FoldedReloadsCost;
- SpillsCost += other.SpillsCost;
- FoldedSpillsCost += other.FoldedSpillsCost;
- CopiesCost += other.CopiesCost;
}
void report(MachineOptimizationRemarkMissed &R);
@@ -3147,31 +3137,19 @@ MCRegister RAGreedy::selectOrSplitImpl(LiveInterval &VirtReg,
void RAGreedy::RAGreedyStats::report(MachineOptimizationRemarkMissed &R) {
using namespace ore;
- if (Spills) {
+ if (Spills)
R << NV("NumSpills", Spills) << " spills ";
- R << NV("TotalSpillsCost", SpillsCost) << " total spills cost ";
- }
- if (FoldedSpills) {
+ if (FoldedSpills)
R << NV("NumFoldedSpills", FoldedSpills) << " folded spills ";
- R << NV("TotalFoldedSpillsCost", FoldedSpillsCost)
- << " total folded spills cost ";
- }
- if (Reloads) {
+ if (Reloads)
R << NV("NumReloads", Reloads) << " reloads ";
- R << NV("TotalReloadsCost", ReloadsCost) << " total reloads cost ";
- }
- if (FoldedReloads) {
+ if (FoldedReloads)
R << NV("NumFoldedReloads", FoldedReloads) << " folded reloads ";
- R << NV("TotalFoldedReloadsCost", FoldedReloadsCost)
- << " total folded reloads cost ";
- }
if (ZeroCostFoldedReloads)
R << NV("NumZeroCostFoldedReloads", ZeroCostFoldedReloads)
<< " zero cost folded reloads ";
- if (Copies) {
+ if (Copies)
R << NV("NumVRCopies", Copies) << " virtual registers copies ";
- R << NV("TotalCopiesCost", CopiesCost) << " total copies cost ";
- }
}
RAGreedy::RAGreedyStats RAGreedy::computeStats(MachineBasicBlock &MBB) {
@@ -3240,14 +3218,6 @@ RAGreedy::RAGreedyStats RAGreedy::computeStats(MachineBasicBlock &MBB) {
Stats.FoldedSpills += Accesses.size();
}
}
- // Set cost of collected statistic by multiplication to relative frequency of
- // this basic block.
- float RelFreq = MBFI->getBlockFreqRelativeToEntryBlock(&MBB);
- Stats.ReloadsCost = RelFreq * Stats.Reloads;
- Stats.FoldedReloadsCost = RelFreq * Stats.FoldedReloads;
- Stats.SpillsCost = RelFreq * Stats.Spills;
- Stats.FoldedSpillsCost = RelFreq * Stats.FoldedSpills;
- Stats.CopiesCost = RelFreq * Stats.Copies;
return Stats;
}
diff --git a/llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll b/llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll
index e51cdbfac73cd..6a9998835d66c 100644
--- a/llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll
@@ -5,7 +5,7 @@
; RUN: -pass-remarks-with-hotness -pass-remarks-hotness-threshold=1 \
; RUN: 2>&1 | FileCheck -check-prefix=THRESHOLD %s
-; CHECK: remark: /tmp/kk.c:3:20: 1 spills 3.187500e+01 total spills cost 1 reloads 3.187500e+01 total reloads cost generated in loop{{$}}
+; CHECK: remark: /tmp/kk.c:3:20: 1 spills 1 reloads generated in loop{{$}}
; THRESHOLD-NOT: remark
define void @fpr128(<4 x float>* %p) nounwind ssp {
diff --git a/llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll b/llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
index 72d486d7760d3..f17932facd57f 100644
--- a/llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
+++ b/llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
@@ -17,25 +17,25 @@
; then reloaded.
; (loop3:)
-; REMARK: remark: /tmp/kk.c:3:20: 1 spills 1.000000e+02 total spills cost 1 reloads 1.000000e+02 total reloads cost generated in loop{{$}}
+; REMARK: remark: /tmp/kk.c:3:20: 1 spills 1 reloads generated in loop{{$}}
; (loop2:)
-; REMARK: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop{{$}}
+; REMARK: remark: /tmp/kk.c:2:20: 1 spills 1 reloads generated in loop{{$}}
; (loop:)
-; REMARK: remark: /tmp/kk.c:1:20: 2 spills 1.010000e+04 total spills cost 2 reloads 1.010000e+04 total reloads cost generated in loop{{$}}
+; REMARK: remark: /tmp/kk.c:1:20: 2 spills 2 reloads generated in loop{{$}}
; (func:)
-; REMARK: remark: /tmp/kk.c:1:1: 3 spills 1.020000e+04 total spills cost 3 reloads 1.020000e+04 total reloads cost 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.000000e+02 total spills cost 1 reloads 1.000000e+02 total reloads cost generated in loop (hotness: 300)
+; HOTNESS: remark: /tmp/kk.c:3:20: 1 spills 1 reloads generated in loop (hotness: 300)
; (loop2:)
-; HOTNESS: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop (hotness: 30000)
+; HOTNESS: remark: /tmp/kk.c:2:20: 1 spills 1 reloads generated in loop (hotness: 30000)
; (loop:)
-; HOTNESS: remark: /tmp/kk.c:1:20: 2 spills 1.010000e+04 total spills cost 2 reloads 1.010000e+04 total reloads cost generated in loop (hotness: 300)
+; HOTNESS: remark: /tmp/kk.c:1:20: 2 spills 2 reloads generated in loop (hotness: 300)
; NO_REMARK-NOT: remark
; THRESHOLD-NOT: (hotness: 300)
-; THRESHOLD: remark: /tmp/kk.c:2:20: 1 spills 1.000000e+04 total spills cost 1 reloads 1.000000e+04 total reloads cost generated in loop (hotness: 30000)
+; THRESHOLD: remark: /tmp/kk.c:2:20: 1 spills 1 reloads generated in loop (hotness: 30000)
; YAML: --- !Missed
; YAML: Pass: regalloc
@@ -46,12 +46,8 @@
; YAML: Args:
; YAML: - NumSpills: '1'
; YAML: - String: ' spills '
-; YAML: - TotalSpillsCost: '1.000000e+02'
-; YAML: - String: ' total spills cost '
; YAML: - NumReloads: '1'
; YAML: - String: ' reloads '
-; YAML: - TotalReloadsCost: '1.000000e+02'
-; YAML: - String: ' total reloads cost '
; YAML: - String: generated in loop
; YAML: ...
; YAML: --- !Missed
@@ -63,12 +59,8 @@
; YAML: Args:
; YAML: - NumSpills: '1'
; YAML: - String: ' spills '
-; YAML: - TotalSpillsCost: '1.000000e+04'
-; YAML: - String: ' total spills cost '
; YAML: - NumReloads: '1'
; YAML: - String: ' reloads '
-; YAML: - TotalReloadsCost: '1.000000e+04'
-; YAML: - String: ' total reloads cost '
; YAML: - String: generated in loop
; YAML: ...
; YAML: --- !Missed
@@ -80,12 +72,8 @@
; YAML: Args:
; YAML: - NumSpills: '2'
; YAML: - String: ' spills '
-; YAML: - TotalSpillsCost: '1.010000e+04'
-; YAML: - String: ' total spills cost '
; YAML: - NumReloads: '2'
; YAML: - String: ' reloads '
-; YAML: - TotalReloadsCost: '1.010000e+04'
-; YAML: - String: ' total reloads cost '
; YAML: - String: generated in loop
; YAML: ...
; YAML: --- !Missed
@@ -97,12 +85,8 @@
; YAML: Args:
; YAML: - NumSpills: '3'
; YAML: - String: ' spills '
-; YAML: - TotalSpillsCost: '1.020000e+04'
-; YAML: - String: ' total spills cost '
; YAML: - NumReloads: '3'
; YAML: - String: ' reloads '
-; YAML: - TotalReloadsCost: '1.020000e+04'
-; YAML: - String: ' total reloads cost '
; YAML: - String: generated in function
; YAML: ...
@@ -116,12 +100,8 @@
; THRESHOLD_YAML: Args:
; THRESHOLD_YAML: - NumSpills: '1'
; THRESHOLD_YAML: - String: ' spills '
-; THRESHOLD_YAML: - TotalSpillsCost: '1.000000e+04'
-; THRESHOLD_YAML: - String: ' total spills cost '
; THRESHOLD_YAML: - NumReloads: '1'
; THRESHOLD_YAML: - String: ' reloads '
-; THRESHOLD_YAML: - TotalReloadsCost: '1.000000e+04'
-; THRESHOLD_YAML: - String: ' total reloads cost '
; THRESHOLD_YAML: - String: generated in loop
; THRESHOLD_YAML: ...
diff --git a/llvm/test/CodeGen/X86/statepoint-ra.ll b/llvm/test/CodeGen/X86/statepoint-ra.ll
index 38a14017fab5d..ea460dabb6dc5 100644
--- a/llvm/test/CodeGen/X86/statepoint-ra.ll
+++ b/llvm/test/CodeGen/X86/statepoint-ra.ll
@@ -12,18 +12,12 @@ target triple = "x86_64-unknown-linux-gnu"
;YAML: Args:
;YAML: - NumSpills: '10'
;YAML: - String: ' spills '
-;YAML: - TotalSpillsCost: '7.000000e+00'
-;YAML: - String: ' total spills cost '
;YAML: - NumReloads: '7'
;YAML: - String: ' reloads '
-;YAML: - TotalReloadsCost: '3.109004e-15'
-;YAML: - String: ' total reloads cost '
;YAML: - NumZeroCostFoldedReloads: '20'
;YAML: - String: ' zero cost folded reloads '
;YAML: - NumVRCopies: '2'
;YAML: - String: ' virtual registers copies '
-;YAML: - TotalCopiesCost: '8.882868e-16'
-;YAML: - String: ' total copies cost '
;YAML: - String: generated in function
define void @barney(i8 addrspace(1)* %arg, double %arg1, double %arg2, double %arg3, double %arg4, double %arg5, double %arg6, double %arg7, double %arg8, double %arg9, double %arg10, double %arg11, double %arg12) gc "statepoint-example" personality i32* ()* @widget {
More information about the llvm-commits
mailing list