[NVPTX] Fix off-by-one error when creating the VT list for an SDNode

llvm-svn: 196503
This commit is contained in:
Justin Holewinski 2013-12-05 12:58:00 +00:00
parent 2d42b1d693
commit 4459717bab
2 changed files with 11 additions and 1 deletions

View File

@ -2014,7 +2014,7 @@ SDNode *NVPTXDAGToDAGISel::SelectLoadParam(SDNode *Node) {
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();

View File

@ -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
}