summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-06-22 16:38:38 +0000
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>2018-06-22 16:38:38 +0000
commit358a916aa830e2455913cedc07d5ad6d71a785f5 (patch)
tree9dbda783706438c835dc31f4e85d9b89d365c25f /llvm/lib/CodeGen/BranchFolding.cpp
parent9d3ef8ee2b5fd95de90d704a07dc6a5374065f0c (diff)
downloadbcm5719-llvm-358a916aa830e2455913cedc07d5ad6d71a785f5.tar.gz
bcm5719-llvm-358a916aa830e2455913cedc07d5ad6d71a785f5.zip
Initialize LiveRegs once in BranchFolder::mergeCommonTails
llvm-svn: 335365
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 0787ca552d8..c7a0c645716 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -921,11 +921,12 @@ void BranchFolder::mergeCommonTails(unsigned commonTailIndex) {
if (UpdateLiveIns) {
LivePhysRegs NewLiveIns(*TRI);
computeLiveIns(NewLiveIns, *MBB);
+ LiveRegs.init(*TRI);
// The flag merging may lead to some register uses no longer using the
// <undef> flag, add IMPLICIT_DEFs in the predecessors as necessary.
for (MachineBasicBlock *Pred : MBB->predecessors()) {
- LiveRegs.init(*TRI);
+ LiveRegs.clear();
LiveRegs.addLiveOuts(*Pred);
MachineBasicBlock::iterator InsertBefore = Pred->getFirstTerminator();
for (unsigned Reg : NewLiveIns) {
OpenPOWER on IntegriCloud