[llvm-commits] [llvm] r53688 - /llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Dan Gohman
gohman at apple.com
Wed Jul 16 09:20:48 PDT 2008
Author: djg
Date: Wed Jul 16 11:20:48 2008
New Revision: 53688
URL: http://llvm.org/viewvc/llvm-project?rev=53688&view=rev
Log:
Fix the result type of X86's truncate to i8.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=53688&r1=53687&r2=53688&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Wed Jul 16 11:20:48 2008
@@ -1120,19 +1120,17 @@
// Ensure that the source register has an 8-bit subreg on 32-bit targets
if (!Subtarget->is64Bit()) {
unsigned Opc;
- MVT VT;
- switch (N0.getValueType().getSimpleVT()) {
+ MVT N0VT = N0.getValueType();
+ switch (N0VT.getSimpleVT()) {
default: assert(0 && "Unknown truncate!");
case MVT::i16:
Opc = X86::MOV16to16_;
- VT = MVT::i16;
break;
case MVT::i32:
Opc = X86::MOV32to32_;
- VT = MVT::i32;
break;
}
- N0 = SDOperand(CurDAG->getTargetNode(Opc, VT, MVT::Flag, N0), 0);
+ N0 = SDOperand(CurDAG->getTargetNode(Opc, N0VT, MVT::Flag, N0), 0);
return CurDAG->getTargetNode(X86::EXTRACT_SUBREG,
VT, N0, SRIdx, N0.getValue(1));
}
More information about the llvm-commits
mailing list