[PATCH] D38546: [ConstantFolding] Avoid assert when folding ptrtoint of vectorized GEP

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 4 09:01:45 PDT 2017


bjope added inline comments.


================
Comment at: lib/IR/ConstantFold.cpp:623
   case Instruction::PtrToInt:   // always treated as unsigned
+    if (V->getType()->isVectorTy())
+      return nullptr;
----------------
Should this perhaps go below the V->isNullValue() check?
(I could not see that isNullValue() will be true for a vector of null pointers, and I am not sure that the ConstantInt::get(DestTy, 0) would be correct if DestTy is a vector. So I did put the check here before the isNullValue() check.)





https://reviews.llvm.org/D38546





More information about the llvm-commits mailing list