[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

Evan Cheng evan.cheng at apple.com
Thu Jul 27 15:35:58 PDT 2006



Changes in directory llvm/lib/Target/X86:

X86ISelDAGToDAG.cpp updated: 1.78 -> 1.79
---
Log message:

Allocating too large an array for ReachibilityMatrix.

---
Diffs of the changes:  (+5 -2)

 X86ISelDAGToDAG.cpp |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
diff -u llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.78 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.79
--- llvm/lib/Target/X86/X86ISelDAGToDAG.cpp:1.78	Thu Jul 27 17:10:00 2006
+++ llvm/lib/Target/X86/X86ISelDAGToDAG.cpp	Thu Jul 27 17:35:40 2006
@@ -281,8 +281,11 @@
 void X86DAGToDAGISel::DeterminReachibility(SDNode *f, SDNode *t) {
   if (!ReachibilityMatrix) {
     DetermineTopologicalOrdering();
-    ReachibilityMatrix = new unsigned char[DAGSize * DAGSize];
-    memset(ReachibilityMatrix, 0, DAGSize * DAGSize * sizeof(unsigned char));
+    unsigned RMSize = DAGSize * DAGSize / 8;
+    if ((DAGSize * DAGSize) % 8)
+      RMSize++;
+    ReachibilityMatrix = new unsigned char[RMSize];
+    memset(ReachibilityMatrix, 0, RMSize);
   }
 
   int Idf = f->getNodeId();






More information about the llvm-commits mailing list