summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LowerExpectIntrinsic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Profile] handle select instruction in 'expect' loweringXinliang David Li2016-09-021-11/+25
| | | | | | | | | Builtin expect lowering currently ignores select. This patch fixes the issue Differential Revision: http://reviews.llvm.org/D24166 llvm-svn: 280547
* [PM] Remove support for omitting the AnalysisManager argument to newChandler Carruth2016-06-171-1/+2
| | | | | | | | | | | | | | | | | | | | pass manager passes' `run` methods. This removes a bunch of SFINAE goop from the pass manager and just requires pass authors to accept `AnalysisManager<IRUnitT> &` as a dead argument. This is a small price to pay for the simplicity of the system as a whole, despite the noise that changing it causes at this stage. This will also helpfull allow us to make the signature of the run methods much more flexible for different kinds af passes to support things like intelligently updating the pass's progression over IR units. While this touches many, many, files, the changes are really boring. Mostly made with the help of my trusty perl one liners. Thanks to Sean and Hal for bouncing ideas for this with me in IRC. llvm-svn: 272978
* [LowerExpectIntrinsic] make default likely/unlikely ratio biggerSanjay Patel2016-04-261-6/+18
| | | | | | | | | | We need the default ratio to be sufficiently large that it triggers transforms based on block frequency info (BFI) and plays well with the recently introduced BranchProbability used by CGP. Differential Revision: http://reviews.llvm.org/D19435 llvm-svn: 267615
* fix typo; NFCSanjay Patel2015-08-241-1/+1
| | | | llvm-svn: 245869
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* [PM] Port LowerExpectIntrinsic to the new pass manager.Chandler Carruth2015-01-241-20/+28
| | | | | | | | | | | | This just lifts the logic into a static helper function, sinks the legacy pass to be a trivial wrapper of that helper fuction, and adds a trivial wrapper for the new PM as well. Not much to see here. I switched a test case to run in both modes, but we have to strip the dead prototypes separately as that pass isn't in the new pass manager (yet). llvm-svn: 226999
* [PM] Change LowerExpectIntrinsic to actually return true when it hasChandler Carruth2015-01-241-1/+4
| | | | | | | | changed the IR. This is particularly easy as we can just look for the existence of any expect intrinsic at all to know whether we've changed the IR. llvm-svn: 226998
* [PM] Use a more appropriate name for the statistics variable inChandler Carruth2015-01-241-3/+4
| | | | | | | lower-expect, as we don't have 'if's in the IR and we use it for switches as well. llvm-svn: 226997
* [PM] Switch tihs code to use a range based for loop over the function.Chandler Carruth2015-01-241-6/+4
| | | | | | | We can't switch the loop over the instructions because it needs to early-increment the iterator. llvm-svn: 226996
* [PM] Use a SmallVector instead of std::vector to avoid heap allocationsChandler Carruth2015-01-241-7/+6
| | | | | | | | | | | | for small switches, and avoid using a complex loop to set up the weights. We know what the baseline weights will be so we can just resize the vector to contain all that value and clobber the one slot that is likely. This seems much more direct than the previous code that tested at every iteration, and started off by zeroing the vector. llvm-svn: 226995
* [PM] Pull the two helpers for this pass into static functions. There areChandler Carruth2015-01-241-21/+16
| | | | | | | | | no members for them to use. Also, make them accept references as there is no possibility of a null pointer. llvm-svn: 226994
* [PM] Add a basic doxygen comment for this pass.Chandler Carruth2015-01-241-0/+6
| | | | llvm-svn: 226993
* [PM] Clean up the formatting of the LowerExpectIntrinsic pass prior toChandler Carruth2015-01-241-23/+17
| | | | | | refactoring its code. llvm-svn: 226992
* [PM] Move the LowerExpectIntrinsic pass to the Scalar library.Chandler Carruth2015-01-241-0/+188
It was already in the Scalar header and referenced extensively as being in this library, the source file was just in the utils directory for some reason. No actual functionality changed. I noticed as it didn't make sense to add a pass header to the utils headers. llvm-svn: 226991
OpenPOWER on IntegriCloud