mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
ARM: Fix more fast-isel verifier failures.
Teach the generic instruction selection helper functions to constrain the register classes of their input operands. For non-physical register references, the generic code needs to be careful not to mess that up when replacing references to result registers. As the comment indicates for MachineRegisterInfo::replaceRegWith(), it's important to call constrainRegClass() first. rdar://12594152 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188593 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -497,6 +497,10 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
|
||||
if (J == E) break;
|
||||
To = J->second;
|
||||
}
|
||||
// Make sure the new register has a sufficiently constrained register class.
|
||||
if (TargetRegisterInfo::isVirtualRegister(From) &&
|
||||
TargetRegisterInfo::isVirtualRegister(To))
|
||||
MRI.constrainRegClass(To, MRI.getRegClass(From));
|
||||
// Replace it.
|
||||
MRI.replaceRegWith(From, To);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user