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

Anshil Gandhi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 14:13:37 PST 2022


gandhi21299 updated this revision to Diff 476602.
gandhi21299 added a comment.

If an alloca has a PHI use which happens to be an ancestor of a memtransfer 
instruction, then we cannot determine at compile time whether the result of the 
PHI is the alloca or an alternative incoming value. As a result, either the 
source or the destination is indeterminate. I added a third variable to 
`ValuesToInspect`, to track whether we have already seen a PHI.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136201

Files:
  llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  llvm/test/Transforms/InstCombine/replace-alloca-phi.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136201.476602.patch
Type: text/x-patch
Size: 15175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221118/023f8167/attachment.bin>


More information about the llvm-commits mailing list