[all-commits] [llvm/llvm-project] 3a8372: [DSE] Support traversing MemoryPhis.

Florian Hahn via All-commits all-commits at lists.llvm.org
Fri Mar 20 00:55:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3a8372ed02abe9ce6c82d12dbec3f5eed2d3a5f0
      https://github.com/llvm/llvm-project/commit/3a8372ed02abe9ce6c82d12dbec3f5eed2d3a5f0
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-03-20 (Fri, 20 Mar 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
    M llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-exceptions.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-loops.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-memoryphis.ll
    M llvm/test/Transforms/DeadStoreElimination/MSSA/multiblock-simple.ll

  Log Message:
  -----------
  [DSE] Support traversing MemoryPhis.

For MemoryPhis, we have to avoid that the MemoryPhi may be executed
before before the access we are currently looking at.

To do this we do a post-order numbering of the basic blocks in the
function and bail out once we reach a MemoryPhi with a larger (or equal)
post-order block number than the current MemoryAccess.
This changes the order in which we visit stores for elimination.

This patch also adds support for exploring multiple paths. We keep a worklist (ToCheck) of memory accesses that might be eliminated by our starting MemoryDef or MemoryPhis for further exploration.  For MemoryPhis, we add the incoming values to the worklist, for MemoryDefs we add the defining access.

Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D72148




More information about the All-commits mailing list