PR24426 fix proposal

Jakub Staszak via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 4 15:28:05 PDT 2015


This very simple patch fixes PR24426.

I am not sure if this is the right approach, so let me introduce the current situation.

If the pr24426.ll test is run with -memcpyopt -mldst-motion -gvn it goes as follows:

* MemCpyOpt requires both DomTree(DominatorTreeWrapperPass) and MemDep(MemoryDependenceAnalysis)
* MemDep uses DomTree but it doesn't require it (it uses it thru getIfAvaialable)
* MemCpy preserves CFG (so it preserves DomTree) and MemDep
* LoadStoreMotion preserves MemDep, but not DomTree
* DomTree is reset, however MemDep still keep reference to it  <- very bad
* GVN requires both DomTree and MemDep, so it gets the _new_ version of DomTree however old version of MemDep (with invalid DomTree).

This patch adds preservation of CFG in LoadStoreMotion, so DomTree doesn't get invalidated.

Best,
Kuba

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr24426.patch
Type: application/octet-stream
Size: 1140 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151004/5d93f0b7/attachment.obj>


More information about the llvm-commits mailing list