OSDN Git Service

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)
commit5f3b1be4e177f0f4cb6a5d8510b3b1e0b2767770
tree1c018f7ad5006f4fa2f43b696141d6d7445e472c
parentcf0122b23f19eb80de607647e4a62b8830e4a6bd
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279499 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AArch64/AArch64BranchRelaxation.cpp
test/CodeGen/AArch64/branch-relax-bcc.ll