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

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 00:27:35 PST 2022


jmmartinez added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:62
 
-      if (isa<BitCastInst>(I) || isa<AddrSpaceCastInst>(I)) {
+      if (isa<BitCastInst>(I) || isa<AddrSpaceCastInst>(I) || isa<PHINode>(I)) {
         // If uses of the bitcast are ok, we are ok.
----------------
Cosmetic review: What do you think about using the varadic template version of `isa` ? You could collapse this into `isa<BitCastInst, AddrSpaceCastInst, PHINode>(I)`


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