[llvm] r194409 - [NVPTX] Fix logic error in loading vector parameters of more than 4 components
Justin Holewinski
jholewinski at nvidia.com
Mon Nov 11 11:28:17 PST 2013
Author: jholewinski
Date: Mon Nov 11 13:28:16 2013
New Revision: 194409
URL: http://llvm.org/viewvc/llvm-project?rev=194409&view=rev
Log:
[NVPTX] Fix logic error in loading vector parameters of more than 4 components
Added:
llvm/trunk/test/CodeGen/NVPTX/vec8.ll
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp?rev=194409&r1=194408&r2=194409&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXISelLowering.cpp Mon Nov 11 13:28:16 2013
@@ -1595,7 +1595,7 @@ SDValue NVPTXTargetLowering::LowerFormal
}
Ofst += TD->getTypeAllocSize(VecVT.getTypeForEVT(F->getContext()));
}
- InsIdx += VecSize;
+ InsIdx += NumElts;
}
if (NumElts > 0)
Added: llvm/trunk/test/CodeGen/NVPTX/vec8.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/NVPTX/vec8.ll?rev=194409&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/NVPTX/vec8.ll (added)
+++ llvm/trunk/test/CodeGen/NVPTX/vec8.ll Mon Nov 11 13:28:16 2013
@@ -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
+}
+
More information about the llvm-commits
mailing list