[MachineCSE][GlobalISel] Making sure MachineCSE works mid-GlobalISel (again)
authorRoman Tereshin <rtereshin@apple.com>
Sat, 20 Oct 2018 00:06:15 +0000 (00:06 +0000)
committerRoman Tereshin <rtereshin@apple.com>
Sat, 20 Oct 2018 00:06:15 +0000 (00:06 +0000)
commit8d6ff4c0af843e1a61b76d89812aed91e358de34
tree4c37f232d2aabe8250f41e5634276f4e1b0a4fc0
parent1fc51f29d7443be52edaf17145a9608368a7154d
[MachineCSE][GlobalISel] Making sure MachineCSE works mid-GlobalISel (again)

Change of approach, it looks like it's a much better idea to deal with
the vregs that have LLTs and reg classes both properly, than trying to
avoid creating those across all GlobalISel passes and all targets.

The change mostly touches MachineRegisterInfo::constrainRegClass,
which is apparently only used by MachineCSE. The changes are NFC for
any pipeline but one that contains MachineCSE mid-GlobalISel.

NOTE on isCallerPreservedOrConstPhysReg change in MachineCSE:

    There is no test covering it as the only way to insert a new pass
(MachineCSE) from a command line I know of is llc's -run-pass option,
which only works with MIR, but MIRParser freezes reserved registers upon
MachineFunctions creation, making it impossible to reproduce the state
that exposes the issue.

Reviwed By: aditya_nandakumar

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

llvm-svn: 344822
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
llvm/lib/CodeGen/MachineCSE.cpp
llvm/lib/CodeGen/MachineRegisterInfo.cpp
llvm/test/CodeGen/AArch64/GlobalISel/machine-cse-mid-pipeline.mir