hasSuperClass tests for a strict superset relation, rather than
authorDan Gohman <gohman@apple.com>
Wed, 5 Aug 2009 20:13:45 +0000 (20:13 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 5 Aug 2009 20:13:45 +0000 (20:13 +0000)
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

lib/Target/X86/X86InstrInfo.cpp

index 22f8b53e32883d9d4f0becd45cb8c5ea9c4497d4..784a790eb00904301b6312b2bb6811af7d5a816d 100644 (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;