TableGen/GlobalISel: Fix constraining REG_SEQUENCE operands
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 7 Apr 2020 13:32:51 +0000 (09:32 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 15 Apr 2020 02:05:22 +0000 (22:05 -0400)
commitcb5dc3765bddc4e6bcd92e588c33cfa8424eb437
tree7750872ce8ecac9da7838b1b732d566258e0a108
parent229e392b4edb65b69caa49644cdeaa358095146d
TableGen/GlobalISel: Fix constraining REG_SEQUENCE operands

This was hitting the default instruction constraint code which uses
the register classes in the instruction def, which REG_SEQUENCE does
not have.

Fixes not constraining the register class for AMDGPU fneg/fabs
patterns, which would fail when the use was another generic,
unconstrained instruction.

Another oddity I noticed is that the temporary registers are created
with an unnecessary, but incorrect 16-bit LLT but this shouldn't
matter.

I'm also still unclear why root and sub-instructions have to be
handled differently.
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fabs.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/inst-select-fneg.mir
llvm/test/TableGen/GlobalISelEmitterRegSequence.td
llvm/utils/TableGen/GlobalISelEmitter.cpp