[PATCH] D33206: [DAG] Elide stores which are overwritten without being observed.

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 13:39:32 PDT 2017


rnk added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13132
     if (ST1->getBasePtr() == Ptr && ST->getMemoryVT() == ST1->getMemoryVT() &&
         ST1->getValue() == Value && ST->isUnindexed() && !ST->isVolatile() &&
         ST1->isUnindexed() && !ST1->isVolatile()) {
----------------
What do you think of moving this logic in here so that we don't need two ST1 dyn_casts? It'd look like:
    if (ST1->getBasePtr() == Ptr && ST->getMemoryVT() == ST1->getMemoryVT() &&
        ST->isUnindexed() && !ST->isVolatile() &&
        ST1->isUnindexed() && !ST1->isVolatile()) {
      if (ST1->getValue() == Value) { ... }
      else if (OptLevel != CodeGenOpt::None && ST1->hasOneUse() && !ST1->getPasePtr().isUndef()) { ... }
    }


https://reviews.llvm.org/D33206





More information about the llvm-commits mailing list