[PATCH] [OPENMP] llvm.loop.vectorize.enable metadata are lost after critical edge splitting

Johannes Doerfert doerfert at cs.uni-saarland.de
Tue Sep 30 16:02:15 PDT 2014


>>! In D5539#15, @atrick wrote:
> Is it incorrect to leave the loop metadata on the original branch when splitting the edge?
Yes, sometimes. At least if you considere llvm.loop metadata on non loop backedges to be invalid.

> GVN already requires DomTree, so no change to the pipeline is needed if you use it.
We could implement the handling of metadata for both cases, if DomTree or LoopInfo are accessable via the Pass * given, then we do not need to change GVN.

> In splitCriticalEdges, if LoopInfo is available you can use it. Otherwise you can use the DomTree. If the DomTree check fails (ie. both targets dominate the latch) then just invalidate the metadata.
I could update my patch if we decide to go this way. It would probably require the least change outside the actual SplitCriticalEdge function.

> I think there is a fundamental problem with the metadata design--it's ridiculous to assume that any pass that splits critical edges has LoopInfo--but that should at least workaround your problem. 
True, but some analysis is needed in order to preserve the metadata in a meaningful way and we always can invalide it as a fallback.

http://reviews.llvm.org/D5539






More information about the llvm-commits mailing list