[llvm-commits] [llvm] r55396 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Owen Anderson
resistor at mac.com
Tue Aug 26 16:14:49 PDT 2008
Author: resistor
Date: Tue Aug 26 18:14:49 2008
New Revision: 55396
URL: http://llvm.org/viewvc/llvm-project?rev=55396&view=rev
Log:
Add support for fast isel of zext.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55396&r1=55395&r2=55396&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Tue Aug 26 18:14:49 2008
@@ -330,6 +330,35 @@
// or attempt constant folding.
return I;
+ case Instruction::ZExt:
+ if (!isa<ConstantInt>(I->getOperand(0))) {
+ MVT SrcVT = MVT::getMVT(I->getOperand(0)->getType());
+ MVT DstVT = MVT::getMVT(I->getType());
+
+ if (SrcVT == MVT::Other || !SrcVT.isSimple() ||
+ DstVT == MVT::Other || !DstVT.isSimple() ||
+ !TLI.isTypeLegal(SrcVT) || !TLI.isTypeLegal(DstVT))
+ // Unhandled type. Halt "fast" selection and bail.
+ return I;
+
+ unsigned InputReg = ValueMap[I->getOperand(0)];
+ if (!InputReg)
+ // Unhandled operand. Halt "fast" selection and bail.
+ return I;
+
+ unsigned ResultReg = FastEmit_r(SrcVT.getSimpleVT(),
+ DstVT.getSimpleVT(),
+ ISD::ZERO_EXTEND,
+ InputReg);
+ if (!ResultReg)
+ return I;
+
+ ValueMap[I] = ResultReg;
+ break;
+ } else
+ // TODO: Support constant operands
+ return I;
+
case Instruction::SIToFP:
if (!isa<ConstantInt>(I->getOperand(0))) {
MVT SrcVT = MVT::getMVT(I->getOperand(0)->getType());
More information about the llvm-commits
mailing list