[MachineVerifier][GlobalISel] Check that branches have a MBB operand or are declared...
authorDominik Montada <dominik.montada@hightec-rt.com>
Wed, 10 Jun 2020 15:15:09 +0000 (17:15 +0200)
committerDominik Montada <dominik.montada@hightec-rt.com>
Mon, 15 Jun 2020 09:17:09 +0000 (11:17 +0200)
commitc87bf29149598d6dd24470fe3c22dbd40f215dcb
treec9ea144ed15dfdd01f20747e62ecc961bce9b27c
parent9e4f674888d6664d27aae31767f397595b1e2566
[MachineVerifier][GlobalISel] Check that branches have a MBB operand or are declared indirect. Add missing properties to G_BRJT, G_BRINDIRECT

Summary:
Teach MachineVerifier to check branches for MBB operands if they are not declared indirect.

Add `isBarrier`, `isIndirectBranch` to `G_BRINDIRECT` and `G_BRJT`.
Without these, `MachineInstr.isConditionalBranch()` was giving a
false-positive for those instructions.

Reviewers: aemerson, qcolombet, dsanders, arsenm

Reviewed By: dsanders

Subscribers: hiraditya, wdng, simoncook, s.egerton, arsenm, rovka, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81587
llvm/include/llvm/Target/GenericOpcodes.td
llvm/lib/CodeGen/MachineVerifier.cpp
llvm/test/CodeGen/AArch64/GlobalISel/legalize-blockaddress.mir
llvm/test/CodeGen/AArch64/GlobalISel/select-blockaddress.mir
llvm/test/MachineVerifier/test_g_brindirect_is_indirect_branch.mir [new file with mode: 0644]
llvm/test/MachineVerifier/test_g_brjt_is_indirect_branch.mir [new file with mode: 0644]