X86: Turn redundant if into an assertion.
[oota-llvm.git] / lib / Target / X86 / X86SelectionDAGInfo.cpp
index a83dd9b2eea7e8aa8036da887d6e4d8d859a9494..edd9a429f8b787f67bff7421f693332734e1854a 100644 (file)
@@ -203,8 +203,8 @@ X86SelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl,
 
   // ESI might be used as a base pointer, in that case we can't simply overwrite
   // the register.  Fall back to generic code.
-  const X86RegisterInfo *TRI =
-      static_cast<const X86RegisterInfo *>(DAG.getTarget().getRegisterInfo());
+  const X86RegisterInfo *TRI = static_cast<const X86RegisterInfo *>(
+      DAG.getSubtarget().getRegisterInfo());
   if (TRI->hasBasePointer(DAG.getMachineFunction()) &&
       TRI->getBaseRegister() == X86::ESI)
     return SDValue();