hasSuperClass tests for a strict superset relation, rather than

a superset relation. This code wants to test the regular superset
relation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2009-08-05 20:13:45 +00:00
parent 14d9495403
commit be0cf7dbc2

View File

@ -1698,8 +1698,8 @@ bool X86InstrInfo::copyRegToReg(MachineBasicBlock &MBB,
else if (!DestRC->hasSubClass(SrcRC)) {
// Neither of GR64_NOREX or GR64_NOSP is a superclass of the other,
// but we want to copy then as GR64.
if (SrcRC->hasSuperClass(&X86::GR64RegClass) &&
DestRC->hasSuperClass(&X86::GR64RegClass))
if ((SrcRC == &X86::GR64RegClass || SrcRC->hasSuperClass(&X86::GR64RegClass)) &&
(DestRC == &X86::GR64RegClass || DestRC->hasSuperClass(&X86::GR64RegClass)))
CommonRC = &X86::GR64RegClass;
else
CommonRC = 0;