mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
RegisterCoalescer: Do not look for regclass of IMPLICIT_DEF.
IMPLICIT_DEF is a generic instruction and has no (fixed) output register class defined. The rematerialization code of the register coalescer should not scan the instruction description for a register class. This fixes a problem showing up in test/CodeGen/R600/subreg-coalescer-crash.ll with subregister liveness enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229443 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0638f4e115
commit
1f67650f77
@ -913,12 +913,13 @@ bool RegisterCoalescer::reMaterializeTrivialDef(CoalescerPair &CP,
|
||||
const TargetRegisterClass *NewRC = CP.getNewRC();
|
||||
unsigned NewIdx = NewMI->getOperand(0).getSubReg();
|
||||
|
||||
if (NewIdx)
|
||||
NewRC = TRI->getMatchingSuperRegClass(NewRC, DefRC, NewIdx);
|
||||
else
|
||||
NewRC = TRI->getCommonSubClass(NewRC, DefRC);
|
||||
|
||||
assert(NewRC && "subreg chosen for remat incompatible with instruction");
|
||||
if (DefRC != nullptr) {
|
||||
if (NewIdx)
|
||||
NewRC = TRI->getMatchingSuperRegClass(NewRC, DefRC, NewIdx);
|
||||
else
|
||||
NewRC = TRI->getCommonSubClass(NewRC, DefRC);
|
||||
assert(NewRC && "subreg chosen for remat incompatible with instruction");
|
||||
}
|
||||
MRI->setRegClass(DstReg, NewRC);
|
||||
|
||||
updateRegDefsUses(DstReg, DstReg, DstIdx);
|
||||
|
Loading…
Reference in New Issue
Block a user