[mips][FastISel] Apply only zero-extension to constants prior to their materialization.
[oota-llvm.git] / lib / Target / Mips / MipsFastISel.cpp
index 2c88950f8fd6174621a4ae322572be4e5ecfb149..bdeb94942ff849f1dfa983dd005cd9ca6632c9fb 100644 (file)
@@ -290,12 +290,7 @@ unsigned MipsFastISel::materializeInt(const Constant *C, MVT VT) {
     return 0;
   const TargetRegisterClass *RC = &Mips::GPR32RegClass;
   const ConstantInt *CI = cast<ConstantInt>(C);
-  int64_t Imm;
-  if ((VT != MVT::i1) && CI->isNegative())
-    Imm = CI->getSExtValue();
-  else
-    Imm = CI->getZExtValue();
-  return materialize32BitInt(Imm, RC);
+  return materialize32BitInt(CI->getZExtValue(), RC);
 }
 
 unsigned MipsFastISel::materialize32BitInt(int64_t Imm,