[llvm-dev] [OpenCL] Question about pre-linking passes required to build OpenCL program

Anastasia Stulova via llvm-dev
Wed, 11 May 2016 16:50:48 -0000

Hi Brian,

> For example, we transform printf calls into a form that interacts with our
library.  We also transform calls to pipe functions, kernel enqueue related
functions, and transform calls to the atomic functions to corresponding LLVM
atomic instructions (and keep track of the memory scope elsewhere currently).

Sounds like most of the transformation are affecting OpenCL 2.0. It would be
nice to see progress with the latest standards on LLVM side too.

> You may have noticed that we have a proposal out to enable the atomic
instructions to directly carry a memory scope.

Yes, but probably need to look more into this.

Thanks,
Anastasia

From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 10 May 2016 22:17
To: Sumner, Brian; Anastasia Stulova; cfe-dev (cfe-dev at lists.llvm.org); Pan,
Xiuli; Bader, Alexey (alexey.bader at intel.com); llvm-dev at lists.llvm.org
Cc: Stellard, Thomas; Mekhanoshin, Stanislav; nd
Subject: RE: [OpenCL] Question about pre-linking passes required to build OpenCL
program

+ llvm-dev

From: Sumner, Brian
Sent: Tuesday, May 10, 2016 3:11 PM
To: Anastasia Stulova <Anastasia.Stulova at
arm.com<mailto:Anastasia.Stulova at arm.com>>; Liu, Yaxun (Sam)
<Yaxun.Liu at amd.com<mailto:Yaxun.Liu at amd.com>>; cfe-dev
(cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>) <cfe-dev
at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>>; Pan, Xiuli
<xiuli.pan at intel.com<mailto:xiuli.pan at intel.com>>; Bader,
Alexey (alexey.bader at intel.com<mailto:alexey.bader at intel.com>)
<alexey.bader at intel.com<mailto:alexey.bader at intel.com>>
Cc: Stellard, Thomas <Tom.Stellard at amd.com<mailto:Tom.Stellard at
amd.com>>; Mekhanoshin, Stanislav <Stanislav.Mekhanoshin at
amd.com<mailto:Stanislav.Mekhanoshin at amd.com>>; nd <nd at
arm.com<mailto:nd at arm.com>>
Subject: RE: [OpenCL] Question about pre-linking passes required to build OpenCL
program

Hi Anastasia,

I'm glad to hear there could be some support for such a mechanism.  On our
side, we use such pre-link passes to interface with the specifics of our
built-in function library.  For example, we transform printf calls into a form
that interacts with our library.  We also transform calls to pipe functions,
kernel enqueue related functions, and transform calls to the atomic functions to
corresponding LLVM atomic instructions (and keep track of the memory scope
elsewhere currently).  You may have noticed that we have a proposal out to
enable the atomic instructions to directly carry a memory scope.

Thanks,
Brian

From: Anastasia Stulova [mailto:Anastasia.Stulova at arm.com]
Sent: Tuesday, May 10, 2016 11:45 AM
To: Liu, Yaxun (Sam); cfe-dev (cfe-dev at lists.llvm.org<mailto:cfe-dev at
lists.llvm.org>); Pan, Xiuli; Bader, Alexey (alexey.bader at
intel.com<mailto:alexey.bader at intel.com>)
Cc: Stellard, Thomas; Sumner, Brian; Mekhanoshin, Stanislav; nd
Subject: RE: [OpenCL] Question about pre-linking passes required to build OpenCL
program

Hi Sam,

It seems to be generally useful to the community. Could you give some examples
of those transformations that can be shared?

Also I am guessing this will be a part of LLVM code base. Do you intend it to be
publically available on the master branch?  If yes, perhaps llvm-dev should be
added to the discussion too.

Cheers,
Anastasia

From: Liu, Yaxun (Sam) [mailto:Yaxun.Liu at amd.com]
Sent: 09 May 2016 21:14
To: cfe-dev (cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>);
Anastasia Stulova; Pan, Xiuli; Bader, Alexey (alexey.bader at
intel.com<mailto:alexey.bader at intel.com>)
Cc: Stellard, Thomas; Sumner, Brian; Mekhanoshin, Stanislav
Subject: [OpenCL] Question about pre-linking passes required to build OpenCL
program

Hi,

We typically need to apply some transformations to the IR between clang and the
standard linker. I am wondering if other OpenCL platforms require the same as
well?

I'm wondering if we all need such transformations (likely target specific).
Is there any way to collaborate on a common infrastructure for pre-linking
transformation that would reduce the size of the additions we have to make?

Thanks.

Sam
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20160511/19f0fa20/attachment.html>