summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/Float2Int.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use make_range(rbegin(), rend()) to allow foreach loops. NFC.Pete Cooper2015-07-241-6/+5
| | | | | | | | | | | Instead of the pattern for (auto I = x.rbegin(), E = x.end(); I != E; ++I) we can use make_range to construct the reverse range and iterate using that instead. llvm-svn: 243163
* [GMR] Add a late run of GlobalsModRef to the main pass pipeline behindChandler Carruth2015-07-231-0/+2
| | | | | | | | | | | | | | | | | | | the general GMR-in-non-LTO flag. Without this, we have the global information during the CGSCC pipeline for GVN and such, but don't have it available during the late loop optimizations such as the vectorizer. Moreover, after the CGSCC pipeline has finished we have substantially more accurate and refined call graph information, function annotations, etc, which will make GMR even more powerful than it is early in the pipelien. Note that we have to play silly games with preserving AliasAnalysis (which is now trivially preserved) in order to let a module analysis magically be preserved into the entire function pass pipeline. Simultaneously we have to not make GMR an immutable pass in order to be able to re-run it and collect fresh data on the final call graph. llvm-svn: 242999
* 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
* Reapply r233175 and r233183: float2int.James Molloy2015-03-271-0/+540
| | | | | | | | This re-adds float2int to the tree, after fixing PR23038. It turns out the argument to APSInt() is true-if-unsigned, rather than true-if-signed :(. Added testcase and explanatory comment. llvm-svn: 233370
* Revert r233175 and r233183 with it. This pulls float2int back out of the ↵Nick Lewycky2015-03-271-540/+0
| | | | | | tree, due to PR23038. llvm-svn: 233350
* [optnone] Skip pass Float2Int on optnone functions.Andrea Di Biagio2015-03-251-0/+3
| | | | | | | Added test Float2Int/float2int-optnone.ll to verify that pass Float2Int is not run on optnone functions. llvm-svn: 233183
* Reapply r233062: "float2int": Add a new pass to demote from float to int ↵James Molloy2015-03-251-0/+537
| | | | | | | | where possible. Now with a fix for PR23008 and extra regression test. llvm-svn: 233175
* Revert r233062 ""float2int": Add a new pass to demote from float to int ↵Hans Wennborg2015-03-241-536/+0
| | | | | | | | | | | where possible." This caused PR23008, compiles failing with: "Use still stuck around after Def is destroyed: %.sroa.speculated" Also reverting follow-up r233064. llvm-svn: 233105
* [float2int] Sort includes and add missing raw_ostream include.Benjamin Kramer2015-03-241-6/+7
| | | | llvm-svn: 233064
* "float2int": Add a new pass to demote from float to int where possible.James Molloy2015-03-241-0/+535
It is possible to have code that converts from integer to float, performs operations then converts back, and the result is provably the same as if integers were used. This can come from different sources, but the most obvious is a helper function that uses floats but the arguments given at an inlined callsites are integers. This pass considers all integers requiring a bitwidth less than or equal to the bitwidth of the mantissa of a floating point type (23 for floats, 52 for doubles) as exactly representable in floating point. To reduce the risk of harming efficient code, the pass only attempts to perform complete removal of inttofp/fptoint operations, not just move them around. llvm-svn: 233062
OpenPOWER on IntegriCloud