This revision was automatically updated to reflect the committed changes.
Closed by commit rL318290: [OpenCL] Fix code generation of function-scope
constant samplers. (authored by bader).
Repository:
rL LLVM
https://reviews.llvm.org/D34342
Files:
cfe/trunk/lib/CodeGen/CGDecl.cpp
Anastasia accepted this revision.
Anastasia added a comment.
LGTM! Thanks!
https://reviews.llvm.org/D34342
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Anastasia added a comment.
In https://reviews.llvm.org/D34342#792350, @bader wrote:
> Note: `get_sampler_initializer` from my test case returns integer, not a
> sampler, but having function is not relevant to the problem.
> Here is a bit simplified test case without function calls that still
bader added a comment.
Note: `get_sampler_initializer` from my test case returns integer, not a
sampler, but having function is not relevant to the problem.
Here is a bit simplified test case without function calls that still reproduces
the problem:
kernel void foo(int sampler_init_value) {
yaxunl added a comment.
In https://reviews.llvm.org/D34342#786941, @bader wrote:
> Added test case reproducing the issue described in the description.
> Removed test cases from test/SemaOpenCL/sampler_t.cl covered by
> test/CodeGenOpenCL/sampler.cl.
>
> While I was moving one test case from
bader updated this revision to Diff 103421.
bader added a comment.
This revision is now accepted and ready to land.
Added test case reproducing the issue described in the description.
Removed test cases from test/SemaOpenCL/sampler_t.cl covered by
test/CodeGenOpenCL/sampler.cl.
While I was
bader added a comment.
I think I found the way to reproduce the issue. There are two pre-requisites:
sampler must be declared in the constant address space and clang must be build
in Debug mode.
I'll fix the test and add the test cases from test/SemaOpenCL/sampler_t.cl as
mentioned earlier.
Anastasia added a comment.
In https://reviews.llvm.org/D34342#785454, @bader wrote:
> Wow...
> Nice catch.
> For some reason I can't reproduce the problem neither.
> I will drop source code change, but I'd like to modify the test anyway.
I think we probably had this issue at some point...
bader added a comment.
Wow...
Nice catch.
For some reason I can't reproduce the problem neither.
I will drop source code change, but I'd like to modify the test anyway.
https://reviews.llvm.org/rL277024 added test/CodeGenOpenCL/sampler.cl and
modified test/SemaOpenCL/sampler_t.cl.
I want to move
Anastasia added inline comments.
Comment at: test/CodeGenOpenCL/sampler.cl:62
+
+ const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE |
CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
+ // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)*
yaxunl accepted this revision.
yaxunl added a comment.
This revision is now accepted and ready to land.
LGTM. Thanks.
https://reviews.llvm.org/D34342
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
bader added inline comments.
Comment at: test/CodeGenOpenCL/sampler.cl:62
+
+ const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE |
CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
+ // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)*
yaxunl added inline comments.
Comment at: test/CodeGenOpenCL/sampler.cl:62
+
+ const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE |
CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR;
+ // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)*
bader created this revision.
Constant samplers are handled as static variables and clang's code generation
library, which leads to llvm::unreachable. We bypass emitting sampler variable
as static since it's translated to a function call later.
https://reviews.llvm.org/D34342
Files:
14 matches
Mail list logo