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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194409 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Holewinski 2013-11-11 19:28:16 +00:00
parent 4c433cf673
commit 0df3ce333b
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
}