[all-commits] [llvm/llvm-project] 57ad3f: [LoongArch] Add support for the BranchRelaxation pass

Xiaodong Liu via All-commits all-commits at lists.llvm.org
Tue Nov 8 03:27:28 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 57ad3f1dc63890c96e9c1565489e1da65b0fb032
      https://github.com/llvm/llvm-project/commit/57ad3f1dc63890c96e9c1565489e1da65b0fb032
  Author: Xiaodong Liu <liuxiaodong at loongson.cn>
  Date:   2022-11-08 (Tue, 08 Nov 2022)

  Changed paths:
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
    M llvm/lib/Target/LoongArch/LoongArchInstrInfo.h
    M llvm/lib/Target/LoongArch/LoongArchTargetMachine.cpp
    M llvm/test/CodeGen/LoongArch/analyze-branch.ll
    A llvm/test/CodeGen/LoongArch/branch-relaxation.ll
    M llvm/test/CodeGen/LoongArch/exception-pointer-register.ll
    M llvm/test/CodeGen/LoongArch/jump-table.ll
    M llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.generated.expected
    M llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.nogenerated.expected

  Log Message:
  -----------
  [LoongArch] Add support for the BranchRelaxation pass

When the branch target is out of the range represented by the current
branch instruction's immediate, branch relaxation is required. There
are three types of immediate for branch instructions on LoongArch,
including simm16, simm21 and simm26. And the real branch target
address is PC + sext(simmXX << 2). In addition, the indirect branch
way is implemented to support larger branch target.

BranchRelaxation pass calls `RenumberBlocks` to renumber all of the
machine basic blocks in the function. So the machine basic blocks
number changed in some test cases.

Differential Revision: https://reviews.llvm.org/D137233




More information about the All-commits mailing list