[llvm-commits] [poolalloc] r159480 - in /poolalloc/trunk: lib/DSA/Local.cpp test/dsa/regression/2012-04-29.StructOOBIndex.ll

Will Dietz wdietz2 at illinois.edu
Fri Jun 29 20:23:19 PDT 2012


Author: wdietz2
Date: Fri Jun 29 22:23:19 2012
New Revision: 159480

URL: http://llvm.org/viewvc/llvm-project?rev=159480&view=rev
Log:
Local: Collapse node if trying to GEP past size of the node.

We did this already for most cases, but this change has us using
the resulting total offset for the check, not just the incremental
offset incurred by this GEP.

This matters when the out-of-bounds struct indexing is done via
chained GEP's, as in 2012-04-29.StructOOBIndex.ll, which is now fixed.

FWIW this results in zero changed behavior (no additional nodes collapsed)
  across all of CINT2000/CINT2006, other than not crashing on 483.xalancbmk.

Modified:
    poolalloc/trunk/lib/DSA/Local.cpp
    poolalloc/trunk/test/dsa/regression/2012-04-29.StructOOBIndex.ll

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=159480&r1=159479&r2=159480&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Fri Jun 29 22:23:19 2012
@@ -804,6 +804,7 @@
 
   // Check the offset
   DSNode *N = Value.getNode();
+  Offset = Value.getOffset();
   if (N &&
       !N->isNodeCompletelyFolded() &&
       (N->getSize() != 0 || Offset != 0) &&

Modified: poolalloc/trunk/test/dsa/regression/2012-04-29.StructOOBIndex.ll
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/test/dsa/regression/2012-04-29.StructOOBIndex.ll?rev=159480&r1=159479&r2=159480&view=diff
==============================================================================
--- poolalloc/trunk/test/dsa/regression/2012-04-29.StructOOBIndex.ll (original)
+++ poolalloc/trunk/test/dsa/regression/2012-04-29.StructOOBIndex.ll Fri Jun 29 22:23:19 2012
@@ -1,7 +1,6 @@
 ; OOB indexing example reduced from 483.xalancbmk
 ;RUN: dsaopt %s -dsa-local -disable-output
 ;RUN: dsaopt %s -dsa-bu -disable-output
-;XFAIL: *
 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-S128"
 target triple = "x86_64-unknown-linux-gnu"
 





More information about the llvm-commits mailing list