[LoongArch] Implement branch analysis
authorwanglei <wanglei@loongson.cn>
Tue, 9 Aug 2022 05:53:34 +0000 (13:53 +0800)
committerWeining Lu <luweining@loongson.cn>
Tue, 9 Aug 2022 06:03:09 +0000 (14:03 +0800)
commit8716513e65c4e8eb0530579e3a15e44de88c3b9a
tree2a7923f890648349af9361e216eb06f334ce0025
parentf35cb7ba344b4de654c78f8a8d63a455e52588aa
[LoongArch] Implement branch analysis

This allows a number of optimisation passes to work.
E.g. BranchFolding and MachineBlockPlacement.

Differential Revision: https://reviews.llvm.org/D131316
llvm/lib/Target/LoongArch/LoongArchInstrInfo.cpp
llvm/lib/Target/LoongArch/LoongArchInstrInfo.h
llvm/test/CodeGen/LoongArch/analyze-branch.ll [new file with mode: 0644]
llvm/test/CodeGen/LoongArch/ir-instruction/br.ll
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.generated.expected
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/loongarch_generated_funcs.ll.nogenerated.expected