]> granicus.if.org Git - llvm/commit
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)
commit287bdc44592df31ff466aeeb873685acd4b78559
tree8dfd5c0e8923fe7348ef011fc5a0cbfe631d2514
parentcb06b587a242f677a42c9ea513678f5be9cf3be6
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285722 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BranchRelaxation.cpp