-
Notifications
You must be signed in to change notification settings - Fork 795
Closed
Labels
SPIR-VIssues related to SPIRV-LLVM-TranslatorIssues related to SPIRV-LLVM-TranslatorbugSomething isn't workingSomething isn't working
Description
Describe the bug
Bit rotate right triggers "unexpected llvm intrinsic (llvm.fshr.i32
)
To Reproduce
Compiling
#include <iostream>
#include <CL/sycl.hpp>
unsigned rotate_right(unsigned i, int r) {
enum { size = static_cast<int>(sizeof(unsigned) * CHAR_BIT) };
return r ? ((i >> r) | (i << (size - r))) : i;
}
int main(int, char**) {
unsigned a = 1;
unsigned b = 4;
cl::sycl::default_selector device_selector;
cl::sycl::queue queue(device_selector);
queue.submit([&] (cl::sycl::handler& cgh) {
cgh.single_task([=] () {
rotate_right(a, b);
});
});
return 0;
}
via
clang++ -fsycl -fsycl-unnamed-lambda foo.cc
results in
InvalidFunctionCall: Unexpected llvm intrinsic:
llvm.fshr.i32 [Src: /netbatch/donb1245322_00/runDir/95/20201113_160000/llvm/llvm-spirv/lib/SPIRV/SPIRVWriter.cpp:2634 ]
llvm-foreach:
clang++: error: llvm-spirv command failed with exit code 1 (use -v to see invocation)
Environment (please complete the following information):
- OS: Linux
- Target device and vendor: Intel(R) Xeon(R) Gold 6254 CPU @ 3.10GHz
- DPC++ version: Intel(R) oneAPI DPC++ Compiler 2021.1 (2020.10.0.1113) but also daily release 2021/03/03 (2a7a149)
- Dependencies version: OpenCL 2.1 (Build 0)
Metadata
Metadata
Assignees
Labels
SPIR-VIssues related to SPIRV-LLVM-TranslatorIssues related to SPIRV-LLVM-TranslatorbugSomething isn't workingSomething isn't working