[PATCH] D58226: [InferAddressSpaces] Prevent crash on nested ConstantExpr
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 14 16:50:41 PST 2019
arsenm added inline comments.
================
Comment at: lib/Transforms/Scalar/InferAddressSpaces.cpp:323-324
if (isAddressExpression(*V) &&
V->getType()->getPointerAddressSpace() == FlatAddrSpace) {
if (Visited.insert(V).second) {
----------------
arsenm wrote:
> arsenm wrote:
> > I think this is a broader problem with vectors of pointers. This should maybe be checking this is a scalar pointer instead?
> I think this might be the wrong place. isAddressExpression should probably be doing the type check for the select case, since the other operations imply pointers (except PHI. I imagine you can craft another test case that fails with them)
>
This will only happen for constant expressions, so phi isn't an issue. Can you move the type check into the case for select, and assert the phi is a pointer type in isAddressExpression?
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58226/new/
https://reviews.llvm.org/D58226
More information about the llvm-commits
mailing list