[llvm] r196503 - [NVPTX] Fix off-by-one error when creating the VT list for an SDNode
Justin Holewinski
jholewinski at nvidia.com
Thu Dec 5 04:58:00 PST 2013
Author: jholewinski
Date: Thu Dec 5 06:58:00 2013
New Revision: 196503
URL: http://llvm.org/viewvc/llvm-project?rev=196503&view=rev
Log:
[NVPTX] Fix off-by-one error when creating the VT list for an SDNode
Added:
llvm/trunk/test/CodeGen/NVPTX/ldparam-v4.ll
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp?rev=196503&r1=196502&r2=196503&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp Thu Dec 5 06:58:00 2013
@@ -2014,7 +2014,7 @@ SDNode *NVPTXDAGToDAGISel::SelectLoadPar
VTs = CurDAG->getVTList(EltVT, EltVT, MVT::Other, MVT::Glue);
} else {
EVT EVTs[] = { EltVT, EltVT, EltVT, EltVT, MVT::Other, MVT::Glue };
- VTs = CurDAG->getVTList(&EVTs[0], 5);
+ VTs = CurDAG->getVTList(&EVTs[0], array_lengthof(EVTs));
}
unsigned OffsetVal = cast<ConstantSDNode>(Offset)->getZExtValue();
Added: llvm/trunk/test/CodeGen/NVPTX/ldparam-v4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/ldparam-v4.ll?rev=196503&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/ldparam-v4.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/ldparam-v4.ll Thu Dec 5 06:58:00 2013
@@ -0,0 +1,10 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+
+declare <4 x float> @bar()
+
+define void @foo(<4 x float>* %ptr) {
+; CHECK: ld.param.v4.f32
+ %val = tail call <4 x float> @bar()
+ store <4 x float> %val, <4 x float>* %ptr
+ ret void
+}
More information about the llvm-commits
mailing list