[PATCH] D27389: ConstantFolding: Don't crash when encountering vector GEP
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 12:10:43 PST 2016
majnemer accepted this revision.
majnemer added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: lib/Analysis/ConstantFolding.cpp:735-736
Type *IntPtrTy = DL.getIntPtrType(ResultTy);
+ Type *IntPtrScalarTy =
+ IntPtrTy->isVectorTy() ? IntPtrTy->getScalarType() : IntPtrTy;
----------------
I believe this can be simplified to `IntPtrScalarTy = IntPtrTy->getScalarType();`
https://reviews.llvm.org/D27389
More information about the llvm-commits
mailing list