aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShow Liu <show.liu@linaro.org>2016-02-24 14:32:07 +0800
committerShow Liu <show.liu@linaro.org>2016-02-24 14:32:07 +0800
commit73b2337d48b1d843236466d9f4ea50ceca788431 (patch)
tree876c76859aafd3c7b4d0f09472a7a7123eda078d
parentd989ae5f5011c0351f83cb9f88dfcb30a7bb74f4 (diff)
downloadshamrock-llvm_3_8.tar.gz
fixed get kernel args info failed on AArch64 issuellvm_3_8
-rw-r--r--src/core/kernel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/core/kernel.cpp b/src/core/kernel.cpp
index 6993ed8..a014c18 100644
--- a/src/core/kernel.cpp
+++ b/src/core/kernel.cpp
@@ -227,6 +227,15 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
}
else
{
+ if (arg_type->isArrayTy())
+ {
+ // We treat this as a vector as well.
+ llvm::ArrayType *a_type = llvm::cast<llvm::ArrayType>(arg_type);
+
+ vec_dim = a_type->getNumElements();
+ arg_type = a_type->getElementType();
+ }
+
if (arg_type->isVectorTy())
{
// It's a vector, we need its element's type
@@ -235,14 +244,6 @@ cl_int Kernel::addFunction(DeviceInterface *device, llvm::Function *function,
vec_dim = v_type->getNumElements();
arg_type = v_type->getElementType();
}
- else if (arg_type->isArrayTy())
- {
- // We treat this as a vector as well.
- llvm::ArrayType *a_type = llvm::cast<llvm::ArrayType>(arg_type);
-
- vec_dim = a_type->getNumElements();
- arg_type = a_type->getElementType();
- }
// Get type kind
if (arg_type->isFloatTy())