[MIParser] Set RegClassOrRegBank during instruction parsing
authorPetar Avramovic <Petar.Avramovic@rt-rk.com>
Tue, 22 Oct 2019 14:25:37 +0000 (14:25 +0000)
committerPetar Avramovic <Petar.Avramovic@rt-rk.com>
Tue, 22 Oct 2019 14:25:37 +0000 (14:25 +0000)
commit95290827d7d01c63ac57b2cf5204215ba4ee4b06
treec713cd4dcca44893eee188af7aaf5d0e004a3cbc
parente4af9de36ca60483040af381edd10e716e7b077d
[MIParser] Set RegClassOrRegBank during instruction parsing

MachineRegisterInfo::createGenericVirtualRegister sets
RegClassOrRegBank to static_cast<RegisterBank *>(nullptr).
MIParser on the other hand doesn't. When we attempt to constrain
Register Class on such VReg, additional COPY is generated.
This way we avoid COPY instructions showing in test that have MIR
input while they are not present with llvm-ir input that was used
to create given MIR for a -run-pass test.

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

llvm-svn: 375502
llvm/lib/CodeGen/MIRParser/MIParser.cpp
llvm/test/CodeGen/MIR/Mips/setRegClassOrRegBank.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/add_vec_builtin.mir
llvm/test/CodeGen/Mips/GlobalISel/legalizer/sitofp_and_uitofp.mir