This is an archive of the discontinued LLVM Phabricator instance.

BranchRelaxation: Fix computing indirect branch block size
ClosedPublic

Authored by arsenm on Oct 11 2016, 10:41 PM.

Details

Diff Detail

Event Timeline

arsenm updated this revision to Diff 74325.Oct 11 2016, 10:41 PM
arsenm retitled this revision from to BranchRelaxation: Fix computing indirect branch block size.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
arsenm updated this revision to Diff 74360.Oct 12 2016, 4:37 AM

Fix new assertion failing on AArch64 due to updateTerminator modifying block sizes

arsenm updated this revision to Diff 74376.Oct 12 2016, 7:47 AM

Add test which would infinite loop before

nhaehnle added inline comments.Oct 14 2016, 1:31 AM
lib/CodeGen/BranchRelaxation.cpp
209–210

Is this comment still accurate?

231–241

I think just using OrigBB instead of MBB would help readability.

397–402

This doesn't seem to be affected by your change, but I'm a bit confused about not seeing anything to account for the size change in MBB due to the erased MI.

arsenm updated this revision to Diff 76512.Oct 31 2016, 5:46 PM
arsenm edited edge metadata.
arsenm marked 3 inline comments as done.

Address comments

arsenm added inline comments.Oct 31 2016, 5:47 PM
lib/CodeGen/BranchRelaxation.cpp
397–402

This is part of the change. I discovered that added/removed instruction size here is insufficient, since updateTerminator can also sneakily change the branch instructions.

nhaehnle accepted this revision.Nov 2 2016, 8:21 AM
nhaehnle added a reviewer: nhaehnle.

LGTM

This revision is now accepted and ready to land.Nov 2 2016, 8:21 AM
arsenm closed this revision.Nov 2 2016, 9:28 AM

r285828