[llvm-commits] [llvm] r158413 - /llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Akira Hatanaka
ahatanaka at mips.com
Wed Jun 13 12:06:08 PDT 2012
Author: ahatanak
Date: Wed Jun 13 14:06:08 2012
New Revision: 158413
URL: http://llvm.org/viewvc/llvm-project?rev=158413&view=rev
Log:
Simplify CreateLoadLR and CreateStoreLR in MipsISelLowering.cpp.
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=158413&r1=158412&r2=158413&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Wed Jun 13 14:06:08 2012
@@ -2070,17 +2070,15 @@
static SDValue CreateLoadLR(unsigned Opc, SelectionDAG &DAG, LoadSDNode *LD,
SDValue Chain, SDValue Src, unsigned Offset) {
- SDValue BasePtr = LD->getBasePtr(), Ptr;
+ SDValue Ptr = LD->getBasePtr();
EVT VT = LD->getValueType(0), MemVT = LD->getMemoryVT();
- EVT BasePtrVT = BasePtr.getValueType();
+ EVT BasePtrVT = Ptr.getValueType();
DebugLoc DL = LD->getDebugLoc();
SDVTList VTList = DAG.getVTList(VT, MVT::Other);
if (Offset)
- Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, BasePtr,
+ Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, Ptr,
DAG.getConstant(Offset, BasePtrVT));
- else
- Ptr = BasePtr;
SDValue Ops[] = { Chain, Ptr, Src };
return DAG.getMemIntrinsicNode(Opc, DL, VTList, Ops, 3, MemVT,
@@ -2151,17 +2149,14 @@
static SDValue CreateStoreLR(unsigned Opc, SelectionDAG &DAG, StoreSDNode *SD,
SDValue Chain, unsigned Offset) {
- SDValue BasePtr = SD->getBasePtr(), Ptr, Value = SD->getValue();
- EVT MemVT = SD->getMemoryVT();
- EVT BasePtrVT = BasePtr.getValueType();
+ SDValue Ptr = SD->getBasePtr(), Value = SD->getValue();
+ EVT MemVT = SD->getMemoryVT(), BasePtrVT = Ptr.getValueType();
DebugLoc DL = SD->getDebugLoc();
SDVTList VTList = DAG.getVTList(MVT::Other);
if (Offset)
- Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, BasePtr,
+ Ptr = DAG.getNode(ISD::ADD, DL, BasePtrVT, Ptr,
DAG.getConstant(Offset, BasePtrVT));
- else
- Ptr = BasePtr;
SDValue Ops[] = { Chain, Value, Ptr };
return DAG.getMemIntrinsicNode(Opc, DL, VTList, Ops, 3, MemVT,
More information about the llvm-commits
mailing list