This is an archive of the discontinued LLVM Phabricator instance.

BranchRelaxation: Fix handling of blocks with multiple conditional branches
ClosedPublic

Authored by arsenm on Aug 10 2016, 3:11 PM.

Details

Reviewers
t.p.northover
Summary

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.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 67616.Aug 10 2016, 3:11 PM
arsenm retitled this revision from to BranchRelaxation: Fix handling of blocks with multiple conditional branches.
arsenm updated this object.
arsenm added a reviewer: t.p.northover.
arsenm added a subscriber: llvm-commits.
t.p.northover accepted this revision.Aug 16 2016, 10:11 AM
t.p.northover edited edge metadata.

This is pretty scary, I didn't know we blocks with 3 terminators. Looks like a reasonable fix for the uncommon case though.

This revision is now accepted and ready to land.Aug 16 2016, 10:11 AM
arsenm closed this revision.Aug 22 2016, 6:39 PM

r279499