Skip to content

Commit 9a87b4d

Browse files
committed
Approved by Evan
$ svn merge -c 114220 https://llvm.org/svn/llvm-project/llvm/trunk --- Merging r114220 into '.': U lib/CodeGen/MachineCSE.cpp $ svn merge -c 114222 https://llvm.org/svn/llvm-project/llvm/trunk --- Merging r114222 into '.': G lib/CodeGen/MachineCSE.cpp llvm-svn: 114224
1 parent 4ab405d commit 9a87b4d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

llvm/lib/CodeGen/MachineCSE.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ namespace {
5454
AU.addPreserved<MachineDominatorTree>();
5555
}
5656

57+
virtual void releaseMemory() {
58+
ScopeMap.clear();
59+
Exps.clear();
60+
}
61+
5762
private:
5863
const unsigned LookAheadLimit;
5964
typedef ScopedHashTableScope<MachineInstr*, unsigned,
@@ -101,7 +106,7 @@ bool MachineCSE::PerformTrivialCoalescing(MachineInstr *MI,
101106
unsigned Reg = MO.getReg();
102107
if (!Reg || TargetRegisterInfo::isPhysicalRegister(Reg))
103108
continue;
104-
if (!MRI->hasOneUse(Reg))
109+
if (!MRI->hasOneNonDBGUse(Reg))
105110
// Only coalesce single use copies. This ensure the copy will be
106111
// deleted.
107112
continue;
@@ -469,6 +474,8 @@ bool MachineCSE::PerformCSE(MachineDomTreeNode *Node) {
469474
DenseMap<MachineDomTreeNode*, MachineDomTreeNode*> ParentMap;
470475
DenseMap<MachineDomTreeNode*, unsigned> OpenChildren;
471476

477+
CurrVN = 0;
478+
472479
// Perform a DFS walk to determine the order of visit.
473480
WorkList.push_back(Node);
474481
do {

0 commit comments

Comments
 (0)