[PATCH] D119306: InferAddressSpaces: Fix assert on inferred source for inttoptr/ptrtoint

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 9 12:52:58 PST 2022


jdoerfert added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:667
+
+    return new BitCastInst(Src, NewPtrType);
   }
----------------
Doesn't this break if we require both, an AS and a bitcast?
Wouldn't `BitCastInst::CreatePointerBitCastOrAddrSpaceCast` be a more generic (and shorter) choice here?


================
Comment at: llvm/test/Transforms/InferAddressSpaces/AMDGPU/issue53665.ll:47
+  ret i32 %load
+}
+
----------------
I don't see the difference between this one and the first function. AS 1 vs 3?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119306/new/

https://reviews.llvm.org/D119306



More information about the llvm-commits mailing list