summaryrefslogtreecommitdiffstats
path: root/llvm/include
Commit message (Collapse)AuthorAgeFilesLines
...
* [ValueTracking] Improve isImpliedCondition when the dominating cond is false.Chad Rosier2016-04-251-5/+4
| | | | llvm-svn: 267430
* [ELFRelocs] Other architectures do not have *_NUM reloc.Davide Italiano2016-04-251-1/+0
| | | | | | | It also seems to be unused. Get rid of it. Thanks to Rafael for pointing out. llvm-svn: 267428
* [WinEH] Update SplitAnalysis::computeLastSplitPoint to cope with multiple EH ↵David Majnemer2016-04-252-4/+8
| | | | | | | | | | | | | | | | | | | successors We didn't have logic to correctly handle CFGs where there was more than one EH-pad successor (these are novel with WinEH). There were situations where a register was live in one exceptional successor but not another but the code as written would only consider the first exceptional successor it found. This resulted in split points which were insufficiently early if an invoke was present. This fixes PR27501. N.B. This removes getLandingPadSuccessor. llvm-svn: 267412
* [Coverage] Restore the correct count value after processing a nested region ↵Igor Kudrin2016-04-251-7/+0
| | | | | | | | | | | | | in case of combined regions. If several regions cover the same area of code, we have to restore the combined value for that area when return from a nested region. This patch achieves that by combining regions before calling buildSegments. Differential Revision: http://reviews.llvm.org/D18610 llvm-svn: 267390
* fix commentsIgor Breger2016-04-251-2/+1
| | | | | | | related to Differential Revision: http://reviews.llvm.org/D17913 llvm-svn: 267383
* Fixing wrong mask size error. From __mmask8 to __mmask16.Michael Zuckerman2016-04-251-1/+1
| | | | | | | Was reviewed over the shoulder by AsafBadouh. Connected to review http://reviews.llvm.org/D19195. llvm-svn: 267379
* [Support/ELFRelocs] Add R_386_GOT32X.Davide Italiano2016-04-251-1/+2
| | | | | | | | The new relocation recently defined in the Intel386 psABI was still missing from this file. A subsequent commit will add support for GOT32X in MC, together with a test. llvm-svn: 267378
* [ThinLTO] Remove GlobalValueInfo class from indexTeresa Johnson2016-04-242-92/+47
| | | | | | | | | | | | | | | | Summary: Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly reference summary objects. The info structure was there to support lazy parsing of the combined index summary objects, which is no longer needed and not supported. Reviewers: joker.eph Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19462 llvm-svn: 267344
* ModuleSummaryIndex: Avoid enum bitfields for MSVC portabilityDuncan P. N. Exon Smith2016-04-241-2/+4
| | | | | | | | Enum bitfields have crazy portability issues with MSVC. Use unsigned instead of LinkageTypes here in the ModuleSummaryIndex to address Takumi's concerns from r267335. llvm-svn: 267342
* Revert "Declare GlobalValue::LinkageTypes based on unsigned."Duncan P. N. Exon Smith2016-04-241-1/+1
| | | | | | | | | | | This reverts commit r267335. The build has been broken for hours because of it: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/23352/ The correct fix is avoid using any enum in a bitfield. llvm-svn: 267341
* Declare GlobalValue::LinkageTypes based on unsigned.NAKAMURA Takumi2016-04-241-1/+1
| | | | | | Or, "LinkageTypes Linkage : 4;" might be sign-extended on msc. llvm-svn: 267335
* Add "hasSection" flag in the SummaryMehdi Amini2016-04-241-2/+10
| | | | | | | | | | | Reviewers: tejohnson Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19405 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267329
* [MachineCombiner] Support for floating-point FMA on ARM64 (re-commit r267098)Gerolf Hoflehner2016-04-243-1/+45
| | | | | | | | | | | | | | | | | | | The original patch caused crashes because it could derefence a null pointer for SelectionDAGTargetInfo for targets that do not define it. Evaluates fmul+fadd -> fmadd combines and similar code sequences in the machine combiner. It adds support for float and double similar to the existing integer implementation. The key features are: - DAGCombiner checks whether it should combine greedily or let the machine combiner do the evaluation. This is only supported on ARM64. - It gives preference to throughput over latency: the heuristic used is to combine always in loops. The targets decides whether the machine combiner should optimize for throughput or latency. - Supports for fmadd, f(n)msub, fmla, fmls patterns - On by default at O3 ffast-math llvm-svn: 267328
* Reorganize GlobalValueSummary with a "Flags" bitfield.Mehdi Amini2016-04-242-25/+34
| | | | | | | | | | Right now it only contains the LinkageType, but will be extended with "hasSection", "isOptSize", "hasInlineAssembly", etc. Differential Revision: http://reviews.llvm.org/D19404 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267319
* Add a version field in the bitcode for the summaryMehdi Amini2016-04-241-0/+2
| | | | | | | Differential Revision: http://reviews.llvm.org/D19456 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267318
* Add an internalization step to the ThinLTOCodeGeneratorMehdi Amini2016-04-241-0/+5
| | | | | | | | | | | | | Keeping as much as possible internal/private is known to help the optimizer. Let's try to benefit from this in ThinLTO. Note: this is early work, but is enough to build clang (and all the LLVM tools). I still need to write some lit-tests... Differential Revision: http://reviews.llvm.org/D19103 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267317
* [MC/ELF] Implement support for GOTPCRELX/REX_GOTPCRELX.Davide Italiano2016-04-241-0/+6
| | | | | | | | | The option to control the emission of the new relocations is -relax-relocations (blatantly copied from GNU as). It can't be enabled by default because it breaks relatively recent versions of ld.bfd/ld.gold (late 2015). llvm-svn: 267307
* Store and emit original name in combined indexMehdi Amini2016-04-232-0/+14
| | | | | | | | | | | | | | | | | | | Summary: As discussed in D18298, some local globals can't be renamed/promoted (because they have a section, or because they are referenced from inline assembly). To be able to detect naming collision, we need to keep around the "GUID" using their original name without taking the linkage into account. Reviewers: tejohnson Subscribers: joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D19454 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267304
* DebugInfo: Remove MDString-based type referencesDuncan P. N. Exon Smith2016-04-232-50/+10
| | | | | | | | | | | | | | | | | | | | | | | | Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around DIType*. It is no longer legal to refer to a DICompositeType by its 'identifier:', and DIBuilder no longer retains all types with an 'identifier:' automatically. Aside from the bitcode upgrade, this is mainly removing logic to resolve an MDString-based reference to an actualy DIType. The commits leading up to this have made the implicit type map in DICompileUnit's 'retainedTypes:' field superfluous. This does not remove DITypeRef, DIScopeRef, DINodeRef, and DITypeRefArray, or stop using them in DI-related metadata. Although as of this commit they aren't serving a useful purpose, there are patchces under review to reuse them for CodeView support. The tests in LLVM were updated with deref-typerefs.sh, which is attached to the thread "[RFC] Lazy-loading of debug info metadata": http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html llvm-svn: 267296
* replace duplicated static functions for profile metadata access with ↵Sanjay Patel2016-04-231-0/+4
| | | | | | BranchInst member function; NFCI llvm-svn: 267295
* improve documentation comments; NFCSanjay Patel2016-04-231-71/+60
| | | | llvm-svn: 267292
* BitcodeReader: Avoid referencing unresolved nodes from distinct onesDuncan P. N. Exon Smith2016-04-232-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each reference to an unresolved MDNode is expensive, since the RAUW support in MDNode uses a separate allocation and side map. Since a distinct MDNode doesn't require its operands on creation (unlike uniuqed nodes, there's no need to check for structural equivalence), use nullptr for any of its unresolved operands. Besides reducing the burden on MDNode maps, this can avoid allocating temporary MDNodes in the first place. We need some way to track operands. Invent DistinctMDOperandPlaceholder for this purpose, which is a Metadata subclass that holds an ID and points at its single user. DistinctMDOperandPlaceholder::replaceUseWith is just like RAUW, but its name highlights that there is only ever exactly one use. There is no support for moving (or, obviously, copying) these. Move support would be possible but expensive; leaving it unimplemented prevents user error. In the BitcodeReader I originally considered allocating on a BumpPtrAllocator and keeping a vector of pointers to them, and then I realized that std::deque implements exactly this. A couple of obvious follow-ups: - Change ValueEnumerator to emit distinct nodes first to take more advantage of this optimization. (How convenient... I think I might have a couple of patches for this.) - Change DIBuilder and its consumers (like CGDebugInfo in clang) to use something like this when constructing debug info in the first place. llvm-svn: 267270
* Style fix in Core.h / Core.cpp. NFCAmaury Sechet2016-04-231-3/+4
| | | | llvm-svn: 267257
* MachO: remove weird ARM/Thumb interface from MachOObjectFileTim Northover2016-04-222-8/+5
| | | | | | | | | | | | | | | | Only one consumer (llvm-objdump) actually cared about the fact that there were two triples. Others were actively working around the fact that the Triple returned by getArch might have been invalid. As for llvm-objdump, it needs to be acutely aware of both Triples anyway, so being generic in the exposed API is no benefit. Also rename the version of getArch returning a Triple. Users were having to pass an unwanted nullptr to disambiguate the two, which was nasty. The only functional change here is that armv7m and armv7em object files no longer crash llvm-objdump. llvm-svn: 267249
* llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo ↵David Blaikie2016-04-223-10/+12
| | | | | | | | | | | contains a dwo_name attribute The dwo_name was added to dwo files to improve diagnostics in dwp, but it confuses tools that attempt to load any dwo named by a dwo_name, even ones inside dwos. Avoid this by keeping track of whether a unit is already a dwo unit, and if so, not loading further dwos. llvm-svn: 267241
* Fix comment about Intr*Mem propertiesNicolai Haehnle2016-04-221-3/+1
| | | | | | | | | | | | | | | | Summary: Follow up to D19291: it now makes sense to use two Intr*Mem properties, in particular IntrReadMem + IntrArgMemOnly is common. Pointed out by Mikael Holmén. Reviewers: uabelho, joker.eph, reames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19418 llvm-svn: 267238
* Re-commit optimization bisect support (r267022) without new pass manager ↵Andrew Kaylor2016-04-225-10/+111
| | | | | | | | | | support. The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling). Differential Revision: http://reviews.llvm.org/D19172 llvm-svn: 267231
* Introduce llvm.load.relative intrinsic.Peter Collingbourne2016-04-223-0/+9
| | | | | | | | | | | | | | | | | | | This intrinsic takes two arguments, ``%ptr`` and ``%offset``. It loads a 32-bit value from the address ``%ptr + %offset``, adds ``%ptr`` to that value and returns it. The constant folder specifically recognizes the form of this intrinsic and the constant initializers it may load from; if a loaded constant initializer is known to have the form ``i32 trunc(x - %ptr)``, the intrinsic call is folded to ``x``. LLVM provides that the calculation of such a constant initializer will not overflow at link time under the medium code model if ``x`` is an ``unnamed_addr`` function. However, it does not provide this guarantee for a constant initializer folded into a function body. This intrinsic can be used to avoid the possibility of overflows when loading from such a constant. Differential Revision: http://reviews.llvm.org/D18367 llvm-svn: 267223
* DAGCombiner: Relax alignment restriction when changing store typeMatt Arsenault2016-04-221-0/+9
| | | | | | If the target allows the alignment, this should be OK. llvm-svn: 267217
* [PGO] change the interface for createPGOFuncNameMetadata()Rong Xu2016-04-221-1/+1
| | | | | | | | | This patch changes the interface for createPGOFuncNameMetadata() where we add another PGOFuncName argument. Differential Revision: http://reviews.llvm.org/D19433 llvm-svn: 267216
* CodeGen: Use PLT relocations for relative references to unnamed_addr functions.Peter Collingbourne2016-04-223-6/+21
| | | | | | | | | | | | | The relative vtable ABI (PR26723) needs PLT relocations to refer to virtual functions defined in other DSOs. The unnamed_addr attribute means that the function's address is not significant, so we're allowed to substitute it with the address of a PLT entry. Also includes a bonus feature: addends for COFF image-relative references. Differential Revision: http://reviews.llvm.org/D17938 llvm-svn: 267211
* DAGCombiner: Relax alignment restriction when changing load typeMatt Arsenault2016-04-221-2/+15
| | | | | | If the target allows the alignment, this should still be OK. llvm-svn: 267209
* PM: Port SinkingPass to the new pass managerJustin Bogner2016-04-222-1/+31
| | | | llvm-svn: 267199
* PM: Port DCE to the new pass managerJustin Bogner2016-04-222-1/+30
| | | | | | | Also add a very basic test, since apparently there aren't any tests for DCE whatsoever to add the new pass version to. llvm-svn: 267196
* MachineScheduler: Move code to initialize a Candidate out of tryCandidate(); NFCMatthias Braun2016-04-221-3/+5
| | | | llvm-svn: 267191
* [LoopUtils] Extend findStringMetadataForLoop to return the value for metadataAdam Nemet2016-04-221-3/+7
| | | | | | | | | | | | | | | | E.g. for: !1 = {"llvm.distribute", i32 1} it now returns the MDOperand for 1. I will use this in LoopDistribution to check the value of the metadata. Note that the change is backward-compatible with its current use in LoopVersioningLICM. An Optional implicitly converts to a bool depending whether it contains a value or not. llvm-svn: 267190
* PM: Remove some redundant name() methodsJustin Bogner2016-04-223-6/+0
| | | | | | | These passes all get names from PassInfoMixin already, we don't need to override them. llvm-svn: 267172
* [MemorySSA] Fix bug in CachingMemorySSAWalker::invalidateInfoGeoff Berry2016-04-221-0/+1
| | | | | | | | | | | | | | | | | | | | | Summary: CachingMemorySSAWalker::invalidateInfo was using IsCall to determine which cache map needed to be cleared of entries referring to the invalidated MemoryAccess, but there could also be entries referring to it in the other cache map (value entries, not key entries). This change just clears both tables to be conservatively correct. Also add a verifyRemoved() function, called when expensive checks (i.e. XDEBUG) are enabled to verify that the invalidated MemoryAccess object is not referenced in any of the caches. Reviewers: dberlin, george.burgess.iv Subscribers: mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D19388 llvm-svn: 267157
* CodeGen: Add a stand-alone hazard recognizer passTom Stellard2016-04-224-0/+23
| | | | | | | | | | | | | | | | Summary: This new pass allows targets to use the hazard recognizer without having to also run one of the schedulers. This is useful when compiling with optimizations disabled for targets that still need noop hazards to be handled correctly. Reviewers: hfinkel, atrick Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D18594 llvm-svn: 267156
* Revert r267049, r26706[16789], r267071 - Refactor raw pdb dumper into libraryDaniel Sanders2016-04-225-182/+30
| | | | | | r267049 broke multiple buildbots (e.g. clang-cmake-mips, and clang-x86_64-linux-selfhost-modules) which the follow-ups have not yet resolved and this is preventing subsequent committers from being notified about additional failures on the affected buildbots. llvm-svn: 267148
* Revert r267098 - [MachineCombiner] Support for floating-point FMA on ARM64Daniel Sanders2016-04-223-45/+1
| | | | | | It introduced buildbot failures on clang-cmake-mips, clang-ppc64le-linux, among others. llvm-svn: 267127
* Revert "Initial implementation of optimization bisect support."Vedant Kumar2016-04-226-178/+10
| | | | | | | | This reverts commit r267022, due to an ASan failure: http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549 llvm-svn: 267115
* [EarlyCSE] Take the intersection of flags on instructionsDavid Majnemer2016-04-223-31/+31
| | | | | | | | | | | | | EarlyCSE had inconsistent behavior with regards to flag'd instructions: - In some cases, it would pessimize if the available instruction had different flags by not performing CSE. - In other cases, it would miscompile if it replaced an instruction which had no flags with an instruction which has flags. Fix this by being more consistent with our flag handling by utilizing andIRFlags. llvm-svn: 267111
* [SCEV] Extract out a `isSCEVExprNeverPoison` helper; NFCISanjoy Das2016-04-221-0/+18
| | | | | | | | | | | | | | Summary: Also adds a small comment blurb on control flow + no-wrap flags, since that question came up a few days back on llvm-dev. Reviewers: bjarke.roune, broune Subscribers: sanjoy, mcrosier, llvm-commits, mzolotukhin Differential Revision: http://reviews.llvm.org/D19209 llvm-svn: 267110
* Clean the API for CollectAsmUndefinedRefs, taking a Triple and a String ↵Mehdi Amini2016-04-221-1/+2
| | | | | | | InlineAsm instead of a Module (NFC) From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267106
* Refactor IRObjectFile, extract a static CollectAsmUndefinedRefs() method to ↵Mehdi Amini2016-04-221-0/+10
| | | | | | | | | parse inline assembly (NFC) I plan to call this from ThinLTOCodeGenerator. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 267103
* AMDGPU/SI: add llvm.amdgcn.ps.live intrinsicNicolai Haehnle2016-04-222-0/+11
| | | | | | | | | | | | | | | | | | | | | | | Summary: This intrinsic returns true if the current thread belongs to a live pixel and false if it belongs to a pixel that we are executing only for derivative computation. It will be used by Mesa to implement gl_HelperInvocation. Note that for pixels that are killed during the shader, this implementation also returns true, but it doesn't matter because those pixels are always disabled in the EXEC mask. This unearthed a corner case in the instruction verifier, which complained about a v_cndmask 0, 1, exec, exec<imp-use> instruction. That's stupid but correct code, so make the verifier accept it as such. Reviewers: arsenm, tstellarAMD Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D19191 llvm-svn: 267102
* [MachineCombiner] Support for floating-point FMA on ARM64Gerolf Hoflehner2016-04-223-1/+45
| | | | | | | | | | | | | | | | Evaluates fmul+fadd -> fmadd combines and similar code sequences in the machine combiner. It adds support for float and double similar to the existing integer implementation. The key features are: - DAGCombiner checks whether it should combine greedily or let the machine combiner do the evaluation. This is only supported on ARM64. - It gives preference to throughput over latency: the heuristic used is to combine always in loops. The targets decides whether the machine combiner should optimize for throughput or latency. - Supports for fmadd, f(n)msub, fmla, fmls patterns - On by default at O3 ffast-math llvm-svn: 267098
* [ThinLTO] Remove unused/incomplete lazy summary reading support (NFC)Teresa Johnson2016-04-222-26/+2
| | | | | | | | | | | | | | This removes the interfaces added (and not yet complete) to support lazy reading of summaries. This support is not expected to be needed since we are moving to a model where the full index is only being traversed in the thin link step, instead of the back ends. (The second part of this that I plan to do next is remove the GlobalValueInfo from the ModuleSummaryIndex - it was mostly needed to support lazy parsing of summaries. The index can instead reference the summary structures directly.) llvm-svn: 267097
* Untabify.NAKAMURA Takumi2016-04-221-1/+1
| | | | llvm-svn: 267096
OpenPOWER on IntegriCloud