summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove an unused function.Nadav Rotem2012-03-051-13/+0
| | | | llvm-svn: 152028
* Switch to a C-style cast here to silence a brain-dead MSVC warning. ItChandler Carruth2012-03-051-1/+1
| | | | | | | | | | | | complains about the truncation of a 64-bit constant to a 32-bit value when size_t is 32-bits wide, but *only with static_cast*!!! The exact signal that should *silence* such a warning, and in fact does silence it with both GCC and Clang. Anyways, this was causing grief for all the MSVC builds, so pointless change made. Thanks to Nikola on IRC for confirming that this works. llvm-svn: 152021
* Shrink and reorder fields in MCRegisterClass to reduce size of static data.Craig Topper2012-03-051-6/+6
| | | | llvm-svn: 152019
* Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce ↵Craig Topper2012-03-052-12/+12
| | | | | | static data size. llvm-svn: 152016
* Use <def,undef> operands when spilling NEON bundles.Jakob Stoklund Olesen2012-03-041-0/+1
| | | | | | | | | | | MachineOperands that define part of a virtual register must have an <undef> flag if they are not intended as read-modify-write operands. The old trick of adding an <imp-def> operand doesn't work any longer. Fixes PR12177. llvm-svn: 152008
* Replace the hashing functions on APInt and APFloat with overloads of theChandler Carruth2012-03-042-8/+15
| | | | | | | | | | | | | | 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
* Add generic support for hashing StringRef objects using the new hashing library.Chandler Carruth2012-03-041-0/+4
| | | | llvm-svn: 152003
* Use uint16_t to store register overlaps to reduce static data.Craig Topper2012-03-043-6/+6
| | | | llvm-svn: 152001
* Teach the hashing facilities how to hash std::string objects.Chandler Carruth2012-03-041-0/+11
| | | | llvm-svn: 152000
* Use uint16_t instead of unsigned to store registers in reg classes. Reduces ↵Craig Topper2012-03-042-10/+10
| | | | | | static data size. llvm-svn: 151998
* Use uint16_t to store registers in callee saved register tables to reduce ↵Craig Topper2012-03-041-1/+1
| | | | | | size of static data. llvm-svn: 151996
* Enable the small vector POD optimization for BitCodeAbbrevOp.Benjamin Kramer2012-03-031-1/+3
| | | | | | While at it bump the small vector size a bit, it's inside a heap-allocated class. llvm-svn: 151980
* hash_state: Don't use initialization target during initialization.Daniel Dunbar2012-03-031-3/+2
| | | | llvm-svn: 151959
* Fix indentation.Benjamin Kramer2012-03-021-3/+3
| | | | llvm-svn: 151932
* Tidy up. Trailing whitespace.Jim Grosbach2012-03-021-1/+1
| | | | llvm-svn: 151926
* Hashing: microoptimize a truncate on 64 bit away. This currently blocks dead ↵Benjamin Kramer2012-03-021-1/+1
| | | | | | | | code eliminating the conditional. The optimizer should handle this eventually, but currently LVI isn't really designed for this kind of stuff. llvm-svn: 151918
* delete dead code, patch by Michael Spencer.Jia Liu2012-03-021-5/+0
| | | | llvm-svn: 151909
* Make the hashing algorithm Endian neutral. This is a bit annoying, butChandler Carruth2012-03-021-0/+6
| | | | | | | | | | folks who know something about PPC tell me that the byte swap is crazy fast and without this the bit mixture would actually be different. It might not be worse, but I've not measured it and so I'd rather not trust it. This way, the algorithm is identical on both endianness hosts. I'll look into any performance issues etc stemming from this. llvm-svn: 151892
* Simplify the pair optimization. Rather than using complex type traits,Chandler Carruth2012-03-022-20/+2
| | | | | | | | | | | | | | just ensure that the number of bytes in the pair is the sum of the bytes in each side of the pair. As long as thats true, there are no extra bytes that might be padding. Also add a few tests that previously would have slipped through the checking. The more accurate checking mechanism catches these and ensures they are handled conservatively correctly. Thanks to Duncan for prodding me to do this right and more simply. llvm-svn: 151891
* Add a header that was technically missing to see if this gets theChandler Carruth2012-03-021-0/+1
| | | | | | offsetof buildbot errors to go away... llvm-svn: 151884
* We really want to hash pairs of directly-hashable data as directlyChandler Carruth2012-03-022-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | hashable data. This matters when we have pair<T*, U*> as a key, which is quite common in DenseMap, etc. To that end, we need to detect when this is safe. The requirements on a generic std::pair<T, U> are: 1) Both T and U must satisfy the existing is_hashable_data trait. Note that this includes the requirement that T and U have no internal padding bits or other bits not contributing directly to equality. 2) The alignment constraints of std::pair<T, U> do not require padding between consecutive objects. 3) The alignment constraints of U and the size of T do not conspire to require padding between the first and second elements. Grow two somewhat magical traits to detect this by forming a pod structure and inspecting offset artifacts on it. Hopefully this won't cause any compilers to panic. Added and adjusted tests now that pairs, even nested pairs, are treated as just sequences of data. Thanks to Jeffrey Yasskin for helping me sort through this and reviewing the somewhat subtle traits. llvm-svn: 151883
* Add support for hashing pairs by delegating to each sub-object. There isChandler Carruth2012-03-021-59/+79
| | | | | | | | | | | | | | | | | an open question of whether we can do better than this by treating pairs as boring data containers and directly hashing the two subobjects. This at least makes the API reasonable. In order to make this change, I reorganized the header a bit. I lifted the declarations of the hash_value functions up to the top of the header with their doxygen comments as these are intended for users to interact with. They shouldn't have to wade through implementation details. I then defined them at the very end so that they could be defined in terms of hash_combine or any other hashing infrastructure. Added various pair-hashing unittests. llvm-svn: 151882
* Grammar-o in function name.Eric Christopher2012-03-021-2/+2
| | | | llvm-svn: 151875
* Remove the misguided extension here that reserved two special values inChandler Carruth2012-03-021-51/+17
| | | | | | | | | | | the hash_code. I'm not sure what I was thinking here, the use cases for special values are in the *keys*, not in the hashes of those keys. We can always resurrect this if needed, or clients can accomplish the same goal themselves. This makes the general case somewhat faster (~5 cycles faster on my machine) and smaller with less branching. llvm-svn: 151865
* [Object]David Meyer2012-03-014-1/+39
| | | | | | Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object. llvm-svn: 151845
* Fix two warnings in this code that I missed.Chandler Carruth2012-03-011-2/+3
| | | | llvm-svn: 151839
* Move include/llvm/ADT/SaveAndRestore.h -> include/llvm/Support/SaveAndRestore.hArgyrios Kyrtzidis2012-03-011-0/+0
| | | | llvm-svn: 151828
* Rewrite LLVM's generalized support library for hashing to follow the APIChandler Carruth2012-03-013-148/+758
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Move getSubRegIndex out of generated code into MCRegisterInfo, devirtualize it.Benjamin Kramer2012-03-012-5/+10
| | | | llvm-svn: 151821
* Move TargetRegisterInfo::getSubReg() to MCRegisterInfo.Jim Grosbach2012-03-012-6/+15
| | | | | | | | Allows us to de-virtualize the function and provides access to it in the instruction printer, which is useful for handling composite physical registers (e.g., ARM register lists). llvm-svn: 151815
* Make TargetRegisterClasses non-virtual by making the only virtual function a ↵Benjamin Kramer2012-03-011-14/+4
| | | | | | | | | | | function pointer. This allows us to make TRC non-polymorphic and value-initializable, eliminating a huge static initializer and a ton of cruft from the generated code. Shrinks ARMBaseRegisterInfo.o by ~100k. llvm-svn: 151806
* Make InlineSpiller bundle-aware.Jakob Stoklund Olesen2012-03-011-0/+9
| | | | | | | | | | Simply treat bundles as instructions. Spill code is inserted between bundles, never inside a bundle. Rewrite all operands in a bundle at once. Don't attempt and memory operand folding inside bundles. llvm-svn: 151787
* [Object]David Meyer2012-03-014-1/+330
| | | | | | | | | * Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile. * Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable. * Implement this new interface completely for ELF, leave stubs for COFF and MachO. * Add 'llvm-readobj' tool for dumping ObjectFile information. llvm-svn: 151785
* Move getBundleStart() into MachineInstrBundle.h.Jakob Stoklund Olesen2012-03-013-11/+19
| | | | | | | | | This allows the function to be inlined, and makes it suitable for use in getInstructionIndex(). Also provide a const version. C++ is great for touch typing practice. llvm-svn: 151782
* BitstreamWriter: Use SmallVector::append instead of multiple push_back calls.Daniel Dunbar2012-02-291-4/+6
| | | | llvm-svn: 151755
* BitstreamWriter: Change primary output buffer to be a SmallVector instead of anDaniel Dunbar2012-02-291-2/+3
| | | | | | | | | std::vector. - Good for 1-2% speedup on writing PCH for Cocoa.h. - Clang side API match to follow shortly, there wasn't an easy way to make this non-breaking. llvm-svn: 151750
* BitstreamWriter: Isolate access to the underlying buffer.Daniel Dunbar2012-02-291-20/+32
| | | | llvm-svn: 151749
* BitcodeWriter: Expose less implementation details -- make BackpatchWord privateDaniel Dunbar2012-02-291-11/+9
| | | | | | and remove getBuffer(). llvm-svn: 151748
* Bitcode: Don't expose WriteBitcodeToStream to clients.Daniel Dunbar2012-02-291-4/+0
| | | | llvm-svn: 151747
* [Object] Add symbol attribute flags: ST_ThreadLocal, ST_Common, and ↵David Meyer2012-02-292-11/+24
| | | | | | | | | ST_Undefined. Implement these completely for ELF. Rename ST_External to ST_Unknown, and slightly change its semantics. It now only indicates that the symbol's type is unknown, not that the symbol is undefined. (For that, use ST_Undefined). llvm-svn: 151696
* Add an analyzeVirtReg() function.Jakob Stoklund Olesen2012-02-291-0/+33
| | | | | | | | | | | | | | This function does more or less the same as MI::readsWritesVirtualRegister(), but it supports bundles as well. It also determines if any constraint requires reading and writing operands to use the same register. Most clients want to know. Use the more modern MO.readsReg() instead of trying to sort out undefs and partial redefines. Stop supporting the extra full <imp-def> operand as an alternative to <def,undef> sub-register defines. llvm-svn: 151690
* Make MemoryObject accessor members const againDerek Schuff2012-02-293-27/+26
| | | | llvm-svn: 151687
* Move the operand iterator into MachineInstrBundle.h where it belongs.Jakob Stoklund Olesen2012-02-292-67/+108
| | | | | | | | | Extract a base class and provide four specific sub-classes for iterating over const/non-const bundles/instructions. This eliminates the mystery bool constructor argument. llvm-svn: 151684
* Instructions inside a bundle have the same number as the bundle itself.Jakob Stoklund Olesen2012-02-281-2/+6
| | | | | | | | | | SlotIndexes are not assigned to instructions inside bundles, but it is still valid to look up the index of those instructions. The reverse getInstructionFromIndex() will return the first instruction in the bundle. llvm-svn: 151672
* In the ObjectFile interface, replace isInternal(), isAbsolute(), isGlobal(), ↵David Meyer2012-02-284-77/+32
| | | | | | and isWeak(), with a bitset of flags. llvm-svn: 151670
* On ELF, create relocations to the abbreviation and line sections when producingRafael Espindola2012-02-281-2/+2
| | | | | | | | | | debug info for assembly files. We were already doing the right thing when producing debug info for C/C++. ELF linkers don't know dwarf, so they depend on these relocations to produce valid dwarf output. llvm-svn: 151655
* Re-commit r151623 with fix. Only issue special no-return calls if it's a ↵Evan Cheng2012-02-281-2/+3
| | | | | | direct call. llvm-svn: 151645
* Revert r151623 "Some ARM implementaions, e.g. A-series, does return stack ↵Daniel Dunbar2012-02-281-3/+2
| | | | | | prediction. ...", it is breaking the Clang build during the Compiler-RT part. llvm-svn: 151630
* Some ARM implementaions, e.g. A-series, does return stack prediction. That is,Evan Cheng2012-02-281-2/+3
| | | | | | | | | | | | | | | | | the processor keeps a return addresses stack (RAS) which stores the address and the instruction execution state of the instruction after a function-call type branch instruction. Calling a "noreturn" function with normal call instructions (e.g. bl) can corrupt RAS and causes 100% return misprediction so LLVM should use a unconditional branch instead. i.e. mov lr, pc b _foo The "mov lr, pc" is issued in order to get proper backtrace. rdar://8979299 llvm-svn: 151623
* [Object] Add {begin,end}_dynamic_symbols stubs and implementation for ELF.Michael J. Spencer2012-02-284-20/+90
| | | | | | | | Add -D option to llvm-nm to dump dynamic symbols. Patch by David Meyer. llvm-svn: 151600
OpenPOWER on IntegriCloud