[AArch64][GlobalISel] Constrain reg operands in selectBrJT
authorJessica Paquette <jpaquette@apple.com>
Thu, 2 Apr 2020 23:33:35 +0000 (16:33 -0700)
committerJessica Paquette <jpaquette@apple.com>
Fri, 3 Apr 2020 03:34:11 +0000 (20:34 -0700)
commit71947ed927ee25d7e7ec3277004b02908b48b60d
tree0b016a00d45d764ddfb7f5584cae6a6142efff79
parentfe8ac0fe51aa588e3310e4ba4abed6f0eacce8dc
[AArch64][GlobalISel] Constrain reg operands in selectBrJT

This was causing a machine verifier failure on the test suite.

Make sure that we don't end up with a weird register class here.

Failure for reference:

*** Bad machine code: Illegal virtual register for instruction ***
- function:    check_constrain
- basic block: %bb.1  (0x7f8b70839f80)
- instruction: early-clobber %6:gpr64, early-clobber %7:gpr64sp =
  JumpTableDest32 %5:gpr64, %1:gpr64sp, %jump-table.0
- operand 3:   %1:gpr64sp
Expected a GPR64 register, but got a GPR64sp register

Differential Revision: https://reviews.llvm.org/D77349
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/select-jump-table-brjt-constrain.mir [new file with mode: 0644]