[PATCH] D58226: [InferAddressSpaces] Prevent crash on nested ConstantExpr

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 14 07:35:04 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) {
----------------
I think this is a broader problem with vectors of pointers. This should maybe be checking this is a scalar pointer instead?


================
Comment at: test/Transforms/InferAddressSpaces/AMDGPU/infer-address-space.ll:171
 
+; CHECK-LABEL: @select_bug(
+; CHECK: %add.ptr157 = getelementptr inbounds <2 x i64>, <2 x i64>* undef, i64 select (i1 icmp ne (i32* inttoptr (i64 4873 to i32*), i32* null), i64 73, i64 93)
----------------
I think this is really a vector of pointers bug


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