[MemorySSA] Make sure PerformedPhiTrans is updated for each visited def.
authorFlorian Hahn <flo@fhahn.com>
Mon, 14 Sep 2020 14:51:17 +0000 (15:51 +0100)
committerFlorian Hahn <flo@fhahn.com>
Mon, 14 Sep 2020 15:11:56 +0000 (16:11 +0100)
commitc4f1b3144184e4c276a7e7c801cbcd4ac3c573ba
tree2fc4f00b7b4ea2435082fb88b26c68fff7b40db9
parentf07f3c72375b872bfb988f7531d4e0485233ade1
[MemorySSA] Make sure PerformedPhiTrans is updated for each visited def.

1ce82015f6d0 added a fix to restrict phi optimizations after phi
translations. But the current use of performedPhiTranslation only
checked whether phi translation happened for the first iterator and
missed cases where phi translations happens at subsequent
iterators/upwards defs.

This patch changes upward_defs_iteartor to take a pointer to a bool, so
we can easily ensure the final value includes all visited defs, while
still being able to conveniently use it with make_range & co.
llvm/include/llvm/Analysis/MemorySSA.h
llvm/lib/Analysis/MemorySSA.cpp
llvm/test/Analysis/MemorySSA/phi-translation.ll