summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-15 00:14:11 +0000
committerDan Gohman <gohman@apple.com>2009-09-15 00:14:11 +0000
commit907355caf89549138ab3ea0e4ab13a5df0ee014a (patch)
treeb56c5968a255a1e06ade7332652715c2fcbee3f6 /lib
parente6798372ea38e5ea24c26282a0d69aa6e3829854 (diff)
downloadllvm-907355caf89549138ab3ea0e4ab13a5df0ee014a.tar.gz
llvm-907355caf89549138ab3ea0e4ab13a5df0ee014a.tar.bz2
llvm-907355caf89549138ab3ea0e4ab13a5df0ee014a.tar.xz
On x86-64, the 32-bit cmov doesn't actually clear the high 32-bit of
its result if the condition is false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81814 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/X86/X86Instr64bit.td8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/X86/X86Instr64bit.td b/lib/Target/X86/X86Instr64bit.td
index 353868a407..ac90357038 100644
--- a/lib/Target/X86/X86Instr64bit.td
+++ b/lib/Target/X86/X86Instr64bit.td
@@ -387,13 +387,15 @@ def MOVZX64rm32 : I<0x8B, MRMSrcMem, (outs GR64:$dst), (ins i32mem:$src),
[(set GR64:$dst, (zextloadi64i32 addr:$src))]>;
// Any instruction that defines a 32-bit result leaves the high half of the
-// register. Truncate can be lowered to EXTRACT_SUBREG, and CopyFromReg may
-// be copying from a truncate, but any other 32-bit operation will zero-extend
+// register. Truncate can be lowered to EXTRACT_SUBREG. CopyFromReg may
+// be copying from a truncate. And x86's cmov doesn't do anything if the
+// condition is false. But any other 32-bit operation will zero-extend
// up to 64 bits.
def def32 : PatLeaf<(i32 GR32:$src), [{
return N->getOpcode() != ISD::TRUNCATE &&
N->getOpcode() != TargetInstrInfo::EXTRACT_SUBREG &&
- N->getOpcode() != ISD::CopyFromReg;
+ N->getOpcode() != ISD::CopyFromReg &&
+ N->getOpcode() != X86ISD::CMOV;
}]>;
// In the case of a 32-bit def that is known to implicitly zero-extend,