[PATCH] D136201: [InstCombine] Handle PHI nodes when eliminating constant memcpy

Anshil Gandhi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 10:28:47 PST 2022


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


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:335-336
+          NewTy->getPointerAddressSpace()) {
+        V = AddrSpaceCastInst::CreatePointerBitCastOrAddrSpaceCast(
+            V, NewTy, V->getName(), NewPHI);
+        PtrCastInserted = true;
----------------
arsenm wrote:
> In general InstCombine can't introduce a new address space cast when one didn't exist in the first place 
If an incoming value is eligible to be replaced with a pointer from a different addrspace, other incoming values likely do not belong to the addrspace. This makes addrspacecast unavoidable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136201



More information about the llvm-commits mailing list