aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-08-05 20:13:45 +0000
committerDan Gohman <gohman@apple.com>2009-08-05 20:13:45 +0000
commitbe0cf7dbc2d230e10f6eec92fb2219ce69a925cc (patch)
treee24a468112a54aca7b8a15eef230c840d70ccf1f /lib
parent14d9495403e4c0129119a79322ee4e744b2eced8 (diff)
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
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86InstrInfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp
index 22f8b53e32..784a790eb0 100644
--- a/lib/Target/X86/X86InstrInfo.cpp
+++ b/lib/Target/X86/X86InstrInfo.cpp
@@ -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;