aboutsummaryrefslogtreecommitdiff
path: root/polly
AgeCommit message (Collapse)AuthorFilesLines
2024-06-29[IRBuilder] Don't include Module.h (NFC) (#97159)Nikita Popov3-4/+5
This used to be necessary to fetch the DataLayout, but isn't anymore.
2024-06-28[IR] Don't include Module.h in Analysis.h (NFC) (#97023)Nikita Popov3-3/+5
Replace it with a forward declaration instead. Analysis.h is pulled in by all passes, but not all passes need to access the module.
2024-06-24Revert "[IR][NFC] Update IRBuilder to use InsertPosition (#96497)"Stephen Tozer1-2/+2
Reverts the above commit, as it updates a common header function and did not update all callsites: https://lab.llvm.org/buildbot/#/builders/29/builds/382 This reverts commit 6481dc57612671ebe77fe9c34214fba94e1b3b27.
2024-06-24[IR][NFC] Update IRBuilder to use InsertPosition (#96497)Stephen Tozer1-2/+2
Uses the new InsertPosition class (added in #94226) to simplify some of the IRBuilder interface, and removes the need to pass a BasicBlock alongside a BasicBlock::iterator, using the fact that we can now get the parent basic block from the iterator even if it points to the sentinel. This patch removes the BasicBlock argument from each constructor or call to setInsertPoint. This has no functional effect, but later on as we look to remove the `Instruction *InsertBefore` argument from instruction-creation (discussed [here](https://discourse.llvm.org/t/psa-instruction-constructors-changing-to-iterator-only-insertion/77845)), this will simplify the process by allowing us to deprecate the InsertPosition constructor directly and catch all the cases where we use instructions rather than iterators.
2024-06-21[IR] Don't include PassInstrumentation.h in PassManager.h (NFC) (#96219)Nikita Popov1-0/+1
Move PassInstrumentationAnalysis into PassInstrumentation.h and stop including it in PassManager.h (effectively inverting the direction of the dependency). Most places using PassManager are not interested in PassInstrumentation, and we no longer have any uses of it in PassManager.h itself (only in PassManagerImpl.h).
2024-06-20[LLVM] Add InsertPosition union-type to remove overloads of ↵Stephen Tozer1-2/+1
Instruction-creation (#94226) This patch simplifies instruction creation by replacing all overloads of instruction constructors/Create methods that are identical other than the Instruction *InsertBefore/BasicBlock *InsertAtEnd/BasicBlock::iterator InsertBefore argument with a single version that takes an InsertPosition argument. The InsertPosition class can be implicitly constructed from any of the above, internally converting them to the appropriate BasicBlock::iterator value which can then be used to insert the instruction (or to not insert it if an invalid iterator is passed). The upshot of this is that code will be deduplicated, and all callsites will switch to calling the new unified version without any changes needed to make the compiler happy. There is at least one exception to this; the construction of InsertPosition is a user-defined conversion, so any caller that was already relying on a different user-defined conversion won't work. In all of LLVM and Clang this happens exactly once: at clang/lib/CodeGen/CGExpr.cpp:123 we try to construct an alloca with an AssertingVH<Instruction> argument, which must now be cast to an Instruction* by using `&*`. If this is more common elsewhere, it could be fixed by adding an appropriate constructor to InsertPosition.
2024-06-14 [RemoveDIs] Print IR with debug records by default (#91724)Stephen Tozer1-5/+5
This patch makes the final major change of the RemoveDIs project, changing the default IR output from debug intrinsics to debug records. This is expected to break a large number of tests: every single one that tests for uses or declarations of debug intrinsics and does not explicitly disable writing records. If this patch has broken your downstream tests (or upstream tests on a configuration I wasn't able to run): 1. If you need to immediately unblock a build, pass `--write-experimental-debuginfo=false` to LLVM's option processing for all failing tests (remember to use `-mllvm` for clang/flang to forward arguments to LLVM). 2. For most test failures, the changes are trivial and mechanical, enough that they can be done by script; see the migration guide for a guide on how to do this: https://llvm.org/docs/RemoveDIsDebugInfo.html#test-updates 3. If any tests fail for reasons other than FileCheck check lines that need updating, such as assertion failures, that is most likely a real bug with this patch and should be reported as such. For more information, see the recent PSA: https://discourse.llvm.org/t/psa-ir-output-changing-from-debug-intrinsics-to-debug-records/79578
2024-06-04[IR] Remove support for icmp and fcmp constant expressions (#93038)Nikita Popov1-1/+1
Remove support for the icmp and fcmp constant expressions. This is part of: https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179 As usual, many of the updated tests will no longer test what they were originally intended to -- this is hard to preserve when constant expressions get removed, and in many cases just impossible as the existence of a specific kind of constant expression was the cause of the issue in the first place.
2024-06-03[test] Fix filecheck annotation typos (#91854)klensy1-1/+1
Similar to https://github.com/rust-lang/rust/pull/125007
2024-05-28[polly] Fix cppcheck SA comment reported in #91235 (#93505)Karthika Devi C1-1/+1
This patch moves the unreachable assert before return statement. Fixes #91235.
2024-05-25[polly] Revise IDE folder structure (#89752)Michael Kruse7-17/+12
Update the folder titles for targets in the monorepository that have not seen taken care of for some time. These are the folders that targets are organized in Visual Studio and XCode (`set_property(TARGET <target> PROPERTY FOLDER "<title>")`) when using the respective CMake's IDE generator. * Ensure that every target is in a folder * Use a folder hierarchy with each LLVM subproject as a top-level folder * Use consistent folder names between subprojects * When using target-creating functions from AddLLVM.cmake, automatically deduce the folder. This reduces the number of `set_property`/`set_target_property`, but are still necessary when `add_custom_target`, `add_executable`, `add_library`, etc. are used. A LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's root CMakeLists.txt.
2024-05-24Reland "[polly] Port polly tests to use NPM" (#92918)rahulana-quic1018-1450/+1386
Even as the NPM has been in use by Polly for a while now, the majority of the tests continue using the LPM passes. This patch ports the tests to use the NPM passes (for example, by replacing a flag such as -polly-detect with -passes=polly-detect following the NPM syntax for specifying passes) with some exceptions for some missing features in the new passes. Relanding #90632.
2024-05-14Revert "[polly] Port polly tests to use NPM" (#92215)Eli Friedman1026-1404/+1472
Reverts llvm/llvm-project#90632. Causing failures on buildbots that dynamically load polly. Reverting while we sort it out.
2024-05-14[polly] Port polly tests to use NPM (#90632)rahulana-quic1026-1472/+1404
Even as the NPM has been in use by Polly for a while now, the majority of the tests continue using the LPM passes. This patch ports the tests to use the NPM passes (for example, by replacing a flag such as -polly-detect with -passes=polly-detect following the NPM syntax for specifying passes) with some exceptions for some missing features in the new passes. Additionally, the lit substitution %loadPolly is replaced by the substitution of what was %loadNPMPolly and %loadNPMPolly is removed.
2024-04-17[clang-format] Revert breaking stream operators to previous default (#89016)Owen Pan2-5/+6
Reverts commit d68826dfbd98, which changes the previous default behavior of always breaking before a stream insertion operator `<<` if both operands are string literals. Also reverts the related commits 27f547968cce and bf05be5b87fc. See the discussion in #88483.
2024-04-09[clang-format] Correctly annotate braces in macros (#87953)Owen Pan1-1/+1
Also fix unit tests and reformat polly. Fixes #86550.
2024-04-09[polly] Fix cppcheck SA comments reported in #82263 (#85749)Karthika Devi C2-12/+11
This patch addresses the (performance )suggestions by checkcpp static analyzer for couple of files. Here we use const reference for the suggested function arguments. Fixes #82263.
2024-03-26[polly] Add polly-debug flag to print debug info from all parts of polly ↵Karthika Devi C24-236/+412
(#78549) This flag enable the user to print debug Info from all the passes and helpers inside polly at once. This will help a novice user as well to work in polly without explicitly having to know which parts of polly has actually kicked in and pass them via -debug-only.
2024-03-19[NFC][RemoveDIs] Use iterators for insertion at various call-sites (#84736)Jeremy Morse3-6/+8
These are the last remaining "trivial" changes to passes that use Instruction pointers for insertion. All of this should be NFC, it's just changing the spelling of how we identify a position. In one or two locations, I'm also switching uses of getNextNode etc to using std::next with iterators. This too should be NFC. --------- Merged by: Stephen Tozer <stephen.tozer@sony.com>
2024-03-05[NFC][RemoveDIs] Always use iterators for inserting PHIsJeremy Morse1-1/+1
It's becoming potentially unsafe to insert a PHI instruction using a plain Instruction pointer. Switch all the remaining sites that create and insert PHIs to use iterators instead. For example, the code in ComplexDeinterleavingPass.cpp is definitely at-risk of mixing PHIs and debug-info.
2024-02-19[clang-format] Correctly annotate braces of empty ctors/dtors (#82097)Owen Pan4-4/+4
Also reformat Polly. Fixes #79834.
2024-02-16[LegacyPM] Remove legacy LoopRotate passArthur Eubanks1-1/+0
2024-02-14[polly][ScheduleOptimizer] Use IslMaxOperationsGuard helper instead of ↵Karthika Devi C2-18/+9
explicit restoration (#79303) To fix long compile time issue of Schedule optimizer, patch #77280 sets the upper cap on max ISL operations. In case of bailing out when ISL quota is hit, error handling behavior was restored manually. This commit replaces the restoration code with IslMaxOperationsGuard helper and also removes redundant early return.
2024-02-12[polly] Make reduction detection checks more robust - part 2 (#80721)Karthika Devi C4-10/+14
Existing reduction detection algorithm does two types of memory checks before marking a load store pair as reduction. Second check is to verify there is no other memory access in ScopStmt overlapping with the memory of load and store that forms the reduction. Existing check misses cases where there could be probable overlap such as A[V] += A[P]; In the above case there is chance of overlap between A[V] and A[P] which is missed. This commit addresses this by removing the parameter from space before checking for compatible space. Part 1 of this patch : [75297](https://github.com/llvm/llvm-project/pull/75297)
2024-02-09[Polly][DebugInfo] Use getStableDebugLoc to avoid intrinsic-dependent ↵Stephen Tozer4-8/+8
behaviour (#81246) Polly currently uses `getDebugLoc` in a few places to produce diagnostic output; this is correct when interacting with specific instructions, but may be incorrect when dealing with instruction ranges if debug intrinsics are included. As a general rule, the debug locations attached to debug intrinsics may be misleading compared to the surrounding instructions, and are not generally used for anything other than determining variable scope info; the recommended approach is therefore to use `getStableDebugLoc` instead, which skips over debug intrinsics. This is necessary to fix test failures that occur when enabling non-instruction debug info, which removes debug intrinsics from basic blocks and thus alters the diagnostic output of Polly (despite causing no functional change).
2024-01-30[polly] Make reduction detection checks more robust - part 1 (#75297)Karthika Devi C3-3/+107
Existing reduction detection algorithm does two types of memory checks before marking a load store pair as reduction. First is to check if load and store are pointing to the same memory. This check right now detects the following case as reduction. sum[0] = sum[1] + A[i] This is because the check compares only base of the memory addresses involved and not their indices. This patch addresses this issue and introduces some debug prints. Added couple of test cases to verify the functionality of patch as well.
2024-01-17[AST] Don't merge memory locations in AliasSetTracker (#65731)Bruno De Fraine3-6/+7
This changes the AliasSetTracker to track memory locations instead of pointers in its alias sets. The motivation for this is outlined in an RFC posted on LLVM discourse: https://discourse.llvm.org/t/rfc-dont-merge-memory-locations-in-aliassettracker/73336 In the data structures of the AST implementation, I made the choice to replace the linked list of `PointerRec` entries (that had to go anyway) with a simple flat vector of `MemoryLocation` objects, but for the `AliasSet` objects referenced from a lookup table, I retained the mechanism of a linked list, reference counting, forwarding, etc. The data structures could be revised in a follow-up change.
2024-01-08[polly][ScheduleOptimizer] Reland Fix long compile time(hang) reported in ↵Karthika Devi C2-0/+124
polly (#77280) There is no upper cap set on current Schedule Optimizer to compute schedule. In some cases a very long compile time taken to compute the schedule resulting in hang kind of behavior. This patch introduces a flag 'polly-schedule-computeout' to pass the capwhich is initialized to 300000. This patch handles the compute out cases by bailing out and exiting gracefully. Fixed the test that failed in previous commit. Fixes #69090
2024-01-02Revert "[polly][ScheduleOptimizer] Fix long compile time(hang) reported in ↵Eli Friedman2-111/+1
polly (#75141)" This reverts commit d6c4d4c9b910e8ad5ed7cd4825a143742041c1f4. Broke buildldbots with asserts disabled; -debug-only is only available in asserts builds.
2024-01-02[polly][ScheduleOptimizer] Fix long compile time(hang) reported in polly ↵Karthika Devi C2-1/+111
(#75141) There is no upper cap set on current Schedule Optimizer to compute schedule. In some cases a very long compile time taken to compute the schedule resulting in hang kind of behavior. This patch introduces a flag 'polly-schedule-computeout' to pass the capwhich is initialized to 300000. This patch handles the compute out cases by bailing out and exiting gracefully. Fixes #69090
2023-12-25[polly] [CMake] Create component and install target in add_polly_library ↵Violet Purcell1-0/+3
(#66598) Currently there's no component for LLVMPolly and PollyISL, however they are added to exports whether or not they are installed. This commit calls add_llvm_install_targets in the add_polly_library function to allow installation of LLVMPolly and PollyISL via distribution components, so they can be installed without also installing libPolly.a. Closes: https://github.com/llvm/llvm-project/pull/66598
2023-12-25[polly] [CMake] Link polly-isl-test with LLVMSupport (#65424)vient1-0/+1
Otherwise link may fail if user provided additional library to link with via CMAKE_EXE_LINKER_FLAGS. Concrete example is using custom allocator, LLVMSupport provides needed -lpthread in that case. Closes: https://github.com/llvm/llvm-project/pull/65424
2023-12-07[polly][NFC] Refactor reduction detection code for modularity (#72343)Karthika Devi C1-30/+48
This patch pulls out the memory checks from the base reduction detection algorithm. This is the first one in the reduction patch series, to reduce the difference in future patches.
2023-12-05[Polly] Add disjoint flag to some tests (NFC)Nikita Popov4-8/+8
2023-12-05[llvm][NFC] A start at cleaning up zero byte files that should have been ↵Brad Smith1-0/+0
removed (#74404)
2023-12-05Revert "[lldb] A start at cleaning up zero byte files that should have been ↵Brad Smith1-0/+0
removed" This reverts commit 3223936dc512c9f4f87a230a4d2931e37186ca22. Commited by accident while mixed in with another commit.
2023-12-04[lldb] A start at cleaning up zero byte files that should have been removedBrad Smith1-0/+0
2023-12-04[Support] Remove llvm/Support/Host.h (#74261)Kazu Hirata1-1/+1
The header file has been deprecated since: commit f09cf34d00625e57dea5317a3ac0412c07292148 Author: Archibald Elliott <archibald.elliott@arm.com> Date: Tue Dec 20 10:24:02 2022 +0000
2023-11-27[mlir,polly] Replace uses of IRBuilder::getInt8PtrTy with getPtrTy. NFCFangrui Song4-15/+14
2023-11-07[NFC] Remove Type::getInt8PtrTy (#71029)Paulo Matos1-1/+1
Replace this with PointerType::getUnqual(). Followup to the opaque pointer transition. Fixes an in-code TODO item.
2023-10-31[SCEV] Teach SCEVExpander to use zext nneg when possible (#70815)Philip Reames1-1/+1
zext nneg was recently added to the IR in #67982. Teaching SCEVExpander to emit nneg when possible is valuable since SCEV may have proved non-trivial facts about loop bounds which would otherwise be lost when materializing the value.
2023-10-24[ADT] Rename llvm::erase_value to llvm::erase (NFC) (#70156)Kazu Hirata1-3/+3
C++20 comes with std::erase to erase a value from std::vector. This patch renames llvm::erase_value to llvm::erase for consistency with C++20. We could make llvm::erase more similar to std::erase by having it return the number of elements removed, but I'm not doing that for now because nobody seems to care about that in our code base. Since there are only 50 occurrences of erase_value in our code base, this patch replaces all of them with llvm::erase and deprecates llvm::erase_value.
2023-10-24[polly] Reformat due to d68826dfbd98Owen Pan2-6/+5
2023-10-20[polly] Use llvm::erase_value (NFC)Kazu Hirata1-7/+3
2023-09-19Move CallInst::CreateFree to IRBuilderBaseKonrad Kleine1-2/+2
Similarly to D158861 I'm moving the `CreateFree` method from `CallInst` to `IRBuilderBase`. Differential Revision: https://reviews.llvm.org/D159418
2023-09-19[llvm] Move CallInst::CreateMalloc to IRBuilderBase::CreateMallocKonrad Kleine1-3/+3
This removes `CreateMalloc` from `CallInst` and adds it to the `IRBuilderBase` class. We no longer needed the `Instruction *InsertBefore` and `BasicBlock *InsertAtEnd` arguments of the `createMalloc` helper function because we're using `IRBuilder` now. That's why I we also don't need 4 `CreateMalloc` functions, but only two. Differential Revision: https://reviews.llvm.org/D158861
2023-09-18[IR] Remove unnecessary bitcast from CreateMalloc()Nikita Popov1-7/+7
This bitcast is no longer necessary with opaque pointers. This results in some annoying variable name changes in tests.
2023-09-13[polly][www] Remove unused VideoJSJordan Rupprecht5-2014/+0
These were added in 2011 in 54da06ca286dc47ae65ba87be439a8c20c685454 and 0d90112195609a85fa96e956ee8b48600d81c13c. It was then incompletely removed in 2015 in c268835eca8f59b164caa50bdecb7b58415861af: the video itself was removed, but the VideoJS css & script is still loaded.
2023-09-05Bug fix for multi-line labels in CFG dot graphMarek Sedláček1-1/+1
After D154102 multi-line labels would get split incorrectly. When CFG is generated for a function with basic block name longer than 80 lines, then the header separator will be placed after the line break for the label name instead of after the whole label name. The fix is simple by just moving the insert of | character before the line splitting happens. Differential Revision: https://reviews.llvm.org/D159207
2023-09-05[polly] Dynamic libraries are not supported on CygwinCarlo Bramini2-2/+2
Cygwin shares the same limitations as traditional Windows executables for dynamic library loading, so disable building the dynamic library on Cygwin targets. Differential Revision: https://reviews.llvm.org/D155796