[BranchRelaxation] Simplify offset computation and fix a bug in adjustBlockOffsets()
authorFangrui Song <i@maskray.me>
Sun, 19 Jan 2020 22:53:45 +0000 (14:53 -0800)
committerFangrui Song <maskray@google.com>
Mon, 20 Jan 2020 00:02:16 +0000 (16:02 -0800)
commit886d2c2ca75f01b5a094c160aee911a04421dd56
treed916bce68f95c494729860bab3ce6afa2f33727e
parenta7818e6f29c136bfe60ce7af0ac3c35b5d9da7d6
[BranchRelaxation] Simplify offset computation and fix a bug in adjustBlockOffsets()

If Start!=0, adjustBlockOffsets() may unnecessarily adjust the offset of
Start. There is no correctness issue, but it can create more block
splits.
llvm/lib/CodeGen/BranchRelaxation.cpp
llvm/test/CodeGen/AArch64/branch-relax-bcc.ll
llvm/test/CodeGen/AMDGPU/branch-relaxation.ll