[PATCH] D59985: Re-fix invalid address space generation for clk_event_t arguments of enqueue_kernel builtin function

Alexey Sotkin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 3 06:15:44 PDT 2019


AlexeySotkin marked an inline comment as done.
AlexeySotkin added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:3711
+      EventList = EventList->getType()->isIntegerTy()
+                      ? Builder.CreateIntToPtr(EventList, EventPtrTy)
+                      : Builder.CreatePointerCast(EventList, EventPtrTy);
----------------
AlexeySotkin wrote:
> Anastasia wrote:
> > AlexeySotkin wrote:
> > > Anastasia wrote:
> > > > It seems we are not testing the casts?
> > > Do you mean that when we run LIT tests, this code is not executed? If so, in the modified test below, literal zeros are making clang to execute CreateIntToPtr call indeed.
> > > Or, do you mean that we need some extra check(to make sure the cast will be successful for example) in the source code itself ?
> > I mean since you are generating extra IR nodes we should check in the tests that they appear correctly. I don't see these casts checked in the tests currently.
> Since we are casting null constants they are folded to null values, like this `%opencl.clk_event_t{{.*}}* addrspace(4)* null`.
I think `0` is the only possible integral literal, which can be given as the events arguments.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59985/new/

https://reviews.llvm.org/D59985





More information about the cfe-commits mailing list