summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
* Reserve space for the eventual filling of the vector. This gives a small ↵Bill Wendling2012-04-031-4/+3
| | | | | | speedup. llvm-svn: 153949
* I noticed in passing that the Metadata getIfExists method was creating a newDuncan Sands2012-03-311-4/+4
| | | | | | node and returning it if one didn't exist. llvm-svn: 153798
* Handle unreachable code in the dominates functions. This changes users whenRafael Espindola2012-03-301-4/+14
| | | | | | | needed for correctness, but still doesn't clean up code that now unnecessary checks for reachability. llvm-svn: 153755
* Add missing include of <new>Douglas Gregor2012-03-261-0/+1
| | | | llvm-svn: 153436
* Remove always true variable.Rafael Espindola2012-03-241-19/+10
| | | | llvm-svn: 153392
* First part of PR12251. Add documentation and verifier support for the rangeRafael Espindola2012-03-242-0/+29
| | | | | | metadata. llvm-svn: 153359
* Fix up cmake build.Eric Christopher2012-03-231-1/+0
| | | | llvm-svn: 153306
* Take out the debug info probe stuff. It's making some changes toEric Christopher2012-03-232-247/+1
| | | | | | | the PassManager annoying and should be reimplemented as a decorator on top of existing passes (as should the timing data). llvm-svn: 153305
* add load/store volatility control to the C API, patch by Yiannis Tsiouris!Chris Lattner2012-03-221-0/+14
| | | | llvm-svn: 153238
* Extend the inline cost calculation to account for bonuses due toChandler Carruth2012-03-141-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | correlated pairs of pointer arguments at the callsite. This is designed to recognize the common C++ idiom of begin/end pointer pairs when the end pointer is a constant offset from the begin pointer. With the C-based idiom of a pointer and size, the inline cost saw the constant size calculation, and this provides the same level of information for begin/end pairs. In order to propagate this information we have to search for candidate operations on a pair of pointer function arguments (or derived from them) which would be simplified if the pointers had a known constant offset. Then the callsite analysis looks for such pointer pairs in the argument list, and applies the appropriate bonus. This helps LLVM detect that half of bounds-checked STL algorithms (such as hash_combine_range, and some hybrid sort implementations) disappear when inlined with a constant size input. However, it's not a complete fix due the inaccuracy of our cost metric for constants in general. I'm looking into that next. Benchmarks showed no significant code size change, and very minor performance changes. However, specific code such as hashing is showing significantly cleaner inlining decisions. llvm-svn: 152752
* llvm::SwitchInstStepan Dyatkovskiy2012-03-112-2/+2
| | | | | | | Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default. Added some notes relative to case iterators. llvm-svn: 152532
* Refactor some methods to look through bitcasts and GEPs on pointers intoChandler Carruth2012-03-101-6/+42
| | | | | | | | | | a common collection of methods on Value, and share their implementation. We had two variations in two different places already, and I need the third variation for inline cost estimation. Reviewed by Duncan Sands on IRC, but further comments here welcome. llvm-svn: 152490
* Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:Stepan Dyatkovskiy2012-03-083-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*". ConstCaseIt is just a read-only iterator. CaseIt is read-write iterator; it allows to change case successor and case value. Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters. Main way of iterator usage looks like this: SwitchInst *SI = ... // intialize it somehow for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) { BasicBlock *BB = i.getCaseSuccessor(); ConstantInt *V = i.getCaseValue(); // Do something. } If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method. If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method. There are also related changes in llvm-clients: klee and clang. llvm-svn: 152297
* Switch this code to use hash_combine_range rather than incremental callsChandler Carruth2012-03-071-8/+6
| | | | | | | | | | to hash_combine. One of the interfaces could already do this, and the other can just use a small buffer. This is a much more efficient way to use the hash_combine interface, although I don't have any particular benchmark where this code was hot, so I can't measure much of an impact. It at least doesn't slow anything down. llvm-svn: 152200
* Cache the sized-ness of struct types, once we reach the steady state ofChandler Carruth2012-03-071-10/+21
| | | | | | | | | | | | | | | "is sized". This prevents every query to isSized() from recursing over every sub-type of a struct type. This could get *very* slow for extremely deep nesting of structs, as in 177.mesa. This change is a 45% speedup for 'opt -O2' of 177.mesa.linked.bc, and likely a significant speedup for other cases as well. It even impacts -O0 cases because so many part of the code try to check whether a type is sized. Thanks for the review from Nick Lewycky and Benjamin Kramer on IRC. llvm-svn: 152197
* Change ConstantAggrUniqueMap to use Chandler's new hashingJay Foad2012-03-061-36/+9
| | | | | | implementation. Patch by Meador Inge llvm-svn: 152116
* Replace the hashing functions on APInt and APFloat with overloads of theChandler Carruth2012-03-041-3/+8
| | | | | | | | | | | | | | new hash_value infrastructure, and replace their implementations using hash_combine. This removes a complete copy of Jenkin's lookup3 hash function (which is both significantly slower and lower quality than the one implemented in hash_combine) along with a somewhat scary xor-only hash function. Now that APInt and APFloat can be passed directly to hash_combine, simplify the rest of the LLVMContextImpl hashing to use the new infrastructure. llvm-svn: 152004
* Rewrite LLVM's generalized support library for hashing to follow the APIChandler Carruth2012-03-011-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of the proposed standard hashing interfaces (N3333), and to use a modified and tuned version of the CityHash algorithm. Some of the highlights of this change: -- Significantly higher quality hashing algorithm with very well distributed results, and extremely few collisions. Should be close to a checksum for up to 64-bit keys. Very little clustering or clumping of hash codes, to better distribute load on probed hash tables. -- Built-in support for reserved values. -- Simplified API that composes cleanly with other C++ idioms and APIs. -- Better scaling performance as keys grow. This is the fastest algorithm I've found and measured for moderately sized keys (such as show up in some of the uniquing and folding use cases) -- Support for enabling per-execution seeds to prevent table ordering or other artifacts of hashing algorithms to impact the output of LLVM. The seeding would make each run different and highlight these problems during bootstrap. This implementation was tested extensively using the SMHasher test suite, and pased with flying colors, doing better than the original CityHash algorithm even. I've included a unittest, although it is somewhat minimal at the moment. I've also added (or refactored into the proper location) type traits necessary to implement this, and converted users of GeneralHash over. My only immediate concerns with this implementation is the performance of hashing small keys. I've already started working to improve this, and will continue to do so. Currently, the only algorithms faster produce lower quality results, but it is likely there is a better compromise than the current one. Many thanks to Jeffrey Yasskin who did most of the work on the N3333 paper, pair-programmed some of this code, and reviewed much of it. Many thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original authors of CityHash on which this is heavily based, and Austin Appleby who created MurmurHash and the SMHasher test suite. Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for all of the review comments! If there are further comments or concerns, please let me know and I'll jump on 'em. llvm-svn: 151822
* Emit the "is an intrinsic overloaded" table as a bitfield.Benjamin Kramer2012-03-011-4/+0
| | | | llvm-svn: 151792
* Use the DT dominates function in the verifier.Rafael Espindola2012-02-261-72/+55
| | | | llvm-svn: 151470
* Change the implementation of dominates(inst, inst) to one based on what theRafael Espindola2012-02-261-17/+87
| | | | | | | | verifier does. This correctly handles invoke. Thanks to Duncan, Andrew and Chris for the comments. Thanks to Joerg for the early testing. llvm-svn: 151469
* Don't call dominates on unreachable instructions.Rafael Espindola2012-02-261-2/+2
| | | | llvm-svn: 151468
* Remove spurious emacs mode marker.Nick Lewycky2012-02-251-1/+1
| | | | llvm-svn: 151440
* Reinstate r151049 now that GeneralHash is fixed.Jay Foad2012-02-232-34/+131
| | | | llvm-svn: 151248
* Remove extra semi-colons.Chad Rosier2012-02-221-1/+1
| | | | llvm-svn: 151169
* Revert r151049 cos it broke the buildbots.Jay Foad2012-02-212-131/+34
| | | | llvm-svn: 151052
* PR1210: make uniquing of struct and function types more efficient byJay Foad2012-02-212-34/+131
| | | | | | | | | using a DenseMap and Talin's new GeneralHash, avoiding the need for a temporary std::vector on every lookup. Patch by Meador Inge! llvm-svn: 151049
* Remove dead code. Improve llvm_unreachable text. Simplify some control flow.Ahmed Charles2012-02-191-13/+4
| | | | llvm-svn: 150918
* White space fixes.Rafael Espindola2012-02-181-7/+7
| | | | llvm-svn: 150886
* s/ModAttrBehavior/ModFlagBehavior/g to be consistent with how module flags ↵Bill Wendling2012-02-161-3/+3
| | | | | | are named elsewhere. llvm-svn: 150679
* VMCore/AsmWriter.cpp: Tweak to check #INF and #NAN earlier.NAKAMURA Takumi2012-02-161-1/+3
| | | | | | | With MSVCRT, prior checker missed emission of #INF and #NAN. FIXME: Checking should be simpler. llvm-svn: 150667
* VMCore/AsmWriter.cpp: Use APFloat instead of atof(3).NAKAMURA Takumi2012-02-161-1/+1
| | | | | | atof(3) might behave differently among platforms. llvm-svn: 150661
* Use the enum instead of 'unsigned'.Bill Wendling2012-02-151-1/+2
| | | | llvm-svn: 150632
* Add a module flags accessor method which returns the flags in a vector.Bill Wendling2012-02-151-0/+15
| | | | llvm-svn: 150623
* Add a way to replace a field inside a metadata node. This can beEric Christopher2012-02-151-0/+5
| | | | | | | used to incrementally update a created node without needing a temporary node and RAUW. llvm-svn: 150571
* Added TargetPassConfig::disablePass/substitutePass as a general mechanism to ↵Andrew Trick2012-02-151-2/+2
| | | | | | override specific passes. llvm-svn: 150562
* [WIP] Initial code for module flags.Bill Wendling2012-02-111-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Module flags are key-value pairs associated with the module. They include a 'behavior' value, indicating how module flags react when mergine two files. Normally, it's just the union of the two module flags. But if two module flags have the same key, then the resulting flags are dictated by the behaviors. Allowable behaviors are: Error Emits an error if two values disagree. Warning Emits a warning if two values disagree. Require Emits an error when the specified value is not present or doesn't have the specified value. It is an error for two (or more) llvm.module.flags with the same ID to have the Require behavior but different values. There may be multiple Require flags per ID. Override Uses the specified value if the two values disagree. It is an error for two (or more) llvm.module.flags with the same ID to have the Override behavior but different values. llvm-svn: 150300
* Added Pass::createPass(ID) to handle pass configuration by IDAndrew Trick2012-02-081-0/+7
| | | | llvm-svn: 150092
* Cache the sizes of vectors instead of calculating them all over the place.Bill Wendling2012-02-071-9/+11
| | | | llvm-svn: 149954
* Reserve space in these vectors to prevent having to grow the array tooBill Wendling2012-02-072-6/+8
| | | | | | much. This gets us an addition 0.9% on 445.gobmk. llvm-svn: 149952
* Remove some dead code and tidy things up now that vectors use ConstantDataVectorChris Lattner2012-02-061-16/+0
| | | | | | instead of always using ConstantVector. llvm-svn: 149912
* [unwind removal] Remove all of the code for the dead 'unwind' instruction. ThereBill Wendling2012-02-062-34/+2
| | | | | | | were no 'unwind' instructions being generated before this, so this is in effect a no-op. llvm-svn: 149906
* Convert assert(0) to llvm_unreachableCraig Topper2012-02-055-33/+20
| | | | llvm-svn: 149849
* Efficient Constant Uniquing.Talin2012-02-054-68/+196
| | | | llvm-svn: 149848
* reapply the patches reverted in r149470 that reenable ConstantDataArray,Chris Lattner2012-02-054-127/+104
| | | | | | | | | but with a critical fix to the SelectionDAG code that optimizes copies from strings into immediate stores: the previous code was stopping reading string data at the first nul. Address this by adding a new argument to llvm::getConstantStringInfo, preserving the behavior before the patch. llvm-svn: 149800
* Update llvm debug version to support new structure and tag for Objective-C ↵Devang Patel2012-02-041-1/+1
| | | | | | property's debug info. llvm-svn: 149736
* Simplify some GEP checks in the verifier.Duncan Sands2012-02-031-4/+2
| | | | llvm-svn: 149698
* Add auto upgrade support for x86 pcmpgt/pcmpeq intrinics removed in r149367.Craig Topper2012-02-031-3/+40
| | | | llvm-svn: 149678
* whitespaceAndrew Trick2012-02-031-6/+6
| | | | llvm-svn: 149671
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-013-15/+12
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
OpenPOWER on IntegriCloud