summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
* [Support/MemoryBuffer] Rename IsVolatile -> IsVolatileSize and add a comment ↵Argyrios Kyrtzidis2014-05-061-9/+15
| | | | | | about the use case for the new parameter. llvm-svn: 208026
* Add llvm::function_ref (and a couple of uses of it), representing a ↵Richard Smith2014-05-063-29/+138
| | | | | | type-erased reference to a callable object. llvm-svn: 208025
* Improve 'tail' call marking in TRE. A bootstrap of clang goes from 375k ↵Nick Lewycky2014-05-051-0/+5
| | | | | | | | | | calls marked tail in the IR to 470k, however this improvement does not carry into an improvement of the call/jmp ratio on x86. The most common pattern is a tail call + br to a block with nothing but a 'ret'. The number of tail call to loop conversions remains the same (1618 by my count). The new algorithm does a local scan over the use-def chains to identify local "alloca-derived" values, as well as points where the alloca could escape. Then, a visit over the CFG marks blocks as being before or after the allocas have escaped, and annotates the calls accordingly. llvm-svn: 208017
* Walk back commits for unused function parameters - they're still beingEric Christopher2014-05-051-1/+1
| | | | | | used via dragonegg for now. llvm-svn: 208016
* [Support/MemoryBuffer] Introduce a boolean parameter (false by default) ↵Argyrios Kyrtzidis2014-05-051-6/+18
| | | | | | | | 'IsVolatile' for the open file functions. This provides a hint that the file may be changing often so mmap is avoided. llvm-svn: 208007
* Remove unused argument from AddFeature.Eric Christopher2014-05-051-1/+1
| | | | llvm-svn: 208002
* Fix typo (also tab character).Eric Christopher2014-05-051-3/+3
| | | | llvm-svn: 208001
* Remove the -disable-cfi option.Rafael Espindola2014-05-051-3/+0
| | | | | | | This also add a release note about it. If this stays I will cleanup MC next week. llvm-svn: 207977
* Add range access to ELFFile's sections collection.Simon Atanasyan2014-05-051-16/+19
| | | | llvm-svn: 207952
* [LCG] Add the last (and most complex) of the edge insertion mutationChandler Carruth2014-05-041-0/+16
| | | | | | | | | | | | | operations on the call graph. This one forms a cycle, and while not as complex as removing an internal edge from an SCC, it involves a reasonable amount of work to find all of the nodes newly connected in a cycle. Also somewhat alarming is the worst case complexity here: it might have to walk roughly the entire SCC inverse DAG to insert a single edge. This is carefully documented in the API (I hope). llvm-svn: 207935
* IR: Cleanup AttributeSet::get for AttrBuilderDavid Majnemer2014-05-031-1/+8
| | | | | | | We don't modify the AttrBuilder in AttributeSet::get, make the reference argument const. llvm-svn: 207924
* Fix pr19645.Rafael Espindola2014-05-032-4/+3
| | | | | | | | | | | | | | | | The fix itself is fairly simple: move getAccessVariant to MCValue so that we replace the old weak expression evaluation with the far more general EvaluateAsRelocatable. This then requires that EvaluateAsRelocatable stop when it finds a non trivial reference kind. And that in turn requires the ELF writer to look harder for weak references. Last but not least, this found a case where we were being bug by bug compatible with gas and accepting an invalid input. I reported pr19647 to track it. llvm-svn: 207920
* Rename member variable to try to fix the bots.Rafael Espindola2014-05-031-1/+1
| | | | llvm-svn: 207915
* Move LTOModule and LTOCodeGenerator to the llvm namespace.Rafael Espindola2014-05-033-60/+49
| | | | llvm-svn: 207911
* Style fix: don't duplicate the method names.Rafael Espindola2014-05-032-45/+36
| | | | llvm-svn: 207910
* Style update: don't duplicate comments, they were getting out of sync.Rafael Espindola2014-05-031-2/+3
| | | | llvm-svn: 207909
* Vectorize intrinsic math function calls in SLPVectorizer.Karthik Bhat2014-05-031-0/+124
| | | | | | | This patch adds support to recognize and vectorize intrinsic math functions in SLPVectorizer. Review: http://reviews.llvm.org/D3560 and http://reviews.llvm.org/D3559 llvm-svn: 207901
* Try simplifying LexicalScopes ownership again.David Blaikie2014-05-021-99/+100
| | | | | | | | | | | | | | Committed initially in r207724-r207726 and reverted due to compiler-rt crashes in r207732. Instead, fix this harder with unordered_map and store the LexicalScopes by value in the map. This did necessitate moving the definition of LexicalScope above the definition of LexicalScopes. Let's see how the buildbots/compilers tolerate unordered_map::emplace + std::piecewise_construct + std::forward_as_tuple... llvm-svn: 207876
* Remove dead declaration.Rafael Espindola2014-05-021-7/+0
| | | | llvm-svn: 207857
* Teach GlobalDCE how to remove empty global_ctor entries.Nico Weber2014-05-021-0/+35
| | | | | | | | | | | | | | | | | This moves most of GlobalOpt's constructor optimization code out of GlobalOpt into Transforms/Utils/CDtorUtils.{h,cpp}. The public interface is a single function OptimizeGlobalCtorsList() that takes a predicate returning which constructors to remove. GlobalOpt calls this with a function that statically evaluates all constructors, just like it did before. This part of the change is behavior-preserving. Also add a call to this from GlobalDCE with a filter that removes global constructors that contain a "ret" instruction and nothing else – this fixes PR19590. llvm-svn: 207856
* [Stackmaps] Pacify windows buildbot.Juergen Ributzka2014-05-011-1/+1
| | | | llvm-svn: 207807
* [Stackmaps] Add command line option to specify the stackmap version.Juergen Ributzka2014-05-011-1/+1
| | | | llvm-svn: 207805
* [Stackmaps] Refactor serialization code. No functional change intended.Juergen Ributzka2014-05-011-0/+15
| | | | llvm-svn: 207804
* [Stackmaps] Replace the custom ConstantPool class with a MapVector.Juergen Ributzka2014-05-011-20/+1
| | | | llvm-svn: 207803
* Add an optimization that does CSE in a group of similar GEPs.Eli Bendersky2014-05-013-0/+8
| | | | | | | | | | | | | | This optimization merges the common part of a group of GEPs, so we can compute each pointer address by adding a simple offset to the common part. The optimization is currently only enabled for the NVPTX backend, where it has a large payoff on some benchmarks. Review: http://reviews.llvm.org/D3462 Patch by Jingyue Wu. llvm-svn: 207783
* Move getBaseSymbol somewhere the COFF writer can use.Rafael Espindola2014-05-011-0/+4
| | | | | | I will use it there in a second. llvm-svn: 207761
* [LCG] Add the other simple edge insertion API to the call graph. ThisChandler Carruth2014-05-011-0/+8
| | | | | | | | | just connects an SCC to one of its descendants directly. Not much of an impact. The last one is the hard one -- connecting an SCC to one of its ancestors, and thereby forming a cycle such that we have to merge all the SCCs participating in the cycle. llvm-svn: 207751
* [LCG] Add some basic methods for querying the parent/child relationshipsChandler Carruth2014-05-011-0/+14
| | | | | | | | of SCCs in the SCC DAG. Exercise them in the big graph test case. These will be especially useful for establishing invariants in insertion logic. llvm-svn: 207749
* [LCG] Fix a bad bug in the new fancy iterator scheme I added to supportChandler Carruth2014-05-011-18/+15
| | | | | | | | | | | | | | | | | | | removal. We can't just blindly increment (or decrement) the adapted iterator when the value is null because doing so can walk past the end (or beginning) and keep inspecting the value. The fix I've implemented is to restrict this further to a forward iterator and add an end iterator to the members (replacing a member that had become dead when I switched to the adaptor base!) and using that to stop the iteration. I'm not entirely pleased with this solution. I feel like forward iteration is too restrictive. I wasn't even happy about bidirectional iteration. It also makes the iterator objects larger and the iteration loops more complex. However, I also don't really like the other alternative that seems obvious: a sentinel node. I'm still hoping to come up with a more elegant solution here, but this at least fixes the MSan and Valgrind errors on this code. llvm-svn: 207743
* Record the DWARF version in MCContextOliver Stannard2014-05-011-0/+6
| | | | | | | Record the DWARF version in MCContext, and use it when emitting the dwarf version into the debug info. llvm-svn: 207739
* Speculatively roll back r207724-r207726, which are code cleanup changes andRichard Smith2014-05-011-7/+4
| | | | | | appear to be breaking a bootstrapped build of compiler-rt. llvm-svn: 207732
* LexicalScopes: Use unique_ptr to manage ownership of abstract LexicalScopes.David Blaikie2014-04-301-2/+3
| | | | llvm-svn: 207726
* LexicalScopes: use unique_ptr to own LexicalScope objects.David Blaikie2014-04-301-2/+4
| | | | | | Ownership of abstract scopes coming soon. llvm-svn: 207724
* Provide a version of getSymbolOffset that returns false on error.Rafael Espindola2014-04-301-0/+4
| | | | | | | This simplifies ELFObjectWriter::SymbolValue a bit more. This new version will also be used in the COFF writer to fix pr19147. llvm-svn: 207711
* Remove unused field hash_state::seed.Jay Foad2014-04-301-2/+1
| | | | llvm-svn: 207703
* [ARM64] Prevent bit extraction to be adjusted by following shiftWeiming Zhao2014-04-301-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | For pattern like ((x >> C1) & Mask) << C2, DAG combiner may convert it into (x >> (C1-C2)) & (Mask << C2), which makes pattern matching of ubfx more difficult. For example: Given %shr = lshr i64 %x, 4 %and = and i64 %shr, 15 %arrayidx = getelementptr inbounds [8 x [64 x i64]]* @arr, i64 0, %i64 2, i64 %and %0 = load i64* %arrayidx With current shift folding, it takes 3 instrs to compute base address: lsr x8, x0, #1 and x8, x8, #0x78 add x8, x9, x8 If using ubfx, it only needs 2 instrs: ubfx x8, x0, #4, #4 add x8, x9, x8, lsl #3 This fixes bug 19589 llvm-svn: 207702
* ELFObjectWriter: deduplicate suffices in strtabHans Wennborg2014-04-301-0/+59
| | | | | | | | | | | | | | | We already do this for shstrtab, so might as well do it for strtab. This extracts the string table building code into a separate class. The idea is to use it for other object formats too. I mostly wanted to do this for the general principle, but it does save a little bit on object file size. I tried this on a clang bootstrap and saved 0.54% on the sum of object file sizes (1.14 MB out of 212 MB for a release build). Differential Revision: http://reviews.llvm.org/D3533 llvm-svn: 207670
* Fix a use of uninitialized memory in SmallVector's move-assignment operator.Douglas Gregor2014-04-301-1/+1
| | | | | | | | When we were moving from a larger vector to a smaller one but didn't need to re-allocate, we would move-assign over uninitialized memory in the target, then move-construct that same data again. llvm-svn: 207663
* [mips] Emit all three relocation operations for each relocation entry on ↵Matheus Almeida2014-04-301-1/+12
| | | | | | | | | | | | | | | | Mips64 big-endian systems. Summary: The N64 ABI allows up to three operations to be specified per relocation record independently of the endianness. Reviewers: dsanders Reviewed By: dsanders Differential Revision: http://reviews.llvm.org/D3529 llvm-svn: 207636
* [LCG] Add the really, *really* boring edge insertion case: adding anChandler Carruth2014-04-301-0/+9
| | | | | | | | | | edge entirely within an existing SCC. Shockingly, making the connected component more connected is ... a total snooze fest. =] Anyways, its wired up, and I even added a test case to make sure it pretty much sorta works. =D llvm-svn: 207631
* raw_ostream::operator<<(StringRef): Avoid potential overflow in pointer ↵NAKAMURA Takumi2014-04-301-1/+1
| | | | | | | | | | | | | | arithmetic. (OutBufCur + Size) might overflow if Size were large. For example on i686-linux, OutBufCur: 0xFFFDF27D OutBufEnd: 0xFFFDF370 Size: 0x0002BF20 (180,000) It caused flaky error in MC/COFF/section-name-encoding.s. llvm-svn: 207621
* [LCG] Actually test the *basic* edge removal bits (IE, the non-SCCChandler Carruth2014-04-301-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | bits), and discover that it's totally broken. Yay tests. Boo bug. Fix the basic edge removal so that it works by nulling out the removed edges rather than actually removing them. This leaves the indices valid in the map from callee to index, and preserves some of the locality for iterating over edges. The iterator is made bidirectional to reflect that it now has to skip over null entries, and the skipping logic is layered onto it. As future work, I would like to track essentially the "load factor" of the edge list, and when it falls below a threshold do a compaction. An alternative I considered (and continue to consider) is storing the callees in a doubly linked list where each element of the list is in a set (which is essentially the classical linked-hash-table datastructure). The problem with that approach is that either you need to heap allocate the linked list nodes and use pointers to them, or use a bucket hash table (with even *more* linked list pointer overhead!), etc. It's pretty easy to get 5x overhead for values that are just pointers. So far, I think punching holes in the vector, and periodic compaction is likely to be much more efficient overall in the space/time tradeoff. llvm-svn: 207619
* [ADT] Provide some helpful static_asserts for using operations of theChandler Carruth2014-04-301-5/+59
| | | | | | | wrong iterator category. These aren't comprehensive, but they have caught the common cases for me and produce much nicer errors. llvm-svn: 207601
* raw_ostream: Forward declare OpenFlags and include FileSystem.h only where ↵Benjamin Kramer2014-04-295-4/+11
| | | | | | necessary. llvm-svn: 207593
* Fix MSVC build broken by r207580David Blaikie2014-04-291-4/+1
| | | | | | | | Seems MSVC wants to be able to codegen inline-definitions of virtual functions even in TUs that don't define the key function - and it's well within its rights to do so. llvm-svn: 207581
* PR19553: Memory leak in RuntimeDyldELF::createObjectImageFromFileDavid Blaikie2014-04-292-2/+2
| | | | | | | | | | | | | | | | This starts in MCJIT::getSymbolAddress where the unique_ptr<object::Binary> is release()d and (after a cast) passed to a single caller, MCJIT::addObjectFile. addObjectFile calls RuntimeDyld::loadObject. RuntimeDld::loadObject calls RuntimeDyldELF::createObjectFromFile And the pointer is never owned at this point. I say this point, because the alternative codepath, RuntimeDyldMachO::createObjectFile certainly does take ownership, so this seemed like a good hint that this was a/the right place to take ownership. llvm-svn: 207580
* [Windows] Fix assertion failure when passing 'nul' in input to clang.Andrea Di Biagio2014-04-291-3/+18
| | | | | | | | | | | | | | | | | Before this patch, if 'nul' was passed in input to clang, function getStatus() (in Path.inc) always returned an instance of file_status with field 'nFileSizeHigh' and 'nFileSizeLow' left uninitialized. This was causing the triggering of an assertion failure in MemoryBuffer.cpp due to an invalid FileSize for device 'nul'. This patch fixes the assertion failure modifying the constructors of class file_status (in llvm/Support/FileSystem.h) so that every field of the class gets initialized to zero by default. A clang test will be submitted on a separate patch. llvm-svn: 207575
* BranchProb: Simplify printing codeDuncan P. N. Exon Smith2014-04-291-2/+4
| | | | llvm-svn: 207559
* Support: Remove out-of-date commentsDuncan P. N. Exon Smith2014-04-291-8/+0
| | | | | | The code is now shared... no need for a note. llvm-svn: 207555
* blockfreq: Defer to BranchProbability::scale() (again)Duncan P. N. Exon Smith2014-04-291-10/+0
| | | | | | | | | | | | Change `BlockFrequency` to defer to `BranchProbability::scale()` and `BranchProbability::scaleByInverse()`. This removes `BlockFrequency::scale()` from its API (and drops the ability to see the remainder), but the only user was the unit tests. If some code in the future needs an API that exposes the remainder, we can add something to `BranchProbability`, but I find that unlikely. llvm-svn: 207550
OpenPOWER on IntegriCloud