diff options
author | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2020-01-20 21:56:09 +0100 |
---|---|---|
committer | Jonas Paulsson <paulsson@linux.vnet.ibm.com> | 2020-02-05 18:10:03 -0500 |
commit | 96ea377ea4d6d8cb304a2f5ad69fd33fd1fade6f (patch) | |
tree | bd09f36a1daead081cfcf7d95d08a72e89b9e4e1 /llvm/lib/CodeGen/MachineBasicBlock.cpp | |
parent | 5c15e8e682e365b3a7fcf35200df79f3fb93b924 (diff) | |
download | llvm-96ea377ea4d6d8cb304a2f5ad69fd33fd1fade6f.zip llvm-96ea377ea4d6d8cb304a2f5ad69fd33fd1fade6f.tar.gz llvm-96ea377ea4d6d8cb304a2f5ad69fd33fd1fade6f.tar.bz2 |
[PHIElimination] Compile time optimization for huge functions.
This is a compile-time optimization for PHIElimination (splitting of critical
edges), which was reported at https://bugs.llvm.org/show_bug.cgi?id=44249. As
discussed there, the way to remedy the slowdowns with huge functions is to
pre-compute the live-in registers for each MBB in an efficient way in
PHIElimination.cpp and then pass that information along to
LiveVariabless::addNewBlock().
In all the huge test programs where this slowdown has been noticable, it has
dissapeared entirely with this patch.
Review: Björn Pettersson, Quentin Colombet.
Differential Revision: https://reviews.llvm.org/D73152
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineBasicBlock.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index 1ef7867..ffa68aa 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -871,8 +871,9 @@ bool MachineBasicBlock::canFallThrough() { return getFallThrough() != nullptr; } -MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, - Pass &P) { +MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge( + MachineBasicBlock *Succ, Pass &P, + std::vector<SparseBitVector<>> *LiveInSets) { if (!canSplitCriticalEdge(Succ)) return nullptr; @@ -1003,7 +1004,10 @@ MachineBasicBlock *MachineBasicBlock::SplitCriticalEdge(MachineBasicBlock *Succ, } } // Update relevant live-through information. - LV->addNewBlock(NMBB, this, Succ); + if (LiveInSets != nullptr) + LV->addNewBlock(NMBB, this, Succ, *LiveInSets); + else + LV->addNewBlock(NMBB, this, Succ); } if (LIS) { |