hanchenye-llvm-project/polly/lib
Siddharth Bhat bccaea57c0 [Polly] [PPCGCodeGeneration] Skip Scops which contain function pointers.
In `PPCGCodeGeneration`, we try to take the references of every `Value`
that is used within a Scop to offload to the kernel. This occurs in
`GPUNodeBuilder::createLaunchParameters`.

This breaks if one of the values is a function pointer, since one of
these cases will trigger:

1. We try to to take the references of an intrinsic function, and this
breaks at `verifyModule`, since it is illegal to take the reference of
an intrinsic.

2. We manage to take the reference to a function, but this fails at
`verifyModule` since the function will not be present in the module that
is created in the kernel.

3. Even if `verifyModule` succeeds (which should not occur), we would
then try to call a *host function* from the *device*, which is
illegal runtime behaviour.

So, we disable this entire range of possibilities by simply not allowing
function references within a `Scop` which corresponds to a kernel.

However, note that this is too conservative. We *can* allow intrinsics
within kernels if the backend can lower the intrinsic correctly. For
example, an intrinsic like `llvm.powi.*` can actually be lowered by the `NVPTX`
backend.

We will now gradually whitelist intrinsics which are known to be safe.

Differential Revision: https://reviews.llvm.org/D33414

llvm-svn: 305185
2017-06-12 11:41:09 +00:00
..
Analysis [Polly] [ScopDetection] Allow passing multiple functions to `-polly-only-func`. 2017-06-09 08:23:40 +00:00
CodeGen [Polly] [PPCGCodeGeneration] Skip Scops which contain function pointers. 2017-06-12 11:41:09 +00:00
Exchange Fix a lot of typos. NFC. 2017-06-08 12:06:15 +00:00
External [isl-cpp] Remove isl/mat.h and add insert_partial_schedule 2017-06-11 04:39:21 +00:00
Support [NFC] Fix typo in `ImportJScop` declaration. 2017-06-12 09:43:12 +00:00
Transform Fix a lot of typos. NFC. 2017-06-08 12:06:15 +00:00
CMakeLists.txt [Polly][NewPM] Reenable ScopPassManager unittest 2017-05-23 11:28:50 +00:00
Polly.cpp Drop '@brief' from doxygen comments 2016-09-02 06:33:33 +00:00