From afe358e7d46da9d29ba02fbbf81bdfb4ac4a4520 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Wed, 24 May 2006 20:46:25 +0000 Subject: [PATCH] Clear HandleMap and ReplaceMap after instruction selection. Or it may cause non-deterministic behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28454 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMISelDAGToDAG.cpp | 2 ++ lib/Target/Alpha/AlphaISelDAGToDAG.cpp | 2 ++ lib/Target/IA64/IA64ISelDAGToDAG.cpp | 2 ++ lib/Target/PowerPC/PPCISelDAGToDAG.cpp | 2 ++ lib/Target/Sparc/SparcISelDAGToDAG.cpp | 2 ++ lib/Target/X86/X86ISelDAGToDAG.cpp | 2 ++ 6 files changed, 12 insertions(+) diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp index 7cf7dd37a4a..b3ee0d17e3d 100644 --- a/lib/Target/ARM/ARMISelDAGToDAG.cpp +++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp @@ -161,6 +161,8 @@ void ARMDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { DAG.setRoot(SelectRoot(DAG.getRoot())); CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); ScheduleAndEmitDAG(DAG); diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp index 772da03ac48..8126c33b383 100644 --- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp +++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp @@ -155,6 +155,8 @@ void AlphaDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB. diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp index e6ed9f9fa61..6ac8ad68c0e 100644 --- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp +++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp @@ -148,6 +148,8 @@ void IA64DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB. diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp index c164020ecaa..9e22f1145b7 100644 --- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp +++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp @@ -206,6 +206,8 @@ void PPCDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB. diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp index 25f6e234a2f..19df27e27ad 100644 --- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp +++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp @@ -996,6 +996,8 @@ void SparcDAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { // Select target instructions for the DAG. DAG.setRoot(SelectRoot(DAG.getRoot())); CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB. diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index b53748ab75d..af28f830db2 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -186,6 +186,8 @@ void X86DAGToDAGISel::InstructionSelectBasicBlock(SelectionDAG &DAG) { DEBUG(std::cerr << "===== Instruction selection ends:\n"); #endif CodeGenMap.clear(); + HandleMap.clear(); + ReplaceMap.clear(); DAG.RemoveDeadNodes(); // Emit machine code to BB.