[PATCH] Teach ScalarEvolution about pointer address spaces

Quentin Colombet qcolombet at apple.com
Tue Aug 27 11:29:52 PDT 2013


  Hi Matt,

  Globally LGTM, but I am not the right person to give the all green signal :).
  Hereafter are a few minor fixes.

  Cheers,
  -Quentin


================
Comment at: lib/Analysis/ScalarEvolution.cpp:2630
@@ -2628,3 +2629,3 @@
   // This is just a compile-time optimization.
-  if (TD)
-    return getConstant(TD->getIntPtrType(getContext()),
+  if (TD) {
+    return getConstant(IntTy,
----------------
You do not want to add brackets here.

================
Comment at: lib/Analysis/ScalarEvolution.cpp:2715
@@ -2711,3 +2714,3 @@
 
-  if (Ty->isIntegerTy())
+  if (Ty->isIntegerTy()) {
     return Ty;
----------------
Ditto.

================
Comment at: lib/Analysis/ScalarEvolutionExpander.cpp:422
@@ +421,3 @@
+                 ? SE.TD->getIntPtrType(PTy)
+                 : Type::getInt64Ty(PTy->getContext());
+
----------------
I think it may not hurt to (re)put a comment like this:
// Without DataLayout, conservatively assume pointers are 64-bit.


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



More information about the llvm-commits mailing list