BranchRelaxation: Fix handling of blocks with multiple conditional
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 23 Aug 2016 01:30:30 +0000 (01:30 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 23 Aug 2016 01:30:30 +0000 (01:30 +0000)
commit567631bdd407a556afb0ed8b0dc57f963f7e366e
tree4ba51ff2f9e6f052d27aae6b4bccd2d56ea9fae1
parent3721837d8941e39ee3fa28e8e8a4d66629517131
BranchRelaxation: Fix handling of blocks with multiple conditional
branches

Looping over all terminators exposed AArch64 tests hitting
an assert from analyzeBranch failing. I believe these cases
were miscompiled before.

e.g.
  fcmp s0, s1
  b.ne LBB0_1
  b.vc LBB0_2
  b LBB0_2
LBB0_1:
  ; Large block
LBB0_2:
 ; ...

Both of the individual conditional branches need to
be expanded, since neither can reach the final block.

Split the original block into ones which analyzeBranch
will be able to understand.

llvm-svn: 279499
llvm/lib/Target/AArch64/AArch64BranchRelaxation.cpp
llvm/test/CodeGen/AArch64/branch-relax-bcc.ll