summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the linker_private and linker_private_weak linkages.Rafael Espindola2014-03-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These linkages were introduced some time ago, but it was never very clear what exactly their semantics were or what they should be used for. Some investigation found these uses: * utf-16 strings in clang. * non-unnamed_addr strings produced by the sanitizers. It turns out they were just working around a more fundamental problem. For some sections a MachO linker needs a symbol in order to split the section into atoms, and llvm had no idea that was the case. I fixed that in r201700 and it is now safe to use the private linkage. When the object ends up in a section that requires symbols, llvm will use a 'l' prefix instead of a 'L' prefix and things just work. With that, these linkages were already dead, but there was a potential future user in the objc metadata information. I am still looking at CGObjcMac.cpp, but at this point I am convinced that linker_private and linker_private_weak are not what they need. The objc uses are currently split in * Regular symbols (no '\01' prefix). LLVM already directly provides whatever semantics they need. * Uses of a private name (start with "\01L" or "\01l") and private linkage. We can drop the "\01L" and "\01l" prefixes as soon as llvm agrees with clang on L being ok or not for a given section. I have two patches in code review for this. * Uses of private name and weak linkage. The last case is the one that one could think would fit one of these linkages. That is not the case. The semantics are * the linker will merge these symbol by *name*. * the linker will hide them in the final DSO. Given that the merging is done by name, any of the private (or internal) linkages would be a bad match. They allow llvm to rename the symbols, and that is really not what we want. From the llvm point of view, these objects should really be (linkonce|weak)(_odr)?. For now, just keeping the "\01l" prefix is probably the best for these symbols. If we one day want to have a more direct support in llvm, IMHO what we should add is not a linkage, it is just a hidden_symbol attribute. It would be applicable to multiple linkages. For example, on weak it would produce the current behavior we have for objc metadata. On internal, it would be equivalent to private (and we should then remove private). llvm-svn: 203866
* Phase 2 of the great MachineRegisterInfo cleanup. This time, we're changingOwen Anderson2014-03-1322-95/+98
| | | | | | | | | | operator* on the by-operand iterators to return a MachineOperand& rather than a MachineInstr&. At this point they almost behave like normal iterators! Again, this requires making some existing loops more verbose, but should pave the way for the big range-based for-loop cleanups in the future. llvm-svn: 203865
* Fix for http://llvm.org/bugs/show_bug.cgi?id=18590Ekaterina Romanova2014-03-133-14/+27
| | | | | | | This patch fixes the bug in peephole optimization that folds a load which defines one vreg into the one and only use of that vreg. With debug info, a DBG_VALUE that referenced the vreg considered to be a use, preventing the optimization. The fix is to ignore DBG_VALUE's during the optimization, and undef a DBG_VALUE that references a vreg that gets removed. Patch by Trevor Smigiel! llvm-svn: 203829
* CodeGenPrep: sink extends of illegal types into use block.Manuel Jacob2014-03-131-36/+49
| | | | | | | | | | | | | | | | | | | Summary: This helps the instruction selector to lower an i64 * i64 -> i128 multiplication into a single instruction on targets which support it. This is an update of D2973 which was reverted because of a bug reported as PR19084. Reviewers: t.p.northover, chapuni Reviewed By: t.p.northover CC: llvm-commits, alex, chapuni Differential Revision: http://llvm-reviews.chandlerc.com/D3021 llvm-svn: 203797
* Phase 1 of refactoring the MachineRegisterInfo iterators to make them suitableOwen Anderson2014-03-137-34/+57
| | | | | | | | | | | | | | | | | | | for use with C++11 range-based for-loops. The gist of phase 1 is to remove the skipInstruction() and skipBundle() methods from these iterators, instead splitting each iterator into a version that walks operands, a version that walks instructions, and a version that walks bundles. This has the result of making some "clever" loops in lib/CodeGen more verbose, but also makes their iterator invalidation characteristics much more obvious to the casual reader. (Making them concise again in the future is a good motivating case for a pre-incrementing range adapter!) Phase 2 of this undertaking with consist of removing the getOperand() method, and changing operator*() of the operand-walker to return a MachineOperand&. At that point, it should be possible to add range views for them that work as one might expect. llvm-svn: 203757
* Reject alias to undefined symbols in the verifier.Rafael Espindola2014-03-121-5/+1
| | | | | | | | | | | | | | | On ELF and COFF an alias is just another name for a position in the file. There is no way to refer to a position in another file, so an alias to undefined is meaningless. MachO currently doesn't support aliases. The spec has a N_INDR, which when implemented will have a different set of restrictions. Adding support for it shouldn't be harder than any other IR extension. For now, having the IR represent what is actually possible with current tools makes it easier to fix the design of GlobalAlias. llvm-svn: 203705
* When computing the size of a base type be conservative if the typeEric Christopher2014-03-121-2/+3
| | | | | | is a declaration and return the size of the type. llvm-svn: 203690
* Use values we've already computed, update comment.Eric Christopher2014-03-121-4/+3
| | | | | | No functional change. llvm-svn: 203681
* Turn on hashing by default for split dwarf compile units.Eric Christopher2014-03-121-1/+1
| | | | llvm-svn: 203680
* DebugInfo: Use common line/file attribute construction codeDavid Blaikie2014-03-121-5/+3
| | | | llvm-svn: 203676
* Replace '#include ValueTypes.h' with forward declarations.Patrik Hagglund2014-03-121-1/+1
| | | | | | | In some cases the include is pushed "downstream" (or removed if unused). llvm-svn: 203644
* DebugInfo: Omit pubnames/pubtypes when compiling with -gmltDavid Blaikie2014-03-121-2/+5
| | | | llvm-svn: 203634
* DebugInfo: Do not emit pubnames/pubtypes sections if they are emptyDavid Blaikie2014-03-111-0/+3
| | | | llvm-svn: 203622
* DebugInfo: Avoid re-looking up the DwarfUnit when emitting pubnames/pubtypesDavid Blaikie2014-03-111-1/+4
| | | | llvm-svn: 203620
* DebugInfo: Refactor emitDebugPubNames/Types into a common implementationDavid Blaikie2014-03-112-56/+16
| | | | | | | | | | I could fold the callers into their one call site, but the indirection (given how verbose choosing the section is) seemed helpful. The use of a member function pointer's a bit "tricky", but seems limited enough, the call sites are simple/clean/clear, and there's only one use. llvm-svn: 203619
* Accept Twine's to AsmPrinter::getTempSymbol (refactoring for an incoming change)David Blaikie2014-03-111-2/+2
| | | | llvm-svn: 203617
* DebugInfo: Remove unused labels now that we just emit DW_AT_gnu_pubnames as ↵David Blaikie2014-03-111-8/+0
| | | | | | a flag (as of r203082) llvm-svn: 203612
* Remove copy ctors that did the same thing as the default one.Benjamin Kramer2014-03-111-8/+0
| | | | | | | The code added nothing but potentially disabled move semantics and made types non-trivially copyable. llvm-svn: 203563
* IR: add a second ordering operand to cmpxhg for failureTim Northover2014-03-114-15/+33
| | | | | | | | | | | | | | | The syntax for "cmpxchg" should now look something like: cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic where the second ordering argument gives the required semantics in the case that no exchange takes place. It should be no stronger than the first ordering constraint and cannot be either "release" or "acq_rel" (since no store will have taken place). rdar://problem/15996804 llvm-svn: 203559
* Fix non 2-space indentation.Matt Arsenault2014-03-111-73/+73
| | | | llvm-svn: 203514
* When analyzing vectors of element type that require legalization,Raul E. Silvera2014-03-101-2/+3
| | | | | | | | | | | | | | | | | | the legalization cost must be included to get an accurate estimation of the total cost of the scalarized vector. The inaccurate cost triggered unprofitable SLP vectorization on 32-bit X86. Summary: Include legalization overhead when computing scalarization cost Reviewers: hfinkel, nadav CC: chandlerc, rnk, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2992 llvm-svn: 203509
* [C++11] Remove 'virtual' keyword from methods marked with 'override' keyword.Craig Topper2014-03-102-66/+63
| | | | llvm-svn: 203444
* [TTI] There is actually no realistic way to pop TTI implementations offChandler Carruth2014-03-101-4/+0
| | | | | | | | | | | | | | the stack of the analysis group because they are all immutable passes. This is made clear by Craig's recent work to use override systematically -- we weren't overriding anything for 'finalizePass' because there is no such thing. This is kind of a lame restriction on the API -- we can no longer push and pop things, we just set up the stack and run. However, I'm not invested in building some better solution on top of the existing (terrifying) immutable pass and legacy pass manager. llvm-svn: 203437
* StackColoring: Use range-based for loops.Benjamin Kramer2014-03-091-79/+47
| | | | | | No functionality change. llvm-svn: 203415
* MachineModuleInfo: Turn nested std::pairs into a proper struct.Benjamin Kramer2014-03-093-20/+14
| | | | llvm-svn: 203414
* Revert r203230, "CodeGenPrep: sink extends of illegal types into use block."NAKAMURA Takumi2014-03-091-58/+34
| | | | | | It choked i686 stage2. llvm-svn: 203386
* [C++11] Add range based accessors for the Use-Def chain of a Value.Chandler Carruth2014-03-096-69/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This requires a number of steps. 1) Move value_use_iterator into the Value class as an implementation detail 2) Change it to actually be a *Use* iterator rather than a *User* iterator. 3) Add an adaptor which is a User iterator that always looks through the Use to the User. 4) Wrap these in Value::use_iterator and Value::user_iterator typedefs. 5) Add the range adaptors as Value::uses() and Value::users(). 6) Update *all* of the callers to correctly distinguish between whether they wanted a use_iterator (and to explicitly dig out the User when needed), or a user_iterator which makes the Use itself totally opaque. Because #6 requires churning essentially everything that walked the Use-Def chains, I went ahead and added all of the range adaptors and switched them to range-based loops where appropriate. Also because the renaming requires at least churning every line of code, it didn't make any sense to split these up into multiple commits -- all of which would touch all of the same lies of code. The result is still not quite optimal. The Value::use_iterator is a nice regular iterator, but Value::user_iterator is an iterator over User*s rather than over the User objects themselves. As a consequence, it fits a bit awkwardly into the range-based world and it has the weird extra-dereferencing 'operator->' that so many of our iterators have. I think this could be fixed by providing something which transforms a range of T&s into a range of T*s, but that *can* be separated into another patch, and it isn't yet 100% clear whether this is the right move. However, this change gets us most of the benefit and cleans up a substantial amount of code around Use and User. =] llvm-svn: 203364
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-0816-98/+99
| | | | | | class. llvm-svn: 203339
* DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in DW_TAG_lexical_blocksDavid Blaikie2014-03-081-2/+1
| | | | | | Suggested by Adrian Prantl in code review for r203187 llvm-svn: 203323
* Add support for hashing location information for CU level hashes.Eric Christopher2014-03-083-6/+43
| | | | | | | Add a testcase based on sret.cpp where we can now hash the entire compile unit. llvm-svn: 203319
* [DAGCombiner] Distribute TRUNC through AND in rotation amountAdam Nemet2014-03-071-0/+16
| | | | | | | | | | | | | | | | This is already done for shifts. Allow it for rotations as well. E.g.: (rotl:i32 x, (trunc (and y, 31))) -> (rotl:i32 x, (and (trunc y), 31)) Use the newly factored-out distributeTruncateThroughAnd. With this patch and some X86.td tweaks we should be able to remove redundant masking of the rotation amount like in the example above. HW implicitly performs this masking. The testcase will be added as part of the X86 patch. llvm-svn: 203316
* [DAGCombiner] Recognize another rotation idiomAdam Nemet2014-03-071-0/+8
| | | | | | | | | | | | | | | | This is the new idiom: x<<(y&31) | x>>((0-y)&31) which is recognized as: x ROTL (y&31) The change refines matchRotateSub. In Neg & (OpSize - 1) == (OpSize - Pos) & (OpSize - 1), if Pos is Pos' & (OpSize - 1) we can just use Pos' instead of Pos. llvm-svn: 203315
* [DAGCombiner] Slightly improve readability of matchRotateSubAdam Nemet2014-03-071-8/+9
| | | | | | | | | | Slightly change the wording in the function comment. Originally, it can be misunderstood as we turned the input into two subsequent rotates. Better connect the comment which talks about Mask and the code which used LoBits. Renamed variable to MaskLoBits. llvm-svn: 203314
* ISel: Make VSELECT selection terminate in cases where the condition type has toArnold Schwaighofer2014-03-071-0/+11
| | | | | | | | | | | | | | | be split and the result type widened. When the condition of a vselect has to be split it makes no sense widening the vselect and thereby widening the condition. We end up in an endless loop of widening (vselect result type) and splitting (condition mask type) doing this. Instead, split both the condition and the vselect and widen the result. I ran this over the test suite with i686 and mattr=+sse and saw no regressions. Fixes PR18036. llvm-svn: 203311
* Remove unnecessary test for Darwin and update testcase to be a little lessAdrian Prantl2014-03-071-1/+1
| | | | | | | horrible/fragile. rdar://problem/16264854 llvm-svn: 203309
* Add a virtual destructor to quiet a warning.Eric Christopher2014-03-071-0/+2
| | | | llvm-svn: 203307
* Actually add the header file.Eric Christopher2014-03-071-0/+69
| | | | llvm-svn: 203305
* Two part patch:Eric Christopher2014-03-073-102/+104
| | | | | | | | | | | | | | | First: refactor out the emission of entries into the .debug_loc section into its own routine. Second: add a new class ByteStreamer that can be used to either emit using an AsmPrinter or hash using DIEHash the series of bytes that would be emitted. Use this in all of the location emission routines for the .debug_loc section. No functional change intended outside of a few additional comments in verbose assembly. llvm-svn: 203304
* Add include guards and make public a few routines that add valuesEric Christopher2014-03-071-1/+11
| | | | | | to the hash. llvm-svn: 203303
* Revert "Remove unnecessary check for Darwin. rdar://problem/16264854"Adrian Prantl2014-03-071-1/+1
| | | | | | This breaks linux buildbots. Go figure. llvm-svn: 203300
* Remove unnecessary check for Darwin. rdar://problem/16264854Adrian Prantl2014-03-071-1/+1
| | | | llvm-svn: 203297
* DebugInfo: Use DW_FORM_data4 for DW_AT_high_pc in inlined functionsDavid Blaikie2014-03-071-2/+1
| | | | | | Suggested by Adrian Prantl in code review for r203187. llvm-svn: 203296
* [C++11] Convert sort predicates into lambdas.Benjamin Kramer2014-03-073-28/+9
| | | | | | No functionality change. llvm-svn: 203288
* Fix up formatting.Eric Christopher2014-03-071-9/+8
| | | | llvm-svn: 203286
* [C++11] DwarfDebug: Turn single-use functors into lambdas.Benjamin Kramer2014-03-071-25/+16
| | | | | | No functionality change. llvm-svn: 203276
* [C++11] DwarfDebug: Use range-based for loops.Benjamin Kramer2014-03-071-245/+116
| | | | | | It has a lot of them with complex types. C++11 really shines here. llvm-svn: 203270
* DebugInfo: Refactor high_pc/low_pc construction into reusable functionDavid Blaikie2014-03-072-6/+13
| | | | | | | For incoming improvements to inlined functions and lexical blocks suggested by Adrian Prantl in review of r203187. llvm-svn: 203263
* DebugInfo: Restrict DW_AT_high_pc encoding as data4 offset to DWARF 4 as per ↵David Blaikie2014-03-071-1/+1
| | | | | | | | spec Code review feedback to r203187 from Oliver Stannard. Thanks! llvm-svn: 203256
* CodeGenPrep: sink extends of illegal types into use block.Tim Northover2014-03-071-34/+58
| | | | | | | | | This helps the instruction selector to lower an i64 * i64 -> i128 multiplication into a single instruction on targets which support it. Patch by Manuel Jacob. llvm-svn: 203230
* Remove unused method.Craig Topper2014-03-071-2/+0
| | | | llvm-svn: 203221
OpenPOWER on IntegriCloud