summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJurek, Pawel <pawel.jurek@intel.com>2018-03-26 12:45:56 +0200
committerAlexey Sotkin <alexey.sotkin@intel.com>2018-03-27 21:38:34 +0300
commitd3f156ca58143ddb82c6c36d209ea2c2873d5996 (patch)
tree867f8a32ff93af7f1064322167f05c85b07b482f
parentd3e430612b3df6223797797a5abbb599e039f47e (diff)
Fix for intel_sub_group_block_read with short type.
With previous code, when intel_sub_group_block_read_us scalar function was being used, we generated __builtin_spirv_intel_sub_group_block_read_p1i16 built-in name. For naming consistency with OpenCL functions, it should have the "us" included, i.e. __builtin_spirv_intel_sub_group_block_read_us_p1i16
-rw-r--r--lib/SPIRV/SPIRVReader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/SPIRV/SPIRVReader.cpp b/lib/SPIRV/SPIRVReader.cpp
index 4f7deaa..8842294 100644
--- a/lib/SPIRV/SPIRVReader.cpp
+++ b/lib/SPIRV/SPIRVReader.cpp
@@ -2224,11 +2224,13 @@ SPIRVToLLVM::getOCLBuiltinName(SPIRVInstruction* BI) {
default:
return OCLSPIRVBuiltinMap::rmap(OC);
}
- if (DataTy && DataTy->isTypeVector()) {
- if (DataTy->getVectorComponentType()->getBitWidth() == 16)
+ if (DataTy) {
+ if (DataTy->getBitWidth() == 16)
Name << "_us";
- if (unsigned ComponentCount = DataTy->getVectorComponentCount())
- Name << ComponentCount;
+ if (DataTy->isTypeVector()) {
+ if (unsigned ComponentCount = DataTy->getVectorComponentCount())
+ Name << ComponentCount;
+ }
}
return Name.str();
}