& Tarjan͕ޮతͳΞϧΰϦζϜΛൃݟ ✴ ࢀߟ ‣ ΦϦδφϧจ: “A Fast Algorithm for Finding Dominators in a Flowgraph” ‣ sigma͞Μͷϒϩά: http://sigma425.hatenablog.com/ entry/2015/12/25/224053 2
ͷdominatorͱͯ͠ɺϧʔϓͷͳ͍ύε(1) ͱ(2) ͕ଘࡏ͢ΔͱԾఆ͢Δɻ (1)ΑΓ ͔Β Λ௨Βͣʹ ʹ౸ୡͰ͖Δ͕ɺ͜Εͱ(2)ΑΓ ͕dominatorͰ͋Δ͜ͱʹໃ६ɻ ✴ ͜ΕʹΑͬͯdominatorͳ͍ͷશॱং͕ఆٛͰ͖Δ r − v v a, b v r − a − b − v r − b − a − v b a v a 11
֤Λফͨ͠άϥϑͰ ͔ΒdfsͳͲͰ౸ୡఆ͢Δ͜ ͱͰɺ ௨Γͷdominate͕ؔΘ͔Δ 2. ֤ʹ͍ͭͯɺ1Λ༻͍ͯimmediate dominatorΛٻΊ Δɻ͜ΕdominatorͰͦͷଞͷdominatorશͯʹ dominate͞Ε͍ͯΔͷͰ͋Δ d v ⇔ d r v O(nm) r n2 17