[PATCH] D16302: [opaque pointer types] [NFC] Take advantage of get{Source, Result}ElementType when folding GEPs.

Manuel Jacob via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 15:24:22 PST 2016


mjacob accepted this revision.
mjacob added a comment.
This revision is now accepted and ready to land.

LGTM


================
Comment at: lib/Analysis/ConstantFolding.cpp:743-744
@@ -733,6 +742,4 @@
   Constant *Ptr = Ops[0];
   assert(Ptr->getType()->isPointerTy());
-  if (!Ptr->getType()->getPointerElementType()->isSized())
-    return nullptr;
 
   Type *IntPtrTy = DL.getIntPtrType(Ptr->getType());
----------------
Actually `Ptr` can also be a vector of pointers here. I have reverted the commit in which I moved this check to an assertion. When merging / rebasing, make sure to include the `isPointerTy()` check, but *not* the assertion.


http://reviews.llvm.org/D16302





More information about the llvm-commits mailing list