[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 13:47:11 PDT 2019


arsenm marked an inline comment as done.
arsenm added inline comments.


================
Comment at: lib/Transforms/Scalar/SROA.cpp:1588
+    Ptr = IRB.CreatePointerBitCastOrAddrSpaceCast(Ptr, PointerTy,
+                                                  NamePrefix + "sroa_cast");
+  }
----------------
arsenm wrote:
> efriedma wrote:
> > Why do we want to generate an address-space cast here, as opposed to performing the memory operation using the alloca's natural address-space?
> You're right, this is unnecessary
This is actually necessary in some cases. (e.g. in select_addrspacecast_const_op, without this, the two operands of the select end up as different types)


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

https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list