mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-01 16:26:29 +00:00
Don't use register classes larger than TLI->getRegClassFor(VT).
In Thumb mode we cannot handle GPR virtual registers, even though some instructions can. When isel is lowering a CopyFromReg, it should limit itself to subclasses of getRegClassFor(VT). <rdar://problem/9624323> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -76,6 +76,12 @@ EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone, bool IsCloned,
|
||||
// the CopyToReg'd destination register instead of creating a new vreg.
|
||||
bool MatchReg = true;
|
||||
const TargetRegisterClass *UseRC = NULL;
|
||||
EVT VT = Node->getValueType(ResNo);
|
||||
|
||||
// Stick to the preferred register classes for legal types.
|
||||
if (TLI->isTypeLegal(VT))
|
||||
UseRC = TLI->getRegClassFor(VT);
|
||||
|
||||
if (!IsClone && !IsCloned)
|
||||
for (SDNode::use_iterator UI = Node->use_begin(), E = Node->use_end();
|
||||
UI != E; ++UI) {
|
||||
@@ -121,10 +127,9 @@ EmitCopyFromReg(SDNode *Node, unsigned ResNo, bool IsClone, bool IsCloned,
|
||||
break;
|
||||
}
|
||||
|
||||
EVT VT = Node->getValueType(ResNo);
|
||||
const TargetRegisterClass *SrcRC = 0, *DstRC = 0;
|
||||
SrcRC = TRI->getMinimalPhysRegClass(SrcReg, VT);
|
||||
|
||||
|
||||
// Figure out the register class to create for the destreg.
|
||||
if (VRBase) {
|
||||
DstRC = MRI->getRegClass(VRBase);
|
||||
|
Reference in New Issue
Block a user