aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineSink.cpp
diff options
context:
space:
mode:
authorMarkus Lavin <markus.lavin@ericsson.com>2022-06-21 08:08:06 +0200
committerMarkus Lavin <markus.lavin@ericsson.com>2022-06-21 08:13:09 +0200
commit3815ae29b5cb43333adde04df9d9a7a644b77d68 (patch)
treeb9a242f1baa8900ef91793365d73dfb2ba636e78 /llvm/lib/CodeGen/MachineSink.cpp
parentca4af13e480e856f8f889c1e145308fc4eb69816 (diff)
downloadllvm-3815ae29b5cb43333adde04df9d9a7a644b77d68.zip
llvm-3815ae29b5cb43333adde04df9d9a7a644b77d68.tar.gz
llvm-3815ae29b5cb43333adde04df9d9a7a644b77d68.tar.bz2
[machinesink] fix debug invariance issue
Do not include debug instructions when comparing block sizes with thresholds. Differential Revision: https://reviews.llvm.org/D127208
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineSink.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp
index 96d575f..3f2330b 100644
--- a/llvm/lib/CodeGen/MachineSink.cpp
+++ b/llvm/lib/CodeGen/MachineSink.cpp
@@ -1177,7 +1177,7 @@ bool MachineSinking::hasStoreBetween(MachineBasicBlock *From,
// If this BB is too big or the block number in straight line between From
// and To is too big, stop searching to save compiling time.
- if (BB->size() > SinkLoadInstsPerBlockThreshold ||
+ if (BB->sizeWithoutDebugLargerThan(SinkLoadInstsPerBlockThreshold) ||
HandledDomBlocks.size() > SinkLoadBlocksThreshold) {
for (auto *DomBB : HandledDomBlocks) {
if (DomBB != BB && DT->dominates(DomBB, BB))
@@ -1279,7 +1279,7 @@ bool MachineSinking::SinkIntoCycle(MachineCycle *Cycle, MachineInstr &I) {
dbgs() << "CycleSink: Not sinking, sink block is the preheader\n");
return false;
}
- if (SinkBlock->size() > SinkLoadInstsPerBlockThreshold) {
+ if (SinkBlock->sizeWithoutDebugLargerThan(SinkLoadInstsPerBlockThreshold)) {
LLVM_DEBUG(
dbgs() << "CycleSink: Not Sinking, block too large to analyse.\n");
return false;