[PATCH] IR: Do not canonicalize constant GEPs into an out-of-bounds array access

Amara Emerson amara.emerson at arm.com
Thu Nov 7 01:54:49 PST 2013


  Just some minor typos.

  Cheers,
  Amara


================
Comment at: lib/IR/ConstantFold.cpp:1943
@@ -1942,2 +1942,3 @@
 
-      if ((LastTy && isa<SequentialType>(LastTy)) || Idx0->isNullValue()) {
+      // We canont combine indicies if doing so would take us outside of an
+      // array or vector.  Doing otherwise could trick us if we evaluated such a
----------------
s/canont/cannot.

================
Comment at: lib/IR/ConstantFold.cpp:1959
@@ +1958,3 @@
+      //
+      // The following prohibts such a GEP from being formed by checking to see
+      // if the index is in-range with respect to an array or vector.
----------------
s/prohibts/prohibits


http://llvm-reviews.chandlerc.com/D2093



More information about the llvm-commits mailing list