[PATCH] D34335: Fix invalid ptrtoint in InstCombine

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 26 20:22:34 PDT 2017


majnemer added inline comments.


================
Comment at: lib/Analysis/Loads.cpp:385-395
+          if (PointerType *Ty2 = dyn_cast<PointerType>(LI->getType())) {
+            if (Ty1->getAddressSpace() != Ty2->getAddressSpace()) {
+              return nullptr;
+            }
+          }
+          else if (DL.isNonIntegralPointerType(Ty1)) {
+            return nullptr;
----------------
Please fix the formatting.


================
Comment at: lib/Analysis/Loads.cpp:417-428
+        if (AccessTy->isPointerTy()) {
+          PointerType *Ty1 = cast<PointerType>(AccessTy);
+          if (PointerType *Ty2 = dyn_cast<PointerType>(SI->getValueOperand()->getType())) {
+            if (Ty1->getAddressSpace() != Ty2->getAddressSpace()) {
+              return nullptr;
+            }
+          }
----------------
Ditto.


https://reviews.llvm.org/D34335





More information about the llvm-commits mailing list