[PATCH] D22652: GVH-hoist: only clone GEPs (PR28606)

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 21 14:56:35 PDT 2016


majnemer added inline comments.

================
Comment at: llvm/lib/Transforms/Scalar/GVNHoist.cpp:586
@@ -585,3 +585,3 @@
       Gep = dyn_cast<GetElementPtrInst>(St->getPointerOperand());
       Val = dyn_cast<Instruction>(St->getValueOperand());
     }
----------------
We could put the check here:
  ...
  GetElementPtrInst *Val = nullptr;
  if (auto *St = dyn_cast<StoreInst>(Repl)) {
    Gep = ...
    Val = dyn_cast<GetElementPtrInst>(St->getValueOperand());


https://reviews.llvm.org/D22652





More information about the llvm-commits mailing list