- Jul 18, 2016
-
-
Tobias Grosser authored
Initialize the list of references to a GPU array to ensure that the arrays that need to be passed to kernel calls are computed correctly. Furthermore, the very same information is also necessary to compute synchronization correctly. As the functionality to compute these references is already available, what is left for us to do is only to connect the necessary functionality to compute array reference information. llvm-svn: 275798
-
Tobias Grosser authored
This will allow us to see the full class definition even after we add non-trivial implementations of the different member functions. llvm-svn: 275797
-
Tobias Grosser authored
llvm-svn: 275784
-
Tobias Grosser authored
Create LLVM-IR for all host-side control flow of a given GPU AST. We implement this by introducing a new GPUNodeBuilder class derived from IslNodeBuilder. The IslNodeBuilder will take care of generating all general-purpose ast nodes, but we provide our own createUser implementation to handle the different GPU specific user statements. For now, we just skip any user statement and only generate a host-code sceleton, but in subsequent commits we will add handling of normal ScopStmt's performing computations, kernel calls, as well as host-device data transfers. We will also introduce run-time check generation and LICM in subsequent commits. llvm-svn: 275783
-
- Jul 16, 2016
-
-
Tobias Grosser authored
This ensures that accidental calls to these functions will break loadly instead of corrupting the stack with invalid return values. These functions have been introduced earlier as replacement of pet and parts of ppcg which we will never use and consequently have not been imported or compiled into Polly. llvm-svn: 275680
-
- Jul 15, 2016
-
-
Tobias Grosser authored
Otherwise ppcg would try to call into pet functionality that this not available, which obviously will cause trouble. As we can easily print these statements ourselves, we just do so. llvm-svn: 275579
-
Tobias Grosser authored
This option increases the scalability of the scheduler and allows us to remove the 'gisting' workaround we introduced in r275565 to handle a more complicated test case. Another benefit of using this option is also that the generated code looks a lot more streamlined. Thanks to Sven Verdoolaege for reminding me of this option. llvm-svn: 275573
-
Tobias Grosser authored
This works around a shortcoming of the isl scheduler, which even for some smaller test cases does not terminate in case domain constraints are part of the flow dependences. llvm-svn: 275565
-
Tobias Grosser authored
It seems we forgot to actually add the memory access ids to the tagged accesses, but instead just tagged the accesses with empty isl_ids. This issue was found by inspection and without code generation it is difficult to test just by itself. We fix it for now without test case and expect our code generation tests to cover this later on. llvm-svn: 275557
-
Tobias Grosser authored
We do not have them in Polly and the code to check for them is directly referring to pet data structures which we do not have available. This commit avoids undefined behavior. As such issues are difficult to reproduce, this commit comes without a test case. llvm-svn: 275553
-
Tobias Grosser authored
Arrays with integer base type are similar to arrays with floating point types, with the exception that LLVM's integer types can take some odd values. We add a selection of different values to make sure we correctly round these types when necessary. References to scalar integer types are special, as we currently do not model these types as array accesses as they are considered 'synthesizable' by Polly. As a result, we do not generate explicit data-transfers for them, but instead will need to keep track of all references to 'synthesizable' values separately. At the current stage, this is only visible by missing host-to-device data-transfer calls. In the future, we will also require special code generation strategies. llvm-svn: 275551
-
Tobias Grosser authored
We currently only test that the code structure we generate for these scalar parameters is correct and we add these types to make sure later code generation additions have sufficient test coverage. In case some of these types cannot be mapped due to missing hardware support on the GPU some of these test cases may need to be updated later on. llvm-svn: 275548
-
Tobias Grosser authored
We use this opportunity to add a test case containing a scalar parameter. llvm-svn: 275547
-
Tobias Grosser authored
ppcg does not free the option structs for us. To avoid a memory leak we do this ourselves. llvm-svn: 275546
-
Tobias Grosser authored
Instead of directly linking to ppcg's main source directory, we link to the parent director. This allows us to access ppcg's include files with 'ppcg/cuda.h' and avoids a conflict with NVIDIA's cuda.h header. Also drop an include directory that is currently not used. llvm-svn: 275536
-
Tobias Grosser authored
This allows us to derive host-device and device-host data-transfers. llvm-svn: 275535
-
Tobias Grosser authored
A sequence of CHECK lines allows additional statements to appear in the output of the tested program without any test failures appearing. As we do not want this to happen, switch this test case to use CHECK-NEXT. llvm-svn: 275534
-
- Jul 14, 2016
-
-
Tobias Grosser authored
For this we need to provide an explicit list of statements as they occur in the polly::Scop to ppcg. We also setup basic AST printing facilities to facilitate debugging. To allow code reuse some (minor) changes in ppcg are have been necessary. llvm-svn: 275436
-
Tobias Grosser authored
Instead of calling to a pet function that does not return anything, we pass our own dummy implementation to ppcg that always returns a nullptr. This ensures that the list of ast expressions always contains a nullptr and we do not accidentally free a random (uninitalized) pointer. This resolves the last valgrind warning we see. We provide an implementation for this function, when the generated AST expressions can be used and consequently can be tested. llvm-svn: 275435
-
Tobias Grosser authored
The tile size was previously uninitialized. As a result, it was often zero (aka. no tiling), which is not what we want in general. More importantly, there was the risk for arbitrary tile sizes to be choosen, which we did not observe, but which still is highly problematic. llvm-svn: 275418
-
Benjamin Kramer authored
llvm-svn: 275409
-
Tobias Grosser authored
llvm-svn: 275397
-
Tobias Grosser authored
This change now applies ppcg's GPU mapping on our initial schedule. For this to work, we need to also initialize the set of all names (isl_ids) used in the scop as well as the program context. llvm-svn: 275396
-
Tobias Grosser authored
llvm-svn: 275395
-
Roman Gareev authored
llvm-svn: 275392
-
Tobias Grosser authored
To do so we copy the necessary information to compute an initial schedule from polly::Scop to ppcg's scop. Most of the necessary information is directly available and only needs to be passed on to ppcg, with the exception of 'tagged' access relations, access relations that additionally carry information about which memory access an access relation originates from. We could possibly perform the construction of tagged accesses as part of ScopInfo, but as this format is currently specific to ppcg we do not do this yet, but keep this functionality local to our GPU code generation. After the scop has been initialized, we compute data dependences and ask ppcg to compute an initial schedule. Some of this functionality is already available in polly::DependenceInfo and polly::ScheduleOptimizer, but to keep differences to ppcg small we use ppcg's functionality here. We may later investiage if a closer integration of these tools makes sense. llvm-svn: 275390
-
Tobias Grosser authored
At this stage, we do not yet modify the IR but just generate a default initialized ppcg_scop and gpu_prog and free both immediately. Both will later be filled with data from the polly::Scop and are needed to use PPCG for GPU schedule generation. This commit does not yet perform any GPU code generation, but ensures that the basic infrastructure has been put in place. We also add a simple test case to ensure the new code is run and use this opportunity to verify that GPU_CODEGEN tests are only run if GPU code generation has been enabled in cmake. llvm-svn: 275389
-
- Jul 13, 2016
-
-
Tobias Grosser authored
llvm-svn: 275310
-
Tobias Grosser authored
Add a new pass to serve as basis for automatic accelerator mapping in Polly. The pass structure and the analyses preserved are copied from CodeGeneration.cpp, as we will rely on IslNodeBuilder and IslExprBuilder for LLVM-IR code generation. Polly's accelerator code generation is enabled with -polly-target=gpu I would like to use this commit as opportunity to thank Yabin Hu for his work in the context of two Google summer of code projects during which he implemented initial prototypes of the Polly accelerator code generation -- in parts this code is already available in todays Polly (e.g., tools/GPURuntime). More will come as part of the upcoming Polly ACC changes. Reviewers: Meinersbur Subscribers: pollydev, llvm-commits Differential Revision: http://reviews.llvm.org/D22036 llvm-svn: 275275
-
Tobias Grosser authored
ppcg will be used to provide mapping decisions for GPU code generation. As we do not use C as input language, we do not include pet. However, we include pet.h from pet 82cacb71 plus a set of dummy functions to ensure ppcg links without problems. The version of ppcg committed is unmodified ppcg-0.04 which has been well tested in the context of LLVM. It does not provide an official library interface yet, which means that in upcoming commits we will add minor modifications to make necessary functionality accessible. We will aim to upstream these modifications after we gained enough experience with GPU generation support in Polly to propose a stable interface. Reviewers: Meinersbur Subscribers: pollydev, llvm-commits Differential Revision: http://reviews.llvm.org/D22033 llvm-svn: 275274
-
- Jul 12, 2016
-
-
Michael Kruse authored
Check not only that the compiler is not crashing, but also whether the probablematic part (The sequence of instructions simplified to '4') is reflected in the output. Thanks to Tobias for the hint. llvm-svn: 275189
-
Michael Kruse authored
An assertion in visitSDivInstruction() checked whether the divisor is constant by checking whether the argument is a ConstantInt. However, SCEVValidator allows the divisor to be simplified to a constant by ScalarEvolution. We synchronize the implementation of SCEVValidator and SCEVAffinator to both accept simplified SCEV expressions. llvm-svn: 275174
-
- Jul 11, 2016
-
-
Weiming Zhao authored
Summary: LLVM adds a new value FMRB_DoesNotReadMemory in the enumeration. Reviewers: andrew.w.kaylor, chrisj, zinob, grosser, jdoerfert Subscribers: Meinersbur, pollydev Differential Revision: http://reviews.llvm.org/D22109 llvm-svn: 275085
-
Tobias Grosser authored
Commit r275056 introduced a gcc compile failure due to us using two types named 'Type', the first being the newly introduced member variable 'Type' the second being llvm::Type. We resolve this issue by renaming the newly introduced member variable to AccessType. llvm-svn: 275057
-
Tobias Grosser authored
Summary: With a struct we can use named accessors instead of generic std::get<3>() calls. This increases readability of the source code. Reviewers: jdoerfert Subscribers: pollydev, llvm-commits Differential Revision: http://reviews.llvm.org/D21955 llvm-svn: 275056
-
Tobias Grosser authored
llvm-svn: 275055
-
Tobias Grosser authored
We now compute the invalid context of memory accesses only for the domain under which the memory access is executed. Without limiting ourselves to this restricted domain, invalid accesses outside of the domain of actually executed statement instances may result in the execution domain of the statement to become empty despite the fact that the statement will actually be executed. As a result, such scops would use unitialized values for their computations which results in incorrect computations. This fixes http://llvm.org/PR27944 and unbreaks the -polly-position=before-vectorizer buildbots. llvm-svn: 275053
-
- Jul 08, 2016
-
-
Michael Kruse authored
For llvm the memory accesses from nonaffine loops should be visible, however for polly those nonaffine loops should be invisible/boxed. This fixes llvm.org/PR28245 Cointributed-by:
Huihui Zhang <huihuiz@codeaurora.org> Differential Revision: http://reviews.llvm.org/D21591 llvm-svn: 274842
-
- Jul 07, 2016
-
-
Justin Bogner authored
llvm-svn: 274777
-
- Jul 06, 2016
-
-
Tobias Grosser authored
This is a regular maintenance update to ensure the latest version of isl is tested. Interesting Changes: - AST nodes and expressions are now printed as YAML llvm-svn: 274614
-