[PATCH] D75660: Remove CompositeType class
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 17 10:44:05 PDT 2020
sdesmalen added inline comments.
================
Comment at: llvm/lib/IR/Instructions.cpp:1621
+ if (auto Sequential = dyn_cast<SequentialType>(Ty)) {
+ if (!Idx->getType()->isIntOrIntVectorTy())
+ return nullptr;
----------------
efriedma wrote:
> sdesmalen wrote:
> > Maybe I'm misunderstanding this method, but checking that the indexed type is of type integer, does that exclude the case:
> > ```getelementptr float, float* %ptr, i64 0```
> > ?
> The point of the isIntOrIntVectorTy() check is to exclude something silly like a float index into an array. It has nothing to do with the type of the pointer.
Right, it's calling isIntOrIntVectorTy on the Idx, not Ty, I misread that.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75660/new/
https://reviews.llvm.org/D75660
More information about the llvm-commits
mailing list