[NVPTX] Fix logic error in loading vector parameters of more than 4 components

llvm-svn: 194409
This commit is contained in:
Justin Holewinski 2013-11-11 19:28:16 +00:00
parent 8d7ebe36dd
commit 0d1f2863f9
2 changed files with 14 additions and 1 deletions

View File

@ -1595,7 +1595,7 @@ SDValue NVPTXTargetLowering::LowerFormalArguments(
}
Ofst += TD->getTypeAllocSize(VecVT.getTypeForEVT(F->getContext()));
}
InsIdx += VecSize;
InsIdx += NumElts;
}
if (NumElts > 0)

View File

@ -0,0 +1,13 @@
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
target triple = "nvptx-unknown-cuda"
; CHECK: .visible .func foo
define void @foo(<8 x i8> %a, i8* %b) {
%t0 = extractelement <8 x i8> %a, i32 0
; CHECK-DAG: ld.param.v4.u8
; CHECK-DAG: ld.param.u32
store i8 %t0, i8* %b
ret void
}