[llvm-commits] [poolalloc] r125063 - in /poolalloc/trunk: lib/DSA/DSGraph.cpp test/pa/clone/computeNodeMappingFail.ll

Arushi Aggarwal aggarwa4 at illinois.edu
Mon Feb 7 16:30:14 PST 2011


Author: aggarwa4
Date: Mon Feb  7 18:30:14 2011
New Revision: 125063

URL: http://llvm.org/viewvc/llvm-project?rev=125063&view=rev
Log:
reduced test case, that was triggering the assert in DSGraph.cpp.
Removed the assert, and added an if condition to handle the 
example correctly.

Added:
    poolalloc/trunk/test/pa/clone/computeNodeMappingFail.ll
Modified:
    poolalloc/trunk/lib/DSA/DSGraph.cpp

Modified: poolalloc/trunk/lib/DSA/DSGraph.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DSGraph.cpp?rev=125063&r1=125062&r2=125063&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/DSGraph.cpp (original)
+++ poolalloc/trunk/lib/DSA/DSGraph.cpp Mon Feb  7 18:30:14 2011
@@ -1364,11 +1364,12 @@
   // Modify the entry in the node map so that the DSNode from the first
   // DSNodeHandle is mapped to the second DSNodeHandle.
   //
-  assert(((signed int)(NH2.getOffset()-NH1.getOffset())>=0) && " Underflow error ");
+  // FIXME: AA:I am not sure what the right mapping for the
+  // following case is. I believe we do not need to create any 
+  // new mapping.
+  //assert(((signed int)(NH2.getOffset()-NH1.getOffset())>=0) && " Underflow error ");
   if(NH2.getOffset() >= NH1.getOffset()) {
     Entry.setTo(N2, NH2.getOffset()-NH1.getOffset());
-  } else {
-    Entry.setTo(N2, NH1.getOffset());
   }
 
   //

Added: poolalloc/trunk/test/pa/clone/computeNodeMappingFail.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/pa/clone/computeNodeMappingFail.ll?rev=125063&view=auto
==============================================================================
--- poolalloc/trunk/test/pa/clone/computeNodeMappingFail.ll (added)
+++ poolalloc/trunk/test/pa/clone/computeNodeMappingFail.ll Mon Feb  7 18:30:14 2011
@@ -0,0 +1,54 @@
+;This hits an assert in computeNodeMapping, when offset of merging node is greater than 1st node. 
+;RUN: paopt %s -paheur-AllButUnreachableFromMemory -poolalloc -o %t.bc |& grep "Pool allocating.*nodes!"
+;RUN: llvm-dis %t.bc -o %t.ll
+
+; ModuleID = 'bugpoint-reduced-simplified.bc'
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-unknown-linux-gnu"
+
+%struct.RefObj = type { i8*, %struct.TypeToken }
+%struct.TypeToken = type { i32, i16, i16 }
+
+define fastcc void @ImageTokenToRef(%struct.TypeToken* %Token, i32 %AttrNum, i32* %Status, i8** nocapture %RefObject) nounwind {
+entry:
+  %RefTkn = alloca %struct.TypeToken, align 8     ; <%struct.TypeToken*> [#uses=1]
+  br i1 undef, label %bb13, label %bb
+
+bb:                                               ; preds = %entry
+  unreachable
+
+bb13:                                             ; preds = %entry
+  br i1 undef, label %bb14, label %bb33
+
+bb14:                                             ; preds = %bb13
+  br i1 undef, label %bb15, label %bb21
+
+bb15:                                             ; preds = %bb14
+  br i1 undef, label %bb17, label %KernelGetAttr.exit
+
+KernelGetAttr.exit:                               ; preds = %bb15
+  unreachable
+
+bb17:                                             ; preds = %bb15
+  %tmp62 = call fastcc i32 @ImageGetObject(%struct.TypeToken* %RefTkn, i32* %Status, i8** %RefObject) nounwind ; <i32> [#uses=0]
+  unreachable
+
+bb21:                                             ; preds = %bb14
+  br i1 undef, label %bb23, label %KernelGetAttr.exit42
+
+KernelGetAttr.exit42:                             ; preds = %bb21
+  unreachable
+
+bb23:                                             ; preds = %bb21
+  %tmp72 = getelementptr inbounds %struct.RefObj* undef, i64 0, i32 1 ; <%struct.TypeToken*> [#uses=1]
+  %tmp85 = call fastcc i32 @ImageGetObject(%struct.TypeToken* %tmp72, i32* %Status, i8** %RefObject) nounwind ; <i32> [#uses=0]
+  unreachable
+
+bb33:                                             ; preds = %bb13
+  ret void
+}
+
+define fastcc i32 @ImageGetObject(%struct.TypeToken* %Token, i32* %Status, i8** nocapture %This) nounwind {
+entry:
+  unreachable
+}





More information about the llvm-commits mailing list