summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/SafepointIRVerifier.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sink all InitializePasses.h includesReid Kleckner2019-11-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* SafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null ↵Simon Pilgrim2019-09-241-2/+2
| | | | | | | | dereference warnings. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast<Instruction> directly and if not assert will fire for us. llvm-svn: 372758
* SafepointIRVerifier port to new Pass ManagerFedor Sergeev2019-03-311-0/+11
| | | | | | | | | | | | | Straightforward port of StatepointIRVerifier pass to new Pass Manager framework. Fix By: skatkov Reviewed By: fedor.sergeev Differential Revision: https://reviews.llvm.org/D59825 This is a re-land of r357147/r357148 with LLVM_ENABLE_MODULES build fixed. Adding IR/SafepointIRVerifier.h into its own module. llvm-svn: 357361
* Temporarily revert "SafepointIRVerifier port to new Pass Manager"Adrian Prantl2019-03-281-11/+0
| | | | | | | | | | | to unbreak the modular bots and its follow-up commit. This reverts commit https://reviews.llvm.org/D59825 because it introduced a fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen llvm-svn: 357201
* SafepointIRVerifier port to new Pass ManagerSerguei Katkov2019-03-281-0/+11
| | | | | | | | | | | Straightforward port of StatepointIRVerifier pass to new Pass Manager framework. Reviewers: fedor.sergeev, reames Reviewed By: fedor.sergeev Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D59825 llvm-svn: 357147
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* [opaque pointer types] Remove some calls to generic Type subtype accessors.James Y Knight2019-01-101-1/+1
| | | | | | | | | | | | That is, remove many of the calls to Type::getNumContainedTypes(), Type::subtypes(), and Type::getContainedType(N). I'm not intending to remove these accessors -- they are useful/necessary in some cases. However, removing the pointee type from pointers would potentially break some uses, and reducing the number of calls makes it easier to audit. llvm-svn: 350835
* Use llvm::any_of instead std::any_of. NFCFangrui Song2018-10-311-2/+1
| | | | llvm-svn: 345683
* [TI removal] Make variables declared as `TerminatorInst` and initializedChandler Carruth2018-10-151-1/+1
| | | | | | | | | | | | | by `getTerminator()` calls instead be declared as `Instruction`. This is the biggest remaining chunk of the usage of `getTerminator()` that insists on the narrow type and so is an easy batch of updates. Several files saw more extensive updates where this would cascade to requiring API updates within the file to use `Instruction` instead of `TerminatorInst`. All of these were trivial in nature (pervasively using `Instruction` instead just worked). llvm-svn: 344502
* Add maybe-unused attribute to a variable.Nick Desaulniers2018-08-011-0/+1
| | | | | | | | | | | | | | | | | Summary: Mark a variable as maybe-unused to prevent a -Wunused-but-set-variable warning in optimized builds where asserts are removed.Test/first commit to check setup and understand patch submission process. Reviewers: srhines, pirama, dblaikie Reviewed By: dblaikie Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49756 llvm-svn: 338654
* SafepointIRVerifier should ignore dead blocks and dead edgesArtur Pilipenko2018-06-251-28/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only should SafepointIRVerifier ignore unreachable blocks (as suggested in https://reviews.llvm.org/D47011) but it also has to ignore dead blocks. In @test2 (see the new tests): br i1 true, label %right, label %left left: ... right: ... merge: %val = phi i8 addrspace(1)* [ ..., %left ], [ ..., %right ] use %val both left and right branches are reachable. If they collide then SafepointIRVerifier reports an error. Because of the foldable branch condition GVN finds the left branch dead and removes the phi node entry that merges values from right and left. Then the use comes from the right branch. This results in no collision. So, SafepointIRVerifier ends up in different results depending on either GVN is run or not. To solve this issue this patch adds Dead Block detection to SafepointIRVerifier which can ignore dead blocks while validating IR. The Dead Block detection algorithm is taken from GVN but modified to not split critical edges. That is needed to keep CFG unchanged by SafepointIRVerifier. Patch by Yevgeny Rouban. Reviewed By: anna, apilipenko, DaniilSuchkov Differential Revision: https://reviews.llvm.org/D47441 llvm-svn: 335473
* SafepointIRVerifier is made unreachable block tolerantSerguei Katkov2018-05-231-7/+20
| | | | | | | | | | | | | | | SafepointIRVerifier crashed while traversing blocks without a DomTreeNode. This could happen with a custom pipeline or when some optional passes were skipped by OptBisect. SafepointIRVerifier is fixed to traverse basic blocks that are reachable from entry. Test are added. Patch Author: Yevgeny Rouban! Reviewers: anna, reames, dneilson, DaniilSuchkov, skatkov Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47011 llvm-svn: 333063
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-10/+11
| | | | | | | | | | | | | | | | 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 - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* [SafepointIRVerifier] Allow non-dereferencing uses of unrelocated or ↵Max Kazantsev2017-12-251-19/+137
| | | | | | | | | | | | | | | | | | poisoned PHI nodes PHI that has at least one unrelocated input cannot cause any issues by itself, though its uses should be carefully verified. With this patch PHIs are allowed to have any inputs but when all inputs are unrelocated the PHI is marked as unrelocated and if not all inputs are unrelocated then the PHI is marked as poisoned. Poisoned pointers can be used only in three ways: to derive new pointers, in PHIs or in comparisons against constants that are exclusively derived from null. Patch by Daniil Suchkov! Differential Revision: https://reviews.llvm.org/D41006 llvm-svn: 321438
* [NFC] Refactor SafepointIRVerifierSerguei Katkov2017-12-131-236/+317
| | | | | | | | | | | | | | Now two classes are responsible for verification: one of them can track GC pointers and know whether a pointer is relocated or not and another based on that information can verify uses of GC pointers. Patch Author: Daniil Suchkov Reviewers: mkazantsev, anna, apilipenko Reviewed By: mkazantsev Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40885 llvm-svn: 320549
* [NFC][SafepointIRVerifier] Add alias for set of available valuesSerguei Katkov2017-12-121-13/+15
| | | | | | | | | | | | | Introduces usage of AvailableValueSet alias name instead of DenseSet<const Value *> for better reading. Patch Author: Daniil Suchkov Reviewers: mkazantsev, anna, apilipenko Reviewed By: anna Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41002 llvm-svn: 320465
* [SafepointIRVerifier] Allow deriving pointers from unrelocated baseAnna Thomas2017-12-051-45/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch allows to use derived pointers (GEPs/bitcasts) of unrelocated base pointers. We care only about the uses of these derived pointers. It is acheived by two changes: 1. When we have enough information to say if the pointer is unrelocated at some point or not, we walk all BBs to remove from their Contributions all valid defs of unrelocated pointers (GEP with unrelocated base or bitcast of unrelocated pointer). 2. When it comes to verification we just ignore instructions that were removed at stage 1. Patch by Daniil Suchkov! Reviewers: anna, reames, apilipenko, mkazantsev Reviewed By: anna, mkazantsev Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D40289 llvm-svn: 319838
* Move helper classes into anonymous namespaces.Benjamin Kramer2017-08-201-0/+2
| | | | | | No functionality change intended. llvm-svn: 311288
* [SafepointIRVerifier] Avoid false positives in GC verifier for compare ↵Anna Thomas2017-07-071-2/+46
| | | | | | | | | | | | | | | | | | | between pointers Today the safepoint IR verifier catches some unrelocated uses of base pointers that are actually valid. With this change, we narrow down the set of false positives. Specifically, the verifier knows about compares to null and compares between 2 unrelocated pointers. Reviewed by: skatkov Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35057 llvm-svn: 307392
* [SafepointIRVerifier] NFC: Refactor code for identifying exclusive base typeAnna Thomas2017-07-071-37/+72
| | | | | | | | | Added a new Enum to identify if the base pointer is exclusively null or exlusively some constant or not exclusively any constant. Converted the base pointer identification method from recursive to iterative form. llvm-svn: 307340
* [SafepointIRVerifier] Add verifier pass for finding GC relocation bugsAnna Thomas2017-07-051-0/+358
Original Patch and summary by Philip Reames. RewriteStatepointsForGC tries to rewrite a function in a manner where the optimizer can't end up using a pointer value after it might have been relocated by a safepoint. This pass checks the invariant that RSForGC is supposed to establish and that (if we constructed semantics correctly) later passes must preserve. This has been a really useful diagnostic tool when initially developing the rewriting scheme and has found numerous bugs. Differential Revision: https://reviews.llvm.org/D15940 Reviewed by: swaroop.sridhar, mjacob Subscribers: llvm-commits llvm-svn: 307112
OpenPOWER on IntegriCloud