summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PlaceSafepoints] Switch to being a FunctionPassPhilip Reames2015-05-121-11/+6
| | | | | | | | The pass doesn't actually modify the module outside of the function being processed. The only confusing piece is that it both inserts calls and then inlines the resulting calls. Given that, it definitely invalidates module level analysis results, but many FunctionPasses do that. Differential Revision: http://reviews.llvm.org/D9590 llvm-svn: 237185
* [PlaceSafepoints] Make internal helper pass a FunctionPassPhilip Reames2015-05-121-11/+30
| | | | | | | | | | Switch from using a LoopPass to using a FunctionPass for the internal helper analysis pass. The next step is going to be to make this a true analysis pass which is required by the PlaceSafepoints pass itself. p.s. The interesting semantic part here is that we're changing the iteration order over the loops. It shouldn't matter, but that's the reason to separate this into it's own distinct patch. Differential Revision: http://reviews.llvm.org/D9588 llvm-svn: 237180
* [PlaceSafepoints] Use analysis infrastructure to get dominator treePhilip Reames2015-05-121-6/+4
| | | | | | | | The old code computed dominators for every loop. This was terribly slow with no good reason. Just use the standard infrastructure for analysis passes. Differential Revision: http://reviews.llvm.org/D9586 llvm-svn: 237176
* [PlaceSafepoints] Remove dependence on LoopSimplifyPhilip Reames2015-05-121-29/+40
| | | | | | | | As a step towards getting rid of internal pass manager hack entirely, remove the need for loop simplify to run in the inner pass manager. The new code does produce slightly different loop structures, so this isn't technically NFC. Differential Revision: http://reviews.llvm.org/D9585 llvm-svn: 237172
* This change is refactoring only. It moves basic block normalization for ↵Igor Laevsky2015-05-081-39/+36
| | | | | | invokes to happen before replacement of a call with safepoint in "ReplaceWithStatepoint". Previously it was partly done before replacement of calls with safepoint and partly after call replacement but before RAUW's for gc_relocates, which was confusing. llvm-svn: 236829
* Scalar/PlaceSafepoints.cpp: Fix a warning introduced in r228090. ↵NAKAMURA Takumi2015-05-071-4/+2
| | | | | | [-Wunused-variable] llvm-svn: 236711
* [Statepoints] Clean up PlaceSafepoints.cpp: de-duplicate code.Sanjoy Das2015-05-061-21/+19
| | | | | | Common duplicated code and remove unnecessary code. llvm-svn: 236674
* [Statepoints] Clean up PlaceSafepoints.cpp: variable naming.Sanjoy Das2015-05-061-31/+29
| | | | | | Use CamelCase. NFC. llvm-svn: 236673
* [IRBuilder] Add a CreateGCStatepointInvoke.Sanjoy Das2015-05-061-32/+6
| | | | | | | | | | | Renames the original CreateGCStatepoint to CreateGCStatepointCall, and moves invoke creating functionality from PlaceSafepoints.cpp to IRBuilder.cpp. This changes the labels generated for PlaceSafepoints/invokes.ll so use a regex there to make the basic block labels more resilient. llvm-svn: 236672
* [DomTree] verifyDomTree to unconditionally perform DT verificationAdam Nemet2015-05-061-3/+2
| | | | | | | | | | | | I folded the check for the flag -verify-dom-info into the only caller where I think it is supposed to be checked: verifyAnalysis. (The idea of the flag is to enable this expensive verification in verifyPreservedAnalysis.) I'm assuming that when manually scheduling the verification pass with -passes=verify<domtree>, we do want to perform the verification. llvm-svn: 236575
* Don't Place Entry Safepoints Before the llvm.frameescape() IntrinsicPhilip Reames2015-04-261-0/+7
| | | | | | | | | llvm.frameescape() intrinsic is not a real call. The intrinsic can only exist in the entry block. Inserting a gc.statepoint() before llvm.frameescape() may split the entry block, and push the intrinsic out of the entry block. Patch by: Swaroop.Sridhar@microsoft.com Differential Revision: http://reviews.llvm.org/D8910 llvm-svn: 235820
* [CallSite] Make construction from Value* (or Instruction*) explicit.Benjamin Kramer2015-04-101-3/+2
| | | | | | | | | | | | | | | | | | | CallSite roughly behaves as a common base CallInst and InvokeInst. Bring the behavior closer to that model by making upcasts explicit. Downcasts remain implicit and work as before. Following dyn_cast as a mental model checking whether a Value *V isa CallSite now looks like this: if (auto CS = CallSite(V)) // think dyn_cast instead of: if (CallSite CS = V) This is an extra token but I think it is slightly clearer. Making the ctor explicit has the advantage of not accidentally creating nullptr CallSites, e.g. when you pass a Value * to a function taking a CallSite argument. llvm-svn: 234601
* PlaceSafepoints: use IRBuilder helpersRamkumar Ramachandra2015-02-261-44/+39
| | | | | | | | | | Use the IRBuilder helpers for gc.statepoint and gc.result, instead of coding the construction by hand. Note that the gc.statepoint IRBuilder handles only CallInst, not InvokeInst; retain that part of hand-coding. Differential Revision: http://reviews.llvm.org/D7518 llvm-svn: 230591
* [PlaceSafepoints] Adjust enablement logic to default to off and be GC ↵Philip Reames2015-02-211-11/+26
| | | | | | | | configurable per GC Previously, this pass ran over every function in the Module if added to the pass order. With this change, it runs only over those with a GC attribute where the GC explicitly opts in. A GC can also choose which of entry safepoint polls, backedge safepoint polls, and call safepoints it wants. I hope to get these exposed as checks on the GCStrategy at some point, but for now, the checks are manual string comparisons. llvm-svn: 230097
* Hide a bunch of advanced testing options in default opt --help outputPhilip Reames2015-02-201-7/+9
| | | | | | These are internal options. I need to go through, evaluate which are worth keeping and which not. Many of them should probably be renamed as well. Until I have time to do that, we can at least stop poluting the standard opt -help output. llvm-svn: 230088
* [PM] Remove the old 'PassManager.h' header file at the top level ofChandler Carruth2015-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | LLVM's include tree and the use of using declarations to hide the 'legacy' namespace for the old pass manager. This undoes the primary modules-hostile change I made to keep out-of-tree targets building. I sent an email inquiring about whether this would be reasonable to do at this phase and people seemed fine with it, so making it a reality. This should allow us to start bootstrapping with modules to a certain extent along with making it easier to mix and match headers in general. The updates to any code for users of LLVM are very mechanical. Switch from including "llvm/PassManager.h" to "llvm/IR/LegacyPassManager.h". Qualify the types which now produce compile errors with "legacy::". The most common ones are "PassManager", "PassManagerBase", and "FunctionPassManager". llvm-svn: 229094
* Adjust how we avoid poll insertion inside the poll function (NFC)Philip Reames2015-02-101-5/+11
| | | | | | | | I realized that my early fix for this was overly complicated. Rather than scatter checks around in a bunch of places, just exit early when we visit the poll function itself. Thinking about it a bit, the whole inlining mechanism used with gc.safepoint_poll could probably be cleaned up a bit. Originally, poll insertion was fused with gc relocation rewriting. It might be worth going back to see if we can simplify the chain of events now that these two are seperated. As one thought, maybe it makes sense to rewrite calls inside the helper function before inlining it to the many callers. This would require us to visit the poll function before any other functions though.. llvm-svn: 228634
* [Statepoint] Improve two asserts, fix some style (NFC)Ramkumar Ramachandra2015-02-091-1/+2
| | | | | | | | | | | | | | | Summary: It's important that our users immediately know what gc.safepoint_poll is. Also fix the style of the declaration of CreateGCStatepoint, in preparation for another change that will wrap it. Reviewers: reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7517 llvm-svn: 228626
* PlaceSafepoints: modernize gc.result.* -> gc.resultRamkumar Ramachandra2015-02-091-12/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D7516 llvm-svn: 228625
* Update file comment to clarify points highlighted in review (NFC)Philip Reames2015-02-091-31/+30
| | | | llvm-svn: 228621
* Use range for loops in PlaceSafepoints (NFC)Philip Reames2015-02-091-8/+4
| | | | llvm-svn: 228620
* Add basic tests for PlaceSafepointsPhilip Reames2015-02-091-5/+21
| | | | | | This is just adding really simple tests which should have been part of the original submission. When doing so, I discovered that I'd mistakenly removed required pieces when preparing the patch for upstream submission. I fixed two such bugs in this submission. llvm-svn: 228610
* Make helper functions/classes/globals static. NFC.Benjamin Kramer2015-02-061-1/+1
| | | | llvm-svn: 228410
* Removing an unused variable warning I accidentally introduced with my last ↵Aaron Ballman2015-02-051-1/+1
| | | | | | warning fix; NFC. llvm-svn: 228295
* Silencing an MSVC warning about a switch statement with no cases; NFC.Aaron Ballman2015-02-051-8/+5
| | | | llvm-svn: 228294
* Fix a warning in non-asserts buildsPhilip Reames2015-02-041-0/+1
| | | | llvm-svn: 228114
* Clang format of a file introduced in 228090 (NFC)Philip Reames2015-02-041-29/+22
| | | | llvm-svn: 228091
* Add a pass for inserting safepoints into (nearly) arbitrary IRPhilip Reames2015-02-041-0/+979
This pass is responsible for figuring out where to place call safepoints and safepoint polls. It doesn't actually make the relocations explicit; that's the job of the RewriteStatepointsForGC pass (http://reviews.llvm.org/D6975). Note that this code is not yet finalized. Its moving in tree for incremental development, but further cleanup is needed and will happen over the next few days. It is not yet part of the standard pass order. Planned changes in the near future: - I plan on restructuring the statepoint rewrite to use the functions add to the IRBuilder a while back. - In the current pass, the function "gc.safepoint_poll" is treated specially but is not an intrinsic. I plan to make identifying the poll function a property of the GCStrategy at some point in the near future. - As follow on patches, I will be separating a collection of test cases we have out of tree and submitting them upstream. - It's not explicit in the code, but these two patches are introducing a new state for a statepoint which looks a lot like a patchpoint. There's no a transient form which doesn't yet have the relocations explicitly represented, but does prevent reordering of memory operations. Once this is in, I need to update actually make this explicit by reserving the 'unused' argument of the statepoint as a flag, updating the docs, and making the code explicitly check for such a thing. This wasn't really planned, but once I split the two passes - which was done for other reasons - the intermediate state fell out. Just reminds us once again that we need to merge statepoints and patchpoints at some point in the not that distant future. Future directions planned: - Identifying more cases where a backedge safepoint isn't required to ensure timely execution of a safepoint poll. - Tweaking the insertion process to generate easier to optimize IR. (For example, investigating making SplitBackedge) the default. - Adding opt-in flags for a GCStrategy to use this pass. Once done, add this pass to the actual pass ordering. Differential Revision: http://reviews.llvm.org/D6981 llvm-svn: 228090
OpenPOWER on IntegriCloud