1. [AArch64] Move the branch relaxation pass after BTI insertion (details)
Commit d91ea7fc6fd0cdd530e63c24db1d45253e1fdfdb by momchil.velikov
[AArch64] Move the branch relaxation pass after BTI insertion
Summary: Inserting BTI instructions can push branch destinations out of
The branch relaxation pass itself cannot insert indirect branches since
`TargetInstrInfo::insertIndirecrtBranch` is not implemented for AArch64
(guess +/-128 MB direct branch range is more than enough in practice).
Testing this is a bit tricky.
The original test case we have is 155kloc/6.1M. I've generated a test
case using this program:
int main() {
std::cout << R"src(int test(); void g0(), g1(), g2(), g3(), g4(), e();
void f(int v) {
if ((test() & 2) == 0) {
switch (v) {
case 0:
case 1:
case 2:
case 3:
  const int N = 8176;
  for (int i = 0; i < N; ++i)
   std::cout << "    void h" << i << "();\n";
for (int i = 0; i < N; ++i)
   std::cout << "    h" << i << "();\n";
  std::cout << R"src(
} else {
``` which is still a bit too much to commit as a regression test, IMHO.
Reviewers: t.p.northover, ostannard
Reviewed By: ostannard
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision:
Change-Id: Ide5c922bcde08ff4cf635da5e52365525a997a0a
The file was modifiedllvm/test/CodeGen/AArch64/O0-pipeline.ll
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetMachine.cpp
The file was addedllvm/test/CodeGen/AArch64/bti-branch-relaxation.ll
The file was modifiedllvm/test/CodeGen/AArch64/O3-pipeline.ll