[GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate.
authorAmara Emerson <aemerson@apple.com>
Wed, 1 Aug 2018 02:17:42 +0000 (02:17 +0000)
committerAmara Emerson <aemerson@apple.com>
Wed, 1 Aug 2018 02:17:42 +0000 (02:17 +0000)
commit6cdfe29d8efaa6987fe708963d65096689f72b14
treec625d2abda5c115e746e7b4c820ba02ca0e445a4
parentc8e84ff25115ed0da2d6e3a81eac40712b467258
[GlobalISel][IRTranslator] Use RPO traversal when visiting blocks to translate.

Previously we were just visiting the blocks in the function in IR order, which
is rather arbitrary. Therefore we wouldn't always visit defs before uses, but
the translation code relies on this assumption in some places.

Only codegen change seen in tests is an elision of a redundant copy.

Fixes PR38396

llvm-svn: 338476
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll
llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-block-order.ll [new file with mode: 0644]