summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove 256-bit AVX non-temporal store intrinsics. Similar was previously ↵Craig Topper2012-05-081-5/+33
| | | | | | done for 128-bit. llvm-svn: 156375
* Ordinary patch for PR1255.Stepan Dyatkovskiy2012-05-081-1/+8
| | | | | | | Added new case-ranges orientated methods for adding/removing cases in SwitchInst. After this patch cases will internally representated as ConstantArray-s instead of ConstantInt, externally cases wrapped within the ConstantRangesSet object. Old methods of SwitchInst are also works well, but marked as deprecated. So on this stage we have no side effects except that I added support for case ranges in BitcodeReader/Writer, of course test for Bitcode is also added. Old "switch" format is also supported. llvm-svn: 156374
* Reapply r155682, making constant folding more consistent, with a fix to workDan Gohman2012-04-271-28/+37
| | | | | | properly with how the code handles all-undef PHI nodes. llvm-svn: 155721
* Revert r155682, "Use ConstantExpr::getExtractElement when constant-folding ↵NAKAMURA Takumi2012-04-271-37/+28
| | | | | | | | vectors" It broke stage2 build. stage1/clang sometimes crashed. llvm-svn: 155699
* Use ConstantExpr::getExtractElement when constant-folding vectorsDan Gohman2012-04-271-28/+37
| | | | | | | | | | | | | | | | | | | | | instead of getAggregateElement. This has the advantage of being more consistent and allowing higher-level constant folding to procede even if an inner extract element cannot be folded. Make ConstantFoldInstruction call ConstantFoldConstantExpression on the instruction's operands, making it more consistent with ConstantFoldConstantExpression itself. This makes sure that ConstantExprs get TargetData-aware folding before being handed off as operands for further folding. This causes more expressions to be folded, but due to a known shortcoming in constant folding, this currently has the side effect of stripping a few more nuw and inbounds flags in the non-targetdata side of constant-fold-gep.ll. This is mostly harmless. This fixes rdar://11324230. llvm-svn: 155682
* Don't forget to reset 'first operand' flag when we're setting the ↵Bill Wendling2012-04-261-5/+8
| | | | | | MDNodeOperand value. llvm-svn: 155599
* ConstantFoldSelectInstruction swapped the operands of the select.Nadav Rotem2012-04-241-1/+1
| | | | | | Fix 12592. Patch by Matt Pharr. llvm-svn: 155480
* Cleanup whitespace.Bill Wendling2012-04-231-32/+32
| | | | llvm-svn: 155328
* Limit the number of times we recurse through this algorithm. All of theBill Wendling2012-04-231-5/+17
| | | | | | | intructions are processed. So there's no need to look at them if they're used as operands of other instructions. llvm-svn: 155327
* Add a flag to the struct type finder to collect only those types which haveBill Wendling2012-04-211-5/+8
| | | | | | names. This saves collecting types we normally don't care about. llvm-svn: 155300
* Revert r155241, which is causing some breakage.Bill Wendling2012-04-202-69/+20
| | | | llvm-svn: 155253
* If we discover all of the named structs in a module, then don't bother toBill Wendling2012-04-202-20/+69
| | | | | | process any more Values. llvm-svn: 155241
* Remove AVX vpermil intrinsics. I removed their uses from clang headers and ↵Craig Topper2012-04-181-5/+38
| | | | | | builtins a while back. llvm-svn: 154985
* Typo.Eric Christopher2012-04-161-1/+1
| | | | llvm-svn: 154879
* Remove support for the special 'fast' value for fpmath accuracy for the moment.Duncan Sands2012-04-162-26/+3
| | | | llvm-svn: 154850
* Make it possible to indicate relaxed floating point requirements at the IR levelDuncan Sands2012-04-162-6/+48
| | | | | | | | | through the use of 'fpmath' metadata. Currently this only provides a 'fpaccuracy' value, which may be a number in ULPs or the keyword 'fast', however the intent is that this will be extended with additional information about NaN's, infinities etc later. No optimizations have been hooked up to this so far. llvm-svn: 154822
* Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands2012-04-142-9/+9
| | | | | | | | | thinking of generalizing it to be able to specify other freedoms beyond accuracy (such as that NaN's don't have to be respected). I'd like the 3.1 release (the first one with this metadata) to have the more generic name already rather than having to auto-upgrade it in 3.2. llvm-svn: 154744
* Def here is an Instruction, so !isa<Instruction>(Def) is always false,Dan Gohman2012-04-131-3/+2
| | | | | | as Eli noticed. llvm-svn: 154641
* Add forms of dominates and isReachableFromEntry that accept a UseDan Gohman2012-04-121-0/+81
| | | | | | | | directly instead of a user Instruction. This allows them to test whether a def dominates a particular operand if the user instruction is a PHI. llvm-svn: 154631
* Cache the hash value of the operands in the MDNode.Benjamin Kramer2012-04-112-0/+25
| | | | | | | | | | | | | | | | | | FoldingSet is implemented as a chained hash table. When there is a hash collision during insertion, which is common as we fill the table until a load factor of 2.0 is hit, we walk the chained elements, comparing every operand with the new element's operands. This can be very expensive if the MDNode has many operands. We sacrifice a word of space in MDNode to cache the full hash value, reducing compares on collision to a minimum. MDNode grows from 28 to 32 bytes + operands on x86. On x86_64 the new bits fit nicely into existing padding, not growing the struct at all. The actual speedup depends a lot on the test case and is typically between 1% and 2% for C++ code with clang -c -O0 -g. llvm-svn: 154497
* Compute hashes directly with hash_combine instead of taking a detour through ↵Benjamin Kramer2012-04-111-4/+1
| | | | | | FoldingSetNodeID. llvm-svn: 154495
* The MDString class stored a StringRef to the string which was already in aBill Wendling2012-04-103-8/+14
| | | | | | | | | | | | | StringMap. This was redundant and unnecessarily bloated the MDString class. Because the MDString class is a "Value" and will never have a "name", and because the Name field in the Value class is a pointer to a StringMap entry, we repurpose the Name field for an MDString. It stores the StringMap entry in the Name field, and uses the normal methods to get the string (name) back. PR12474 llvm-svn: 154429
* Express the number of ULPs in fpaccuracy metadata as a real rather than aDuncan Sands2012-04-101-0/+12
| | | | | | rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne. llvm-svn: 154387
* Remove the 'Parent' pointer from the MDNodeOperand class.Bill Wendling2012-04-081-11/+26
| | | | | | | | | | | | An MDNode has a list of MDNodeOperands allocated directly after it as part of its allocation. Therefore, the Parent of the MDNodeOperands can be found by walking back through the operands to the beginning of that list. Mark the first operand's value pointer as being the 'first' operand so that we know where the beginning of said list is. This saves a *lot* of space during LTO with -O0 -g flags. llvm-svn: 154280
* Allow subclasses of the ValueHandleBase to store information as part of theBill Wendling2012-04-081-12/+14
| | | | | | | value pointer by making the value pointer into a pointer-int pair with 2 bits available for flags. llvm-svn: 154279
* The speedup doesn't appear to have been from this, but was an anomaly of my ↵Bill Wendling2012-04-031-1/+0
| | | | | | testing machine. llvm-svn: 153951
* 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
OpenPOWER on IntegriCloud