[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:32:22 PST 2019


arsenm added a comment.

I misread the test case, this isn't a vector of pointers. If you can simplify the test by removing the vectors, that would be slightly better.



================
Comment at: lib/Transforms/Scalar/InferAddressSpaces.cpp:323-324
 
   if (isAddressExpression(*V) &&
       V->getType()->getPointerAddressSpace() == FlatAddrSpace) {
     if (Visited.insert(V).second) {
----------------
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)



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