summaryrefslogtreecommitdiffstats
path: root/polly/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [IR] Include more target specific intrinsic headersHeejin Ahn2019-12-141-0/+1
| | | | After D71320, target-specific intrinsic headers should be included.
* [IR] Include target specific intrinsic headersHeejin Ahn2019-12-122-2/+2
| | | | After D71320, target-specific intrinsic headers should be included.
* [GPGPU] Fix depricated warning.Michael Kruse2019-11-141-1/+1
| | | | | | | setAlignment(unsigned) was deprecated in commit: 0e62011df891d0e7ad904524edf705d07d12d5d4 [Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)
* [GPGPU] Fix #includes.Michael Kruse2019-11-142-0/+2
| | | | | | Adapt for 05da2fe52162 "Sink all InitializePasses.h includes" which forgot the GPGPU files (presumably because POLLY_ENABLE_GPGPU_CODEGEN is OFF by default).
* Move CodeGenFileType enum to Support/CodeGen.hReid Kleckner2019-11-131-2/+1
| | | | | | | Avoids the need to include TargetMachine.h from various places just for an enum. Various other enums live here, such as the optimization level, TLS model, etc. Data suggests that this change probably doesn't matter, but it seems nice to have anyway.
* Sink all InitializePasses.h includesReid Kleckner2019-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of recompilation. I found this fact by looking at this table, which is sorted by the number of times a file was changed over the last 100,000 git commits multiplied by the number of object files that depend on it in the current checkout: recompiles touches affected_files header 342380 95 3604 llvm/include/llvm/ADT/STLExtras.h 314730 234 1345 llvm/include/llvm/InitializePasses.h 307036 118 2602 llvm/include/llvm/ADT/APInt.h 213049 59 3611 llvm/include/llvm/Support/MathExtras.h 170422 47 3626 llvm/include/llvm/Support/Compiler.h 162225 45 3605 llvm/include/llvm/ADT/Optional.h 158319 63 2513 llvm/include/llvm/ADT/Triple.h 140322 39 3598 llvm/include/llvm/ADT/StringRef.h 137647 59 2333 llvm/include/llvm/Support/Error.h 131619 73 1803 llvm/include/llvm/Support/FileSystem.h Before this change, touching InitializePasses.h would cause 1345 files to recompile. After this change, touching it only causes 550 compiles in an incremental rebuild. Reviewers: bkramer, asbirlea, bollu, jdoerfert Differential Revision: https://reviews.llvm.org/D70211
* [CodeGen] Fix getArrayAccessFor crashes as in bug 32534 with ↵Michael Kruse2019-11-121-2/+2
| | | | | | | | | | | | | | | | | | -polly-vectorizer=polly. Root cause is VectorBlockGenerator::copyStmt iterates all instructions in basic block, however some load instructions may be not unnecessary thus removed by simplification. As a result, these load instructions don't have a corresponding array. Looking at BlockGenerator::copyBB, it only iterates instructions list of ScopStmt. Given it must be a block type scop in case of vectorization, I think we should do the same in VectorBlockGenerator::copyStmt. Patch by bin.narwal <bin.narwal@gmail.com> Differential Revision: https://reviews.llvm.org/D70076
* [Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)Guillaume Chatelet2019-10-151-2/+2
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: arsenm, mehdi_amini, jvesely, nhaehnle, hiraditya, steven_wu, dexonsmith, dang, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68944 llvm-svn: 374880
* [Alignment][NFC] Remove StoreInst::setAlignment(unsigned)Guillaume Chatelet2019-10-031-1/+1
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet, bollu, jdoerfert Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68268 llvm-svn: 373595
* [Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)Guillaume Chatelet2019-09-301-1/+2
| | | | | | | | | | | | | | | | | Summary: This is patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Reviewers: courbet Subscribers: jholewinski, arsenm, jvesely, nhaehnle, eraman, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D68141 llvm-svn: 373207
* [Alignment] Fix polly buildGuillaume Chatelet2019-09-302-3/+4
| | | | llvm-svn: 373199
* [CodeGen] Handle outlining of CopyStmts.Michael Kruse2019-09-171-3/+4
| | | | | | | | | | | | | | | | Since the removal of extensions nodes from schedule trees in r362257 it is possible to emit parallel code for SCoPs containing matrix-multiplications. However, the code looking for references used in outlined statement was not prepared to handle CopyStmts introduced by the matrix-matrix multiplication detection. In this case, CopyStmts do not introduce references in addition to the ones captured by MemoryAccesses, i.e. we change the assertion to accept CopyStmts and add a regression test for this case. This fixes llvm.org/PR43164 llvm-svn: 372188
* [ScheduleOptimizer] Hoist extension nodes after schedule optimization.Michael Kruse2019-05-311-6/+0
| | | | | | | | | | | | | | | | | | | | | | Extension nodes make schedule trees are less flexible: Many operations, such as rescheduling, do not work on such schedule trees with extension. As such, some functionality such as determining parallel loops in isl's AST are disabled. Currently, only the pattern-matching generalized matrix-matrix multiplication optimization adds extension nodes (to add copy-in statements). This patch removes all extension nodes as the last step of the schedule optimization by hoisting the extension node's added domain up to the root domain node. All following passes can assume that schedule trees work without restrictions, including the parallelism test. Mark the outermost loop of the optimized matrix-matrix multiplication as parallel such that -polly-parallel is able to parallelize that loop. Differential Revision: https://reviews.llvm.org/D58202 llvm-svn: 362257
* [CodeGen] Fix order of PHINode and MA Write generation.Michael Kruse2019-05-201-1/+18
| | | | | | | | | | | | | | | | At the end of a region statement, the PHINode must be generated while the current IRBuilder's block is the region's exit node. For obvious reasons: The PHINode references the region's exiting block. A partial write would insert new control flow, i.e. insert new basic blocks between the exiting blocks and the current block. We fix this by generating the PHI nodes (region exit values) before generating any MemoryAccess's stores. This should fix the AOSP buildbot. Reported-by: Eli Friedman <efriedma@quicinc.com> llvm-svn: 361204
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-2813-78/+5
| | | | | | | | | | | | This removes unused includes (and forward declarations) as suggested by include-what-you-use. If a transitive include of a removed include is required to compile a file, I added the required header (or forward declaration if suggested by include-what-you-use). This should reduce compilation time and reduce the number of iterative recompilations when a header was changed. llvm-svn: 357209
* [CodeGen] LLVM OpenMP Backend.Michael Kruse2019-03-194-172/+805
| | | | | | | | | | | | | | | | | | | | | The ParallelLoopGenerator class is changed such that GNU OpenMP specific code was removed, allowing to use it as super class in a template-pattern. Therefore, the code has been reorganized and one may not use the ParallelLoopGenerator directly anymore, instead specific implementations have to be provided. These implementations contain the library-specific code. As such, the "GOMP" (code completely taken from the existing backend) and "KMP" variant were created. For "check-polly" all tests that involved "GOMP": equivalents were added that test the new functionalities, like static scheduling and different chunk sizes. "docs/UsingPollyWithClang.rst" shows how the alternative backend may be used. Patch by Michael Halkenhäuser <michaelhalk@web.de> Differential Revision: https://reviews.llvm.org/D59100 llvm-svn: 356434
* [opaque pointer types] Update calls to CreateCall to pass the functionJames Y Knight2019-02-081-2/+3
| | | | | | type in lldb and polly. llvm-svn: 353549
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1913-52/+39
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [TI removal] Make `getTerminator()` return a generic `Instruction`.Chandler Carruth2018-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This removes the primary remaining API producing `TerminatorInst` which will reduce the rate at which code is introduced trying to use it and generally make it much easier to remove the remaining APIs across the codebase. Also clean up some of the stragglers that the previous mechanical update of variables missed. Users of LLVM and out-of-tree code generally will need to update any explicit variable types to handle this. Replacing `TerminatorInst` with `Instruction` (or `auto`) almost always works. Most of these edits were made in prior commits using the perl one-liner: ``` perl -i -ple 's/TerminatorInst(\b.* = .*getTerminator\(\))/Instruction\1/g' ``` This also my break some rare use cases where people overload for both `Instruction` and `TerminatorInst`, but these should be easily fixed by removing the `TerminatorInst` overload. llvm-svn: 344504
* [IslAst] Fix InParallelFor nesting.Michael Kruse2018-09-271-20/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IslAst could mark two nested outer loops as "OutermostParallel". It caused that the code generator tried to OpenMP-parallelize both loops, which it is not prepared loop. It was because the recursive AST build algorithm managed a flag "InParallelFor" to ensure that no nested loop is also marked as "OutermostParallel". Unfortunatetly the same flag was used by nodes marked as SIMD, and reset to false after the SIMD node. Since loops can be marked as SIMD inside "OutermostParallel" loops, the recursive algorithm again tried to mark loops as "OutermostParellel" although still nested inside another "OutermostParallel" loop. The fix exposed another bug: The function "astScheduleDimIsParallel" was only called when a loop was potentially "OutermostParallel" or "InnermostParallel", but as a side-effect also determines the minimum dependence distance. Hence, changing when we need to know whether a loop is "OutermostParallel" also changed which loop was annotated with "#pragma minimal dependence distance". Moreover, some complex condition linked with "InParallelFor" determined whether a loop should be an "InnermostParallel" loop. It missed some situations where it would not use mark as such although being inside an SIMD mark node, and therefore not be annotated using "#pragma simd". The changes in particular: 1. Split the "InParallelFor" flag into an "InParallelFor" and an "InSIMD" flag. 2. Unconditionally call "astScheduleDimIsParallel" for its side-effects and store the result in "InParallel" for later use. 3. Simplify the condition when a loop is "InnermostParallel". Fixes llvm.org/PR33153 and llvm.org/PR38073. llvm-svn: 343212
* [PerfMonitor] Fix rdtscp callsitesTobias Grosser2018-09-111-15/+9
| | | | | | | | | | | | | Summary: Update all rdtscp callsites in PerfMonitor so that they conform with the signature changes introduced in r341698. Reviewers: grosser, bollu Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D51928 llvm-svn: 341946
* PPCG codegenTobias Grosser2018-08-011-1/+2
| | | | | | | | The latest version of the isl C++ bindings does not export the 'set' method yet. Fall back to the C interface until this method can be exported. llvm-svn: 338512
* [Polly-ACC] Fix compilation after r338450. NFC.Michael Kruse2018-08-011-1/+1
| | | | llvm-svn: 338462
* [CodeGen] Convert IslNodeBuilder::getNumberOfIterations to isl++. NFC.Michael Kruse2018-07-311-30/+18
| | | | llvm-svn: 338451
* [CodeGen] Convert IslNodeBuilder::createForSequential to isl++. NFC.Michael Kruse2018-07-311-25/+17
| | | | llvm-svn: 338450
* [CodeGen] Convert IslNodeBuilder::getUpperBound to isl++. NFC.Michael Kruse2018-07-311-30/+17
| | | | llvm-svn: 338449
* [IslNodeBuilder] Use isl++ to replace foreach_set with for loopTobias Grosser2018-07-171-14/+13
| | | | llvm-svn: 337247
* [CodeGen] Fix potential null pointer dereference. NFC.Michael Kruse2018-07-051-3/+5
| | | | | | | | | | ScalarEvolution::getSCEV dereferences its argument, s.t. passing nullptr leads to undefined behaviour. Check for nullptr before calling it instead of checking its argument afterwards. llvm-svn: 336350
* [PPCGCodeGen] Change printf to outs() to prevent garbled output. [NFC]Siddharth Bhat2018-07-041-8/+8
| | | | | | | | | | | | | | | | | Summary: It appears that llvm uses unbuffered C++ streams. So, we should not mix C and C++ stream operations, because that will give us mixed up output. Reviewers: efriedma, jdoerfert, Meinersbur, gareevroman, sebpop, zinob, huihuiz, pollydev, grosser, singam-sanjay, philip.pfaffe Reviewed By: philip.pfaffe Subscribers: nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D40126 llvm-svn: 336288
* [polly-acc] change cl_get_* return types to 32/64bitPhilip Pfaffe2018-07-021-9/+17
| | | | | | | | | | | | | | | | | | | Summary: This patch changes the return types for ocl_get_* functions during SPIR code generation. Because these functions return size_t types, the return type needs to be changed to the actual size of size_t on the device. Based on work by Michal Babej and Pekka Jääskeläinen Patch by: Alain Denzler Reviewers: grosser, philip.pfaffe, bollu Reviewed By: grosser, philip.pfaffe Subscribers: nemanjai, kbarton, llvm-commits Differential Revision: https://reviews.llvm.org/D48774 llvm-svn: 336080
* Simplify the implementation of getCUDALibDeviceFunction. NFC.Philip Pfaffe2018-06-141-13/+9
| | | | | | | | | | | | | | | | Summary: The function is currently awfully complicated. Drop the IILE and use StringRef over std::string. Reviewers: Meinersbur, grosser, bollu Reviewed By: Meinersbur Subscribers: nemanjai, kbarton, bollu, llvm-commits, pollydev Differential Revision: https://reviews.llvm.org/D48070 llvm-svn: 334695
* Run clang-formatPhilip Pfaffe2018-06-071-1/+1
| | | | llvm-svn: 334172
* Fix a missing lambda return type that tripped the buildersPhilip Pfaffe2018-06-071-1/+1
| | | | llvm-svn: 334166
* getDependences to new C++ interfaceTobias Grosser2018-06-061-4/+8
| | | | | | | | | | | | | | Reviewers: Meinersbur, grosser, bollu, cs15btech11044, jdoerfert Reviewed By: grosser Subscribers: pollydev, llvm-commits Tags: #polly Differential Revision: https://reviews.llvm.org/D47786 llvm-svn: 334092
* Fix formattingTobias Grosser2018-06-051-1/+1
| | | | llvm-svn: 333988
* Update for a header file move in LLVMDavid Blaikie2018-06-041-1/+1
| | | | llvm-svn: 333956
* [Acc] Re-land r326643 to finally fix PR33208.Philip Pfaffe2018-05-231-2/+4
| | | | | | | Other than before, don't clear out LI entirely but only those relevant loops. llvm-svn: 333089
* CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne2018-05-211-2/+3
| | | | | | | | | | up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
* [polly] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-155-39/+42
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44978 llvm-svn: 332352
* Remove another set or release() callsTobias Grosser2018-04-291-3/+3
| | | | llvm-svn: 331129
* Remove the last uses of isl::give and isl::takeTobias Grosser2018-04-291-9/+9
| | | | llvm-svn: 331126
* [CodeGen] Print executed statement instances at runtime.Michael Kruse2018-04-252-0/+128
| | | | | | | | | | | | | Add the options -polly-codegen-trace-stmts and -polly-codegen-trace-scalars. When enabled, adds a call to the beginning of every generated statement that prints the executed statement instance. With -polly-codegen-trace-scalars, it also prints the value of all scalars that are used in the statement, and PHIs defined in the beginning of the statement. Differential Revision: https://reviews.llvm.org/D45743 llvm-svn: 330864
* Fixup Polly for an LLVM header file change.David Blaikie2018-04-241-0/+1
| | | | llvm-svn: 330679
* [RuntimeDebugBuilder] Do not break for 64 bit integersTobias Grosser2018-04-191-3/+6
| | | | | | | | | In r330292 this assert was turned incorrectly into an unreachable, but the correct behavior (thanks Michael) is to assert for anything that is not 64 bit, but falltrough for 64 bit. I document this in the source code. llvm-svn: 330309
* [RuntimeDebugBuilder] Turn assert into an unreachableTobias Grosser2018-04-181-2/+1
| | | | llvm-svn: 330289
* [CodeGen] Allow undefined loads in statement instances outside context.Michael Kruse2018-04-101-1/+2
| | | | | | | | | | | | | | | | | | | | A check in assert-builds was meant to verify that a load provides a value in all statement instances (i.e. its domain). The domain is commonly gist'ed within the parameter context to contain fewer constraints. However, statement instances outside the context are no valid executions, hence the value provided can be undefined. Refine the check for valid loads to only needed to be defined within the SCoP context. In addition, the JSONImporter had to be changed to allow importing access relations that are broader than the current access relation, but still defined over all statement instances. This should fix the compiler crash in test-suite's oggenc of the -polly-process-unprofitable buildbot. llvm-svn: 329655
* [CodeGen] Convert BlockGenerator::generateScalarLoads to isl++. NFC.Michael Kruse2018-04-101-5/+3
| | | | llvm-svn: 329654
* [Polly][IslAst] Fix minimal dependence distance.Huihui Zhang2018-04-041-2/+7
| | | | | | | | | | | | | | | | | | | Summary: When checking the parallelism of a scheduling dimension, we first check if excluding reduction dependences the loop is parallel or not. If the loop is not parallel, then we need to return the minimal dependence distance of all data dependences, including the previously subtracted reduction dependences. Reviewers: grosser, Meinersbur, efriedma, eli.friedman, jdoerfert, bollu Reviewed By: Meinersbur Subscribers: llvm-commits, pollydev Tags: #polly Differential Revision: https://reviews.llvm.org/D45236 llvm-svn: 329214
* Fix polly build after r328717Reid Kleckner2018-03-281-0/+1
| | | | llvm-svn: 328728
* Update for LLVM header movementDavid Blaikie2018-03-211-1/+1
| | | | llvm-svn: 328169
OpenPOWER on IntegriCloud