[llvm-commits] [llvm] r140556 - /llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp
Justin Holewinski
justin.holewinski at gmail.com
Mon Sep 26 12:19:48 PDT 2011
Author: jholewinski
Date: Mon Sep 26 14:19:48 2011
New Revision: 140556
URL: http://llvm.org/viewvc/llvm-project?rev=140556&view=rev
Log:
PTX: Fix memcpy intrinsic to handle 64-bit pointers
Modified:
llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp
Modified: llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp?rev=140556&r1=140555&r2=140556&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp (original)
+++ llvm/trunk/lib/Target/PTX/PTXSelectionDAGInfo.cpp Mon Sep 26 14:19:48 2011
@@ -58,6 +58,7 @@
SDValue TFOps[MAX_LOADS_IN_LDM];
SDValue Loads[MAX_LOADS_IN_LDM];
uint64_t SrcOff = 0, DstOff = 0;
+ EVT PointerType = Subtarget->is64Bit() ? MVT::i64 : MVT::i32;
// Emit up to MAX_LOADS_IN_LDM loads, then a TokenFactor barrier, then the
// same number of stores. The loads and stores will get combined into
@@ -66,8 +67,8 @@
for (i = 0;
i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; ++i) {
Loads[i] = DAG.getLoad(VT, dl, Chain,
- DAG.getNode(ISD::ADD, dl, MVT::i32, Src,
- DAG.getConstant(SrcOff, MVT::i32)),
+ DAG.getNode(ISD::ADD, dl, PointerType, Src,
+ DAG.getConstant(SrcOff, PointerType)),
SrcPtrInfo.getWithOffset(SrcOff), isVolatile,
false, 0);
TFOps[i] = Loads[i].getValue(1);
@@ -78,8 +79,8 @@
for (i = 0;
i < MAX_LOADS_IN_LDM && EmittedNumMemOps + i < NumMemOps; ++i) {
TFOps[i] = DAG.getStore(Chain, dl, Loads[i],
- DAG.getNode(ISD::ADD, dl, MVT::i32, Dst,
- DAG.getConstant(DstOff, MVT::i32)),
+ DAG.getNode(ISD::ADD, dl, PointerType, Dst,
+ DAG.getConstant(DstOff, PointerType)),
DstPtrInfo.getWithOffset(DstOff),
isVolatile, false, 0);
DstOff += VTSize;
@@ -105,8 +106,8 @@
}
Loads[i] = DAG.getLoad(VT, dl, Chain,
- DAG.getNode(ISD::ADD, dl, MVT::i32, Src,
- DAG.getConstant(SrcOff, MVT::i32)),
+ DAG.getNode(ISD::ADD, dl, PointerType, Src,
+ DAG.getConstant(SrcOff, PointerType)),
SrcPtrInfo.getWithOffset(SrcOff), false, false, 0);
TFOps[i] = Loads[i].getValue(1);
++i;
@@ -127,8 +128,8 @@
}
TFOps[i] = DAG.getStore(Chain, dl, Loads[i],
- DAG.getNode(ISD::ADD, dl, MVT::i32, Dst,
- DAG.getConstant(DstOff, MVT::i32)),
+ DAG.getNode(ISD::ADD, dl, PointerType, Dst,
+ DAG.getConstant(DstOff, PointerType)),
DstPtrInfo.getWithOffset(DstOff), false, false, 0);
++i;
DstOff += VTSize;
More information about the llvm-commits
mailing list