[llvm] [DSE] Refactor DSE (PR #100956)

Haopeng Liu via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 10:41:03 PDT 2024


haopliu wrote:

> with just this patch, it's still one MemoryLocation per MemoryDef. can we keep that assumption for now in this PR? and then make the change in the initializes DSE patch

It's correct! With this PR, we still keep one MemoryLocation per MemoryDef.
See `assert(DefinedLocations.size() == 1 && "Expected a single defined location");`
This PR only refactors and aims to be equivalent to the existing implementation.

> also, the dependency cycle between Memory*Wrapper and DSEState is awkward, is it possible to keep the `eliminateDeadDefs()` implementations as part of DSEState?

We can do that to avoid the dependency cycle. DSEState is a big struct (1300 lines of code). Is it ok to continue adding code in this struct?



https://github.com/llvm/llvm-project/pull/100956


More information about the llvm-commits mailing list