BranchRelaxation: Expand unconditional branches first
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Nov 2016 18:34:00 +0000 (18:34 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Nov 2016 18:34:00 +0000 (18:34 +0000)
commitcb578f84e091e9198b25c687d0f5f1dc558f27c5
treeeabbc54a43a78c21d23dcf5db4a55197ced67b22
parent90c117a61b7e061c837cfb625fe0b1d1bc51707a
BranchRelaxation: Expand unconditional branches first

It's likely if a conditional branch needs to be expanded, the following
unconditional branch will also need expansion. By expanding the
unconditional branch first, the conditional branch can be simply
inverted to jump over the inserted indirect branch block. If the
conditional branch is expanded first, it results in an additional
branch.

This avoids test regressions in future commits.

llvm-svn: 285722
llvm/lib/CodeGen/BranchRelaxation.cpp