Build stability: No recent builds failed.100
Build History
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems
 Identified problems


r302669 (#5822) (May 10, 2017 8:27:23 AM)

  1. [InstCombine] fix typo in test comment; NFC — spatel / ViewSVN
  2. [ELF] - Don't segfault when assigning non-calculatable absolute symbol value.

    This is PR32664.

    Issue was revealed by linux kernel script which was:

    . = (0xffffffff80000000 + ALIGN(0x1000000, 0x200000));
    phys_startup_64 = ABSOLUTE(startup_64 - 0xffffffff80000000);

    .text : AT(ADDR(.text) - 0xffffffff80000000) {
    Where startup_64 is in .head.text.

    At the place of assignment to phys_startup_64 we can not calculate absolute value for startup_64
    because .text section has no VA assigned. Two patches were prepared earlier to address this: D32173 and D32174.

    And in comments for D32173 was suggested not try to support this case, but error out.

    Differential revision: — grimar / ViewSVN
  3. [SystemZ] Add miscellaneous instructions

    This adds a few missing instructions for the assembler and
    disassembler.  Those should be the last missing general-
    purpose (Chapter 7) instructions for the z10 ISA. — uweigand / ViewSVN
  4. [ELF] - Use LLVM_FALLTHROUGH in code.

    When compiling LLD using GCC 7 it reports warnings like:
    "warning: this statement may fall through [-Wimplicit-fallthrough=]"

    LLVM has LLVM_FALLTHROUGH macro which can be used to avoid such warnings.
    Together with D33036 this patch fixes them.

    Differential revision: — grimar / ViewSVN
  5. [SystemZ] Add missing arithmetic instructions

    This adds the remaining general arithmetic instructions
    for assembler / disassembler use.  Most of these are not
    useful for codegen; a few might be, and those are listed
    in the README.txt for future improvements. — uweigand / ViewSVN
  6. [llvm-readobj] Improve errors on invalid binary

    The previous code was discarding the error message from
    createBinary() by calling errorToErrorCode().
    This meant that such error were always reported unhelpfully
    as "Invalid data was encountered while parsing the file".

    Other tools such as llvm-objdump already produce a more
    the error message in this case.

    Differential Revision: — sbc / ViewSVN
  7. [OpenMP] Changes in the plugin interface

    This patch chagnes the plugin interface so that:
    1) future plugins can take advantage of systems with shared CPU/device storage
    2) instead of using base addresses, target regions are launched by providing target addresseds and base offsets explicitly.

    Differential revision: — grokos / ViewSVN
  8. Remove another use of section names. NFC. — rafael / ViewSVN
  9. Don't use section names in getFiller. NFC.

    This is just faster and avoids using names. — rafael / ViewSVN
  10. chang type from 'int' to 'size_t'. This will fix revision number 302652 — mzuckerm / ViewSVN
  11. [InstCombine] add (ashr (shl i32 X, 31), 31), 1 --> and (not X), 1

    This is another step towards favoring 'not' ops over random 'xor' in IR:

    This transformation may have occurred in longer IR sequences using computeKnownBits,
    but that could be much more expensive to calculate.

    As the scalar result shows, we do not currently favor 'not' in all cases. The 'not'
    created by the transform is transformed again (unnecessarily). Vectors don't have
    this problem because vectors are (wrongly) excluded from several other combines. — spatel / ViewSVN
  12. clang-format: refine calculating brace types.

    For C++ code, opening parenthesis following a } indicate a braced init. For JavaScript and other languages, this is an invalid syntactical construct, unless the closing parenthesis belongs to a function - in which situation its a BK_Block.

    This fixes indenting IIFEs following top level functions:

        function foo() {}
        (function() { codeHere(); }());

    clang-format used to collapse these lines together.

    Subscribers: klimek

    Differential Revision: — mprobst / ViewSVN
  13. [Polly][CMake] Fix syntactical errors in the exported config — pfaffe / ViewSVN
  14. Use explicit false instead of casted nullptr. NFC. — serge_sans_paille / ViewSVN
  15. Use clang++-3.5 compatible initializer_list constructor

    Otherwise, a warning is issued. — serge_sans_paille / ViewSVN
  16. Use clang++-3.5 compatible initializer_list constructor

    Otherwise, a warning is issued. — serge_sans_paille / ViewSVN
  17. [Fortran Support] Detect Fortran arrays & metadata from dragonegg output

    Add the ability to tag certain memory accesses as those belonging to
    Fortran arrays. We do this by pattern matching against known patterns
    of Dragonegg's LLVM IR output from Fortran code.

    Fortran arrays have metadata stored with them in a struct. This struct
    is called the "Fortran array descriptor", and a reference to this is
    stored in each MemoryAccess.

    Differential Revision: — bollu / ViewSVN
  18. [LLVM][inline-asm] Altmacro string escape character '!'

    This patch is the fourth patch in a series of reviews for the Altmacro feature.
    This patch introduces a new escape character '!' and it depends on D32701.

    according to
    "single-character string escape
    To include any single character literally in a string (even if the character would otherwise have some special meaning), you can prefix the character with !' (an exclamation mark). For example, you can write <4.3 !> 5.4!!>' to get the literal text `4.3 > 5.4!'. "

    Differential Revision: — mzuckerm / ViewSVN
  19. [DAGCombiner] Dropped explicit (sra 0, x) -> 0 and (sra -1, x) -> 0 folds.

    These are both handled (and tested) by the earlier ComputeNumSignBits == EltSizeInBits fold. — rksimon / ViewSVN
  20. [IfConversion] Add missing check in IfConversion/canFallThroughTo

    When trying to figure out if MBB could fallthrough to ToMBB (possibly by
    falling through a bunch of other MBBs) we didn't actually check if there
    was fallthrough between the last two blocks in the chain.

    Reviewers: kparzysz, iteratee, MatzeB

    Reviewed By: kparzysz, iteratee

    Subscribers: javed.absar, llvm-commits

    Differential Revision: — uabelho / ViewSVN
  21. [SystemZ]  Implement getRepRegClassFor()

    This method must return a valid register class, or the list-ilp isel
    scheduler will crash. For MVT::Untyped nullptr was previously returned, but
    now ADDR128BitRegClass is returned instead. This is needed just as long as
    list-ilp (and probably also list-hybrid) is still there.

    Review: Ulrich Weigand, A Trick — jonpa / ViewSVN
  22. [AMDGPU][MC] Corrected v_madak/madmk to avoid printing "_e32" in disassembler output

    See bug 32927:

    Reviewers: vpykhtin, artem.tamazov, arsenm

    Differential Revision: — dpreobra / ViewSVN
  23. [GlobalISel][X86] Split test file. NFC — ibreger / ViewSVN

r302646 (#5821) (May 10, 2017 6:53:22 AM)

  1. [SystemZ] Add decimal integer instructions

    This adds the set of decimal integer (BCD) instructions for
    assembler / disassembler use. — uweigand / ViewSVN
  2. [SystemZ] Add crypto instructions

    This adds the set of message-security assist instructions for
    assembler / disassembler use. — uweigand / ViewSVN
  3. [SystemZ] Add translate/convert instructions

    This adds the set of character-set translate and convert instructions
    for assembler / disassembler use. — uweigand / ViewSVN
  4. [SystemZ] Add missing memory/string instructions

    This adds a number of missing memory and string instructions
    for assembler / disassembler use. — uweigand / ViewSVN
  5. [SystemZ] Reformat assembler/disassembler tests

    The assembler and disassmebler test cases started out formatted and
    sorted in a particular way, but this got lost over time as patches
    were added.  Reformat them again.  NFC. — uweigand / ViewSVN
  6. [DAGCombiner] Add vector support to fold (shl/srl 0, x) -> 0 — rksimon / ViewSVN
  7. Revert r301950: SpeculativeExecution: Stop using whitelist for costs

    This pass doesn't correctly handle testing for when it is legal to hoist
    arbitrary instructions. The whitelist happens to make it safe, so before
    it is removed the pass's legality checks will need to be enhanced.

    Details have been added to the code review thread for the patch. — chandlerc / ViewSVN
  8. [msan] Fix getmntent{_r} for empty /etc/fstab

    Some configuration (for instance default docker ubuntu images) uses
    a default empty and invalid /etc/fstab configuration file.  It makes
    any call to getmntent return NULL and it leads to failures on

    This patch fixes it by creating a temporary file with some valid
    entries (although not valid for the system) to use along with
    setmntent/getmntent. — azanella / ViewSVN
  9. [GPUJIT] Disabled gcc's -Wpedantic for use of dlsym

    GCC's ISO C standard does not strictly define the bahavior of converting
    a `void*` pointer to a function pointer, but dlsym's POSIX standard

    The retrieval of function pointers through dlsym in this case
    generates an unnecessary amount of warnings for every API function
    assignment, bloating the output.

    This patch removes GCC's `-Wpedantic` flag for retrieval and assignment
    of these functions. This simplifies debugging the output of GPUJIT.

    Differential Revision: — bollu / ViewSVN
  10. [clang-tidy] Add new cert-dcl21-cpp check

    This check flags postfix operator++/-- declarations,
    where the return type is not a const object.

    Differential Revision: — xazax / ViewSVN
  11. [Polly] Canonicalize arrays according to base-ptr equivalence class

        In case two arrays share base pointers in the same invariant load equivalence
        class, we canonicalize all memory accesses to the first of these arrays
        (according to their order in the equivalence class).

        This enables us to optimize kernels such as boost::ublas by ensuring that
        different references to the C array are interpreted as accesses to the same
        array. Before this change the runtime alias check for ublas would fail, as it
        would assume models of the C array with differing (but identically valued) base
        pointers would reference distinct regions of memory whereas the referenced
        memory regions were indeed identical.

        As part of this change we remove most of the MemoryAccess::get*BaseAddr
        interface. We removed already all references to get*BaseAddr in previous
        commits to ensure that no code relies on matching base pointers between
        memory accesses and scop arrays -- except for three remaining uses where we
        need the original base pointer. We document for these situations that
        MemoryAccess::getOriginalBaseAddr may return a base pointer that is distinct
        to the base pointer of the scop array referenced by this memory access.

    Reviewers: sebpop, Meinersbur, zinob, gareevroman, pollydev, huihuiz, efriedma, jdoerfert

    Reviewed By: Meinersbur

    Subscribers: etherzhhb

    Tags: #polly

    Differential Revision: — grosser / ViewSVN
  12. [mips] XFAIL test

    XFAIL this test while we investigate the root cause. — sdardis / ViewSVN

r302634 (#5820) (May 10, 2017 5:20:59 AM)

  1. [AArch64] Fix a comment to match the code. NFC.

    For the ELF case, the default/preferred form is the generic one, not
    the short one as used for Apple - fix the comment to say so. Currently
    it is a copy-paste typo.

    Make the comments on the darwin default a bit more verbose.

    Use enum names instead of literal 0/1 to further increase readability
    and reduce fragility.

    Differential Revision: — mstorsjo / ViewSVN
  2. [OpenCL] Handle OpenCL specific subelement types

    Reviewers: Anastasia, cfe-commits

    Reviewed By: Anastasia

    Subscribers: bader, yaxunl

    Differential Revision: — echuraev / ViewSVN

r302632 (#5819) (May 10, 2017 4:05:05 AM)

  1. [index] Index simple dependent declaration references

    This commit implements basic support for indexing of dependent declaration
    references. Now the indexer tries to find a suitable match in the base template
    for a dependent member ref/decl ref/dependent type.


    Differential Revision: — arphaman / ViewSVN
  2. Add a late IR expansion pass for the experimental reduction intrinsics.

    This pass uses a new target hook to decide whether or not to expand a particular
    intrinsic to the shuffevector sequence.

    Differential Revision: — aemerson / ViewSVN

r302630 (#5818) (May 10, 2017 2:43:25 AM)

  1. [OpenCL] Added checking OpenCL version for cl_khr_mipmap_image built-ins

    Reviewers: Anastasia, cfe-commits

    Reviewed By: Anastasia

    Subscribers: bader, yaxunl

    Differential Revision: — echuraev / ViewSVN
  2. Fix use of removed SH test replacement %exec — ericwf / ViewSVN
  3. [Safestack] Fix the canary test to catch the libc's message regarding stack smashing

    By default glibc writes its diagnostics directly to tty so the `2>&1 |`
    redirection in the test doesn't catch the *** stack smashing detected ***
    message, which in turn breaks printing the lit's progress bar. By defining
    the LIBC_FATAL_STDERR_ environment variable we force glibc to direct
    diagnostic messages to stderr.

    Differential Revision: — kosarev / ViewSVN
  4. Attempt to speculatively unbreak Apple build bots — ericwf / ViewSVN
  5. [APInt] Fix indentation of tcDivide. Combine variable declaration and initialization. — ctopper / ViewSVN
  6. [APInt] Use getNumWords function in udiv/urem/udivrem instead of reimplementinging it. — ctopper / ViewSVN
  7. Add ASTMatchRefactorer and ReplaceNodeWithTemplate to RefactoringCallbacks

    Summary: This is the first change as part of developing a clang-query based search and replace tool.

    Reviewers: klimek, bkramer, ioeric, sbenza, jbangert

    Reviewed By: ioeric, jbangert

    Subscribers: sbenza, ioeric, cfe-commits

    Patch by Julian Bangert!

    Differential Revision: — ioeric / ViewSVN

r302623 (#5817) (May 10, 2017 1:23:27 AM)

  1. [GlobalISel][X86] G_ZEXT i1 to i32/i64 support.

    Summary: Support G_ZEXT i1 to i32/i64 instruction selection.

    Reviewers: zvi, guyblank

    Reviewed By: guyblank

    Subscribers: rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN

r302622 (#5816) (May 10, 2017 12:27:33 AM)

  1. [UnreachableBlockElim] Check return value of constrainRegClass().

    MachineRegisterInfo::constrainRegClass() can fail if two register classes
    don't have a common subclass or if the register class doesn't contain
    enough registers. Check the return value before trying to remove Phi nodes,
    and if we can't constrain, we output a COPY instead of simply replacing

    Reviewers: kparzysz, david2050, wmi

    Reviewed By: kparzysz

    Subscribers: llvm-commits

    Differential Revision: — uabelho / ViewSVN

r302621 (#5815) (May 9, 2017 11:31:20 PM)

  1. Add noreturn attribute to avoid warnings about missing initialization

    Before this change we saw warnings such as:

      warning: variable 'DevPtr' is used uninitialized whenever switch default is
      taken [-Wsometimes-uninitialized]
        default: — grosser / ViewSVN

r302620 (#5814) (May 9, 2017 10:34:41 PM)

  1. Fix formatting in Polly — grosser / ViewSVN

r302619 (#5813) (May 9, 2017 9:07:19 PM)

  1. Rename Appveyor install helper script.

    I'm really lazy and the old name for the helper script
    killed 2 letter tab completion for the include directory.
    This patch renames it to avoid that problem and enable
    lazyness. — ericwf / ViewSVN
  2. Update Polly for LLVM API change r302571 that removed varargs functions
    with a nullptr sentinel in favor of nicely typed variadic templates. — chandlerc / ViewSVN
  3. Support using MinGW POSIX threads on Windows — ericwf / ViewSVN
  4. attempt to fix appveyor syntax error — ericwf / ViewSVN
  5. When we see a '<' operator, check whether it's a probable typo for a template-id.

    The heuristic that we use here is:
    * the left-hand side must be a simple identifier or a class member access
    * the right-hand side must be '<' followed by either a '>' or by a type-id that
       cannot be an expression (in particular, not followed by '(' or '{')
    * there is a '>' token matching the '<' token

    The second condition guarantees the expression would otherwise be ill-formed.

    If we're confident that the user intended the name before the '<' to be
    interpreted as a template, diagnose the fact that we didn't interpret it
    that way, rather than diagnosing that the template arguments are not valid
    expressions. — rsmith / ViewSVN
  6. Add MinGW64 builder to Appveyor.

    With the amount of work happening on Windows we should
    have a MinGW bot to make sure we don't regress that functionality.
    Currently it doesn't build :-( — ericwf / ViewSVN

r302613 (#5812) (May 9, 2017 7:38:40 PM)

  1. [Core] Make parallel algorithms match C++ Parallelism TS.

    Differential Revision: — zturner / ViewSVN
  2. [CodeGen] Don't require AA in TwoAddress at -O0.

    This is a follow-up to r302611, which moved an -O0 computation of DT
    from SDAGISel to TwoAddress.

    Don't use it here either, and avoid computing it completely.  The only
    use was forwarding the analysis as an optional argument to utility

    Differential Revision: — Ahmed Bougacha / ViewSVN
  3. [CodeGen] Don't require AA in SDAGISel at -O0.

    Before r247167, the pass manager builder controlled which AA
    implementations were used, exporting them all in the AliasAnalysis
    analysis group.

    Now, AAResultsWrapperPass always uses BasicAA, but still uses other AA
    implementations if made available in the pass pipeline.

    But regardless, SDAGISel is required at O0, and really doesn't need to
    be doing fancy optimizations based on useful AA results.

    Don't require AA at CodeGenOpt::None, and only use it otherwise.

    This does have a functional impact (and one testcase is pessimized
    because we can't reuse a load).  But I think that's desirable no matter

    Note that this alone doesn't result in less DT computations: TwoAddress
    was previously able to reuse the DT we computed for SDAG.  That will be
    fixed separately.

    Differential Revision: — Ahmed Bougacha / ViewSVN
  4. [CodeGen] Compute DT/LI lazily in SafeStackLegacyPass. NFC.

    We currently require SCEV, which requires DT/LI.  Those are expensive to
    compute, but the pass only runs for functions that have the safestack

    Compute DT/LI to build SCEV lazily, only when the pass is actually going
    to transform the function.

    Differential Revision: — Ahmed Bougacha / ViewSVN
  5. [CodeGen] Split SafeStack into a LegacyPass and a utility. NFC.

    This lets the pass focus on gathering the required analyzes, and the
    utility class focus on the transformation.

    Differential Revision: — Ahmed Bougacha / ViewSVN
  6. [CodeGen] Add an -O0 backend pipeline test. NFC.

    This should hopefully makes changes to the O0 pipeline obvious; it's
    easy to require expensive passes, and this helps make informed

    Case in point: in the few weeks separating the time when I initially
    wrote this patch to the time when I committed, the test regressed as
    r302103 added another use of DT! — Ahmed Bougacha / ViewSVN
  7. Improve how LIT reports the added environment variables — ericwf / ViewSVN

r302606 (#5811) (May 9, 2017 6:09:53 PM)

  1. [WebAssembly] Fix build error in wasm YAML code

    This warning didn't show up on my local build
    but is causing the bots to fail.  Seems like a
    bad idea to have types and variables with the
    same name anyhow.

    Differential Revision: — sbc / ViewSVN
  2. [InstCombine] add helper function for add X, C folds; NFCI — spatel / ViewSVN
  3. Attempt to unbreak Libc++ test configuration — ericwf / ViewSVN
  4. When instantiating a friend function template, don't forget to inherit default template arguments from other declarations. — rsmith / ViewSVN
  5. Fix test runtime environment on Windows — ericwf / ViewSVN
  6. [WebAssembly] Improve libObject support for wasm imports and exports

    Previously we had only supported the importing and
    exporting of functions and globals.

    Also, add usefull overload of getWasmSymbol() and
    getNumberOfSymbols() in support of lld port.

    Differential Revision: — sbc / ViewSVN
  7. Fix misspelling of environment throughout libc++ — ericwf / ViewSVN
  8. [InstCombine] add tests for andn; NFC — spatel / ViewSVN
  9. [ubsan] Mark overflow checks with !nosanitize

    Sanitizer instrumentation generally needs to be marked with !nosanitize,
    but we're not doing this properly for ubsan's overflow checks.

    r213291 has more information about why this is needed. — Vedant Kumar / ViewSVN
  10. [ProfileSummary] Make getProfileCount a non-static member function.

    This change is required because the notion of count is different for
    sample profiling and getProfileCount will need to determine the
    underlying profile type.

    Differential revision: — eraman / ViewSVN
  11. Don't mark a member as a member specialization until we know we're keeping the specialization.

    This improves our behavior in a few ways:

    * We now guarantee that if a member is marked as being a member
       specialization, there will actually be a member specialization declaration
       somewhere on its redeclaration chain. This fixes a crash in modules builds
       where we would try to check that there was a visible declaration of the
       member specialization and be surprised to not find any declaration of it at

    * We don't set the source location of the in-class declaration of the member
       specialization to the out-of-line declaration's location until we have
       actually finished merging them. This fixes some very silly looking
       diagnostics, where we'd point a "previous declaration is here" note at the
       same declaration we're complaining about. Ideally we wouldn't mess with the
       prior declaration's location at all, but too much code assumes that the
       first declaration of an entity is a reasonable thing to use as an indication
       of where it was declared, and that's not really true for a member
       specialization unless we fake it like this. — rsmith / ViewSVN
  12. FunctionImport: Simplify function llvm::thinLTOInternalizeModule. NFCI. — pcc / ViewSVN

r302594 (#5810) (May 9, 2017 4:40:33 PM)

  1. Fix clang_cl argument in fsanitize.c driver test. — eugenis / ViewSVN
  2. [Sema] Implement Core 2094: Trivial copy/move constructor for class with volatile member

    Summary: This patch implements which reverts Core 496.

    Reviewers: rsmith

    Reviewed By: rsmith

    Subscribers: cfe-commits

    Differential Revision: — ericwf / ViewSVN
  3. Update Clang C++ DR documentation for new issue list — ericwf / ViewSVN
  4. [asan] A clang flag to enable ELF globals-gc.

    This feature is subtly broken when the linker is gold 2.26 or
    earlier. See the following bug for details:

    Since the decision needs to be made at compilation time, we can not
    test the linker version. The flag is off by default on ELF targets,
    and on otherwise. — eugenis / ViewSVN
  5. Remove unnecessary calls to MakeArgString. — eugenis / ViewSVN
  6. [ExecutionEngine] Make RuntimeDyld::MemoryManager responsible for tracking EH

    RuntimeDyld was previously responsible for tracking allocated EH frames, but it
    makes more sense to have the RuntimeDyld::MemoryManager track them (since the
    frames are allocated through the memory manager, and written to memory owned by
    the memory manager). This patch moves the frame tracking into
    RTDyldMemoryManager, and changes the deregisterFrames method on
    RuntimeDyld::MemoryManager from:

    void deregisterEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size);


    void deregisterEHFrames();

    Separating this responsibility will allow ORC to continue to throw the
    RuntimeDyld instances away post-link (saving a few dozen bytes per lazy
    function) while properly deregistering frames when modules are unloaded.

    This patch also updates ORC to call deregisterEHFrames when modules are
    unloaded. This fixes a bug where an exception that tears down the JIT can then
    unwind through dangling EH frames that have been deallocated but not
    deregistered, resulting in UB.

    For people using SectionMemoryManager this should be pretty much a no-op. For
    people with custom allocators that override registerEHFrames/deregisterEHFrames,
    you will now be responsible for tracking allocated EH frames.

    Reviewed in — Lang Hames / ViewSVN
  7. Fix CGObjCGNU::init bug introduced by r302572 — serge_sans_paille / ViewSVN
  8. [GVN] Fix a crash on encountering non-integral pointers

    This fixes the immediate crash caused by introducing an incorrect inttoptr
    before attempting the conversion. There may still be a legality
    check missing somewhere earlier for non-integral pointers, but this change
    seems necessary in any case.

    Reviewers: sanjoy, dberlin

    Reviewed By: dberlin

    Subscribers: llvm-commits

    Differential Revision: — kfischer / ViewSVN
  9. [AMDGPU] Fixed typo in GCNRegPressure, NFC

    VGRP -> VGPR, SGRP -> SGPR — rampitec / ViewSVN
  10. [InstCombine] update test file to use FileCheck; NFC — spatel / ViewSVN

r302584 (#5809) (May 9, 2017 3:03:38 PM)

  1. Import sys in

    The find function in calls sys.exit on error. Without this import that
    call to exit will fail, masking the actual error message. This patch fixes that. — Lang Hames / ViewSVN
  2. DAGCombine: Combine shuffles of splat-shuffles

    Summary: Reapply r299047, but this time handle correctly splat-masks with undef elements.

    Reviewers: spatel, RKSimon, eli.friedman, andreadb

    Reviewed By: spatel

    Subscribers: llvm-commits

    Differential Revision: — zvi / ViewSVN
  3. [AArch64] Consider widening instructions in cost calculations

    The AArch64 instruction set has a few "widening" instructions (e.g., uaddl,
    saddl, uaddw, etc.) that take one or more doubleword operands and produce
    quadword results. The operands are automatically sign- or zero-extended as
    appropriate. However, in LLVM IR, these extends are explicit. This patch
    updates TTI to consider these widening instructions as single operations whose
    cost is attached to the arithmetic instruction. It marks extends that are part
    of a widening operation "free" and applies a sub-target specified overhead
    (zero by default) to the arithmetic instructions.

    Differential Revision: — mssimpso / ViewSVN
  4. [InstCombine] clean up matchDeMorgansLaws(); NFCI

    The motivation for getting rid of dyn_castNotVal is to allow fixing:

    So this was supposed to be functional-change-intended for the case
    of inverting constants and applying DeMorgan. However, I can't find
    any cases where that pattern will actually get to matchDeMorgansLaws()
    because we have other folds in visitAnd/visitOr that do the same
    thing. So this ends up just being a clean-up patch with slight efficiency
    improvement, but no-functional-change-intended. — spatel / ViewSVN
  5. clang-format: [JS] Don't indent JavaScript IIFEs.

    Because IIFEs[1] are often used like an anonymous namespace around large
    sections of JavaScript code, it's useful not to indent to them (which
    effectively reduces the column limit by the indent amount needlessly).

    It's also common for developers to wrap these around entire files or
    libraries. When adopting clang-format, changing the indent entire file
    can reduce the usefulness of the blame annotations.

    Patch by danbeam, thanks!

    Differential Revision: — mprobst / ViewSVN
  6. [NewGVN] Simplify a DEBUG() statement. NFCI. — davide / ViewSVN

r302578 (#5808) (May 9, 2017 1:52:03 PM)

  1. [codeview] Check for a DIExpression offset for local variables

    Fixes inalloca parameters, which previously all pointed to the same
    offset. Extend the test to use llvm-readobj so that we can test the
    offset in a readable way. — rnk / ViewSVN
  2. Update testcase for upstream LLVM changes (r302469). — Adrian Prantl / ViewSVN
  3. Make it illegal for two Functions to point to the same DISubprogram

    As recently discussed on llvm-dev [1], this patch makes it illegal for
    two Functions to point to the same DISubprogram and updates
    FunctionCloner to also clone the debug info of a function to conform
    to the new requirement. To simplify the implementation it also factors
    out the creation of inlineAt locations from the Inliner into a
    general-purpose utility in DILocation.


    Differential Revision:

    This reapplies r302469 with a fix for a bot failure (reparentDebugInfo
    now checks for the case the orig and new function are identical). — Adrian Prantl / ViewSVN
  4. NFC: refactor replaceDominatedUsesWith

    Since I will post patch with some changes to
    replaceDominatedUsesWith, it would be good to avoid
    duplicating code again.

    Reviewers: davide, dberlin

    Subscribers: llvm-commits

    Differential Revision: — prazek / ViewSVN
  5. [DWARF] Fix a parsing issue with type unit headers.

    Reviewers: dblaikie

    Differential Revision: — wolfgangp / ViewSVN
  6. Fix the Endianness bug by adding the little endian UTF marker.

    Summary: Quick fix

    Reviewers: zturner, uweigand

    Subscribers: llvm-commits

    Differential Revision: — ecbeckmann / ViewSVN
  7. Suppress all uses of LLVM_END_WITH_NULL. NFC.

    Use variadic templates instead of relying on <cstdarg> + sentinel.

    This enforces better type checking and makes code more readable.

    Differential revision: — serge_sans_paille / ViewSVN
  8. Suppress all uses of LLVM_END_WITH_NULL. NFC.

    Use variadic templates instead of relying on <cstdarg> + sentinel.
    This enforces better type checking and makes code more readable.

    Differential Revision: — serge_sans_paille / ViewSVN
  9. [mips] XFAIL dfsan's test on mips64.

    Test was already marked as failing for mips64el. Now that it's being
    tested on mips64, it has to be XFAILed there as well. — sdardis / ViewSVN

r302569 (#5807) (May 9, 2017 12:56:04 PM)

  1. [WebAssembly] Fix failing wasm-toolchain test

    This test was broken in r302558.

    Differential Revision: — sbc / ViewSVN
  2. [lanai] Add computeKnownBitsForTargetNode for Lanai.

    Summary: computeKnownBitsForTargetNode was not defined for Lanai which resulted in additional AND's with 0x1 for the output of SETCC instructions.

    Reviewers: eliben, majnemer

    Reviewed By: majnemer

    Subscribers: llvm-commits

    Differential Revision: — jpienaar / ViewSVN
  3. [mips] Remove XFAIL from

    Test is XPASSing, so remove the XFAIL marker. — sdardis / ViewSVN
  4. [NewGVN] Explain why sorting by pointer values doesn't introduce non-determinism.

    Thanks to Eli for pointing out in a post-commit review comment. — davide / ViewSVN
  5. [SystemZ] Support missing relocation types in RuntimeDyldELF

    Handle some more relocation types in

    This fixes a number of failing LLDB test cases. — uweigand / ViewSVN
  6. Add memory ORIGIN and LENGTH expression support

    Adds support for the ORIGIN and LENGTH linker script built in functions.

      ORIGIN(memory) Return the origin of the memory region
      LENGTH(memory) Return the length of the memory region

    Redo of D29775 for refactored linker script parsing.

    Patch by Robert Clarke

    Differential Revision: — ruiu / ViewSVN
  7. [SystemZ] Remove XFAIL on

    This test case works fine on SystemZ as well. — uweigand / ViewSVN
  8. [SystemZ] Fix failures after D32542

    This commit made ubsan use the fast unwinder.  On SystemZ this requires
    test cases to be compiled with -mbackchain.  That was already done for
    asan, but not ubsan.  Add the flag for ubsan as well. — uweigand / ViewSVN
  9. [compiler-rt][mips] Fix a test for mips.

    GCC 4.9.2 likes the specialize one of the memcpys in,
    leading to test failure. — sdardis / ViewSVN
  10. [WebAssembly] Fix validation of start function

    The check for valid start function was inverted.  Added a new
    test in test/Object to check this case and fixed the existing
    tests in for ObjectYAML.

    Differential Revision: — sbc / ViewSVN
  11. [X86][LWP] Remove MSVC LWP intrinsics stubs.

    Now provided in lwpintrin.h — rksimon / ViewSVN
  12. [WebAssembly] Fix location and -flavor when running lld

    Add the toolchain installation directory to the program
    path so that lld can be found.

    Change -flavor to wasm.  Although this new flavor hasn't
    yet landed in upstream lld yet there are no point in
    passing wasm objects the gnu flavor.

    Differential Revision: — sbc / ViewSVN
  13. [X86][LWP] Removing LWP todo comment. NFCI.

    LWP / lwpintrin.h is now supported — rksimon / ViewSVN
  14. Build the Apple-style stage2 with modules

    Green dragon had a green stage2 modules bot for a long time now[1] and
    it is time to retire it and make a modules build the default for
    Apple-style stage2 builds.

    This patch turns on LLVM_ENABLE_MODULES.


    Differential Revision: — Adrian Prantl / ViewSVN

r302555 (#5806) (May 9, 2017 11:27:25 AM)

  1. Revert r302547 ([mips] Impose a threshold for coercion of aggregates)

      Modified MipsABIInfo::classifyArgumentType so that it now coerces
      aggregate structures only if the size of said aggregate is less than 16/64
      bytes, depending on the ABI.
    as it broke clang-with-lto-ubuntu builder. — petarj / ViewSVN
  2. [RegScavenger] Rangify a loop, NFC — kparzysz / ViewSVN
  3. Adding VSCode syntax colorizer to utils (generated from textmate colorizer).
    --This line, and those below, will be igored--

    A    utils/vscode
    A    utils/vscode/README
    A    utils/vscode/tablegen
    A    utils/vscode/tablegen/.vscode
    A    utils/vscode/tablegen/.vscode/launch.json
    A    utils/vscode/tablegen/
    A    utils/vscode/tablegen/
    A    utils/vscode/tablegen/language-configuration.json
    A    utils/vscode/tablegen/package.json
    A    utils/vscode/tablegen/syntaxes
    A    utils/vscode/tablegen/syntaxes/TableGen.tmLanguage
    A    utils/vscode/tablegen/ — zer0 / ViewSVN
  4. [NewGVN] Fix a consistent order for phi nodes operands.

    The way we currently define congruency for two PHIExpression(s) is:

    1) The operands to the phi functions are congruent
    2) The PHIs are defined in the same BasicBlock.

    NewGVN works under the assumption that phi operands are in predecessor
    order, or at least in some consistent order. OTOH, is valid IR:

      %meh = phi i16 [ %0, %winky ], [ %conv1, %tinky ]
      %banana = phi i16 [ %0, %tinky ], [ %conv1, %winky ]
      br label %end

    and the in-memory representations of the two SSA registers have an
    inconsistent order. This violation of NewGVN assumptions results into
    two PHIs found congruent when they're not. While we think it's useful
    to have always a consistent order enforced, let's fix this in NewGVN
    sorting uses in predecessor order before creating a PHI expression.

    Differential Revision: — davide / ViewSVN
  5. [APInt] Remove return value from tcFullMultiply.

    The description says it returns the number of words needed to represent the results. But the way it was coded it always returns (lhsWords + rhsWords) or (lhsWords + rhsWords - 1). But the result could be even smaller than that and it wouldn't tell you.

    No one uses the result today so rather than try to fix it, just remove it. — ctopper / ViewSVN
  6. NewGVN: Make all of symbolic evaluation logically const. — dannyb / ViewSVN
  7. [X86] Add more patterns for BZHI isel

    This patch adds more patterns that a reasonable person might write that can be compiled to BZHI.

    This adds support for

    (~0U >> (32 - b)) & a;


    a << (32 - b) >> (32 - b);

    This was inspired by the code in APInt::clearUnusedBits.

    This can pass an index of 32 to the bzhi instruction which a quick test of Haswell hardware shows will not mask any bits. Though the description text in the Intel manual says the "index is saturated to OperandSize-1". The pseudocode in the same manual indicates no bits will be zeroed for this case.

    I think this is still missing cases where the subtract portion is an 8-bit operation.

    Differential Revision: — ctopper / ViewSVN
  8. [InstCombineCasts] Fix checks in sext->lshr->trunc pattern.

    The comment says to avoid the case where zero bits are shifted into the truncated value,
    but the code checks that the shift is smaller than the truncated value instead of the
    number of bits added by the sign extension. Fixing this allows a shift by more than the
    value size to be introduced, which is undefined behavior, so the shift is capped at the
    value size minus one, which has the expected behavior of filling the value with the sign

    Patch by Jacob Young!

    Differential Revision: — spatel / ViewSVN
  9. [mips] Impose a threshold for coercion of aggregates

    Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate
    structures only if the size of said aggregate is less than 16/64 bytes,
    depending on the ABI.

    Patch by Stefan Maksimovic.

    Differential Revision: — petarj / ViewSVN
  10. VX512] Only look at lower bit in constant scalar masks

    for scalar masked instructions only the lower bit of the mask is relevant. so for constant masks we should either do an unmasked operation or no operation, depending on the value of the lower bit.
    This patch handles cases where the lower bit is '1'.

    Differential Revision: — guyblank / ViewSVN
  11. [CodeCompletion] Complete platform names in @available expressions

    rdar://32074504 — arphaman / ViewSVN
  12. Re-land "Use the frame index side table for byval and inalloca arguments"

    This re-lands r302483. It was not the cause of PR32977. — rnk / ViewSVN
  13. Re-land "Don't add DBG_VALUE instructions for static allocas in dbg.declare"

    This re-lands commit r302461. It was not the cause of PR32977. — rnk / ViewSVN
  14. Revert r302476 "Update testcase for upstream LLVM changes."

    That test update was for r302469, which was reverted in r302533 due to PR32977. — hans / ViewSVN
  15. Allow compiler-rt to find lld and libc++ parallel to LLVM, as in the monorepo — rnk / ViewSVN

r302540 (#5805) (May 9, 2017 9:58:21 AM)

  1. Add support for pretty platform names to `@available`/

    This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in


    Differential Revision: — arphaman / ViewSVN
  2. [Atomic] Remove IsStore/IsLoad in the interface, and pass the instruction instead. NFC.

    Now both emitLeadingFence and emitTrailingFence take the instruction
    itself, instead of taking IsLoad/IsStore pairs.
    Instruction::mayReadFromMemory and Instrucion::mayWriteToMemory are used
    for determining those two booleans.

    The instruction argument is also useful for later D32763, in
    emitTrailingFence. For emitLeadingFence, it seems to have cleaner
    interface with the proposed change.

    Differential Revision: — timshen / ViewSVN
  3. [scudo] CRC32 optimizations

    This change optimizes several aspects of the checksum used for chunk headers.

    First, there is no point in checking the weak symbol `computeHardwareCRC32`
    everytime, it will either be there or not when we start, so check it once
    during initialization and set the checksum type accordingly.

    Then, the loading of `HashAlgorithm` for SSE versions (and ARM equivalent) was
    not optimized out, while not necessary. So I reshuffled that part of the code,
    which duplicates a tiny bit of code, but ends up in a much cleaner assembly
    (and faster as we avoid an extraneous load and some calls).

    The following code is the checksum at the end of `scudoMalloc` for x86_64 with
    full SSE 4.2, before:
    mov     rax, 0FFFFFFFFFFFFFFh
    shl     r10, 38h
    mov     edi, dword ptr cs:_ZN7__scudoL6CookieE ; __scudo::Cookie
    and     r14, rax
    lea     rsi, [r13-10h]
    movzx   eax, cs:_ZN7__scudoL13HashAlgorithmE ; __scudo::HashAlgorithm
    or      r14, r10
    mov     rbx, r14
    xor     bx, bx
    call    _ZN7__scudo20computeHardwareCRC32Ejm ; __scudo::computeHardwareCRC32(uint,ulong)
    mov     rsi, rbx
    mov     edi, eax
    call    _ZN7__scudo20computeHardwareCRC32Ejm ; __scudo::computeHardwareCRC32(uint,ulong)
    mov     r14w, ax
    mov     rax, r13
    mov     [r13-10h], r14
    mov     rax, cs:_ZN7__scudoL6CookieE ; __scudo::Cookie
    lea     rcx, [rbx-10h]
    mov     rdx, 0FFFFFFFFFFFFFFh
    and     r14, rdx
    shl     r9, 38h
    or      r14, r9
    crc32   eax, rcx
    mov     rdx, r14
    xor     dx, dx
    mov     eax, eax
    crc32   eax, rdx
    mov     r14w, ax
    mov     rax, rbx
    mov     [rbx-10h], r14

    Reviewers: dvyukov, alekseyshl, kcc

    Reviewed By: alekseyshl

    Subscribers: aemerson, rengolin, llvm-commits

    Differential Revision: — cryptoad / ViewSVN
  4. Amend r302535; ifndef and ifdef are different, as it turns out. — aaronballman / ViewSVN
  5. [clang-tidy] Allow disabling compatibility check for generated fixes. — alexfh / ViewSVN
  6. ARMRegisterBankInfo.h requires LLVM_BUILD_GLOBAL_ISEL to be defined. If it is not defined, then is not table generated and the inclusion of this header causes the build to fail. — aaronballman / ViewSVN
  7. Change EOL style to LF. NFC — alexfh / ViewSVN

r302533 (#5804) (May 9, 2017 8:28:06 AM)

  1. Revert r302469 "Make it illegal for two Functions to point to the same DISubprogram"

    This caused PR32977.

    Original commit message:

    > Make it illegal for two Functions to point to the same DISubprogram
    > As recently discussed on llvm-dev [1], this patch makes it illegal for
    > two Functions to point to the same DISubprogram and updates
    > FunctionCloner to also clone the debug info of a function to conform
    > to the new requirement. To simplify the implementation it also factors
    > out the creation of inlineAt locations from the Inliner into a
    > general-purpose utility in DILocation.
    > [1]
    > <rdar://problem/31926379>
    > Differential Revision: — hans / ViewSVN

r302532 (#5803) (May 9, 2017 8:15:31 AM)

  1. [LV] Fix insertion point for shuffle vectors in first order recurrence

    In first order recurrence vectorization, when the previous value is a phi node, we need to
    set the insertion point to the first non-phi node.
    We can have the previous value being a phi node, due to the generation of new
    IVs as part of trunc optimization [1].


    Reviewers: mssimpso, mkuper

    Subscribers: mzolotukhin, llvm-commits

    Differential Revision: — annat / ViewSVN
  2. Removing a file that is not necessary (and was causing link diagnostics with MSVC 2015); NFC. — aaronballman / ViewSVN
  3. Avoid unnecessary calls to vm_region_recurse

    Summary: This should significantly improve darwin lsan performance in cases where root regions are not used.

    Reviewers: alekseyshl, kubamracek

    Subscribers: llvm-commits

    Differential Revision: — fjricci / ViewSVN

r302529 (#5802) (May 9, 2017 7:44:01 AM)

  1. [X86][AVX512] Refine some avx512er intrinsics tests. NFC.

    The modified tests should test the masked intrinsics.
    Currently the mask is constant, which with a future patch ( will cause the intrinsics to be replaced with an unmasked version.
    This patch changes the constant mask to be a variable one. — guyblank / ViewSVN
  2. Use a simpler heuristic for placing orphans.

    This is a bit easier to read and a lot faster in some cases. A version
    of many-sections.s with linker scripts goes from 0m41.232s to
    0m19.575s. — rafael / ViewSVN

r302527 (#5801) (May 9, 2017 7:14:41 AM)

  1. Add extra operand to CALLSEQ_START to keep frame part set up previously

    Using arguments with attribute inalloca creates problems for verification
    of machine representation. This attribute instructs the backend that the
    argument is prepared in stack prior to  CALLSEQ_START..CALLSEQ_END
    sequence (see for details). Frame size
    stored in CALLSEQ_START in this case does not count the size of this
    argument. However CALLSEQ_END still keeps total frame size, as caller can
    be responsible for cleanup of entire frame. So CALLSEQ_START and
    CALLSEQ_END keep different frame size and the difference is treated by
    MachineVerifier as stack error. Currently there is no way to distinguish
    this case from actual errors.

    This patch adds additional argument to CALLSEQ_START and its
    target-specific counterparts to keep size of stack that is set up prior to
    the call frame sequence. This argument allows MachineVerifier to calculate
    actual frame size associated with frame setup instruction and correctly
    process the case of inalloca arguments.

    The changes made by the patch are:
    - Frame setup instructions get the second mandatory argument. It
      affects all targets that use frame pseudo instructions and touched many
      files although the changes are uniform.
    - Access to frame properties are implemented using special instructions
      rather than calls getOperand(N).getImm(). For X86 and ARM such
      replacement was made previously.
    - Changes that reflect appearance of additional argument of frame setup
      instruction. These involve proper instruction initialization and
      methods that access instruction arguments.
    - MachineVerifier retrieves frame size using method, which reports sum of
      frame parts initialized inside frame instruction pair and outside it.

    The patch implements approach proposed by Quentin Colombet in
    It fixes 9 tests failed with machine verifier enabled and listed
    in PR27481.

    Differential Revision: — sepavloff / ViewSVN

r302526 (#5800) (May 9, 2017 6:59:51 AM)

  1. Revert "[MIPS] Add support to match more patterns for DINS instruction"

    This reverts commit rL302512. This broke the mips buildbots. — sdardis / ViewSVN
  2. [X86][SSE42] Lower v2i64/v4i64 ASHR(X, 63) as PCMPGTQ(0, X)

    Similar to what we do for vXi8 ASHR(X, 7), use SSE42's PCMPGTQ to splat the sign instead of using the PSRAD+PSHUFD.

    Avoiding bitcasts this improves combines that utilize computeNumSignBits, permits memory folding and reduces pipe pressure. Although it does require a second register, given that this is a (cheap) zero register the impact is minimal.

    Differential Revision: — rksimon / ViewSVN
  3. Revert "[Dwarf] Disable reference verification for now (PR32972)"

    This reverts commit r302520 because it break the unit tests. — rovka / ViewSVN

r302523 (#5799) (May 9, 2017 6:25:45 AM)

  1. clang-format: [JS] keep triple slash directives intact.

    TypeScript uses triple slash directives of the form:
        /// <reference path="..."/>

    For various non-source instructions that should not be wrapped.


    Reviewers: djasper

    Subscribers: cfe-commits, klimek

    Differential Revision: — mprobst / ViewSVN

r302522 (#5798) (May 9, 2017 6:19:37 AM)

  1. [clang-tidy] Minor cleanup + a disabled test case for PR26228. NFC — alexfh / ViewSVN
  2. PR5935: Adjust documentation.

    Patch by Johannes Altmanninger! — vvassilev / ViewSVN

r302520 (#5797) (May 9, 2017 6:15:45 AM)

  1. [Dwarf] Disable reference verification for now (PR32972)

    There is no other explanation about why this only started happening
    now, even though it crashes on old code (supposedly reachable from

    The only common factor between the failing bots is that they use GCC
    (4.9 and 5.3) to compile Clang, while the others use Clang 3.8, but the
    failure is while building the tests, as an assertion, on Clang.

    Commenting it out for now in hope the bots will go back green, but we
    should keep looking for the real cause, and update bugzilla. — rengolin / ViewSVN
  2. [X86][AVX512] Add test for masking of scalar instructions. — guyblank / ViewSVN

r302518 (#5796) (May 9, 2017 5:21:44 AM)

  1. Reland "Warn about unused static file scope function template declarations."

    This patch reinstates r299930, reverted in r299956, as a separate diagnostic
    option (-Wunused-template). — vvassilev / ViewSVN
  2. docs: Fix Sphinx detection with out-of-tree builds

    Adapt to changes made in r302499. — tstellar / ViewSVN

r302516 (#5795) (May 9, 2017 4:49:40 AM)

  1. docs: Fix Sphinx detection with out-of-tree builds

    Adapt to changes made in r302499. — tstellar / ViewSVN

r302515 (#5794) (May 9, 2017 4:29:48 AM)

  1. [Polly][PPCGCodeGen] OpenCL now gets kernel argument size from PPCG CodeGen

    Summary: PPCGCodeGeneration now attaches the size of the kernel launch parameters at the end of the parameter list. For the existing CUDA Runtime, this gets ignored, but the OpenCL Runtime knows to check for kernel-argument size at the end of the parameter list. (The resulting parameters list is twice as long. This has been accounted for in the corresponding test cases).

    Reviewers: grosser, Meinersbur, bollu

    Reviewed By: bollu

    Subscribers: nemanjai, yaxunl, Anastasia, pollydev, llvm-commits

    Tags: #polly

    Differential Revision: — bollu / ViewSVN
  2. Introduce experimental generic intrinsics for horizontal vector reductions.

    - This change allows targets to opt-in to using them instead of the log2
      shufflevector algorithm.
    - The SLP and Loop vectorizers have the common code to do shuffle reductions
      factored out into LoopUtils, and now have a unified interface for generating
      reductions regardless of the preference of the target. LoopUtils now uses TTI
      to determine what kind of reductions the target wants to handle.
    - For CodeGen, basic legalization support is added.

    Differential Revision: — aemerson / ViewSVN

r302513 (#5793) (May 9, 2017 3:54:40 AM)

  1. [X86] Clang option -fuse-init-array has no effect when generating for MCU target

    Reviewers: Eugene.Zelenko, dschuff, craig.topper

    Reviewed By: craig.topper

    Subscribers: ahatanak, aaboud, DavidKreitzer, llvm-commits, cfe-commits

    Differential Revision:
    Patch by AndreiGrischenko <> — n.bozhenov / ViewSVN

r302512 (#5792) (May 9, 2017 3:44:21 AM)

  1. [MIPS] Add support to match more patterns for DINS instruction

    This patch adds support for recognizing patterns to match
    DINS instruction.

    Differential Revision: — spetrovic / ViewSVN

r302511 (#5791) (May 9, 2017 2:14:23 AM)

  1. [ARM GlobalISel] Remove hand-written G_FADD selection

    Remove the code selecting G_FADD - now that TableGen can handle more
    opcodes, it's not needed anymore. — rovka / ViewSVN

r302510 (#5790) (May 9, 2017 12:44:37 AM)

  1. [ConstantRange] Rewrite shl to avoid repeated calls to getUnsignedMax and avoid creating the min APInt until we're sure we need it. Use inplace shift operations. — ctopper / ViewSVN
  2. [ConstantRange] Combine the two adds max+1 in lshr into a single addition. — ctopper / ViewSVN

r302508 (#5789) (May 8, 2017 10:44:42 PM)

  1. [ConstantRange] Use APInt::isNullValue in place of comparing with 0. The compiler should be able to generate slightly better code for the former. NFC — ctopper / ViewSVN

r302507 (#5788) (May 8, 2017 10:00:38 PM)

  1. Fix PR32638 : Make sure we switch Sema's CurContext to the substituted FunctionDecl when instantiating the exception specification.

    This fixes the bug:

      int main()
        [](auto x) noexcept(noexcept(x)) { } (0);

    In the above code, prior to this patch, when substituting into the noexcept expression, i.e. transforming the DeclRefExpr that represents 'x' - clang attempts to capture 'x' because Sema's CurContext is still pointing to the pattern FunctionDecl (i.e. the templated-decl set in FinishTemplateArgumentDeduction) which does not match the substituted 'x's DeclContext, which leads to an attempt to capture and an assertion failure. 

    We fix this by adjusting Sema's CurContext to point to the substituted FunctionDecl under which the noexcept specifier's argument should be transformed, and so the ParmVarDecl that 'x' refers to has the same declcontext and no capture is attempted.

    I briefly investigated whether the SwitchContext should occur right after VisitMethodDecl creates the new substituted FunctionDecl, instead of only during instantiating the exception specification - but seeing no other code that seemed to rely on that, I decided to leave it just for the duration of the exception specification instantiation. — faisalv / ViewSVN

r302506 (#5787) (May 8, 2017 9:44:39 PM)

  1. [Sema] Make typeof(OverloadedFunctionName) not a pointer.

    We were sometimes doing a function->pointer conversion in
    Sema::CheckPlaceholderExpr, which isn't the job of CheckPlaceholderExpr.

    So, when we saw typeof(OverloadedFunctionName), where
    OverloadedFunctionName referenced a name with only one function that
    could have its address taken, we'd give back a function pointer type
    instead of a function type. This is incorrect.

    I kept the logic for doing the function pointer conversion in
    resolveAndFixAddressOfOnlyViableOverloadCandidate because it was more
    consistent with existing ResolveAndFix* methods. — George Burgess IV / ViewSVN

r302505 (#5786) (May 8, 2017 9:05:32 PM)

  1. [ODRHash] Loosen checks on typedefs.

    When a type in a class is from a typedef, only check the canonical type.  Skip
    checking the intermediate underlying types.  This is in response to PR 32965 — rtrieu / ViewSVN

r302504 (#5785) (May 8, 2017 7:59:22 PM)

  1. Revert "Don't add DBG_VALUE instructions for static allocas in dbg.declare"

    This reverts commit r302461.

    It appears to be causing failures compiling gtest with debug info on the
    Linux sanitizer bot. I was unable to reproduce the failure locally,
    however. — rnk / ViewSVN

r302503 (#5784) (May 8, 2017 7:35:44 PM)

  1. [Sema][ObjC] Clean up possible null dereference.

    It appears that the code is actually dead since unbridged-cast
    placeholder types are created by calling CastOperation::complete and
    ImplicitCastExprs are never passed to it.

    Spotted by Vedant Kumar.

    rdar://problem/31542226 — ahatanak / ViewSVN

r302502 (#5783) (May 8, 2017 7:29:04 PM)

  1. Fix code section prefix for proper layout

    r284533 added hot and cold section prefixes based on profile
    information, to enable grouping of hot/cold functions at link time.
    However, it used "cold" as the prefix for cold sections, but gold only
    recognizes "unlikely" (which is used by gcc for cold sections).
    Therefore, cold sections were not properly being grouped. Switch to
    using "unlikely"

    Reviewers: danielcdh, davidxl

    Subscribers: llvm-commits

    Differential Revision: — tejohnson / ViewSVN
  2. docs: Fix Sphinx detection with out-of-tree builds

    Adapt to changes made in r302499. — tstellar / ViewSVN
  3. docs: Fix Sphinx detection with out-of-tree builds

    Adapt to changes made in r302499. — tstellar / ViewSVN
  4. Revert "Revert "CMake: Move sphinx detection into AddSphinxTarget.cmake""

    This reverts commit r302054.

    Re-commit now that I have fixes for clang/lld. — tstellar / ViewSVN

r302498 (#5782) (May 8, 2017 7:15:19 PM)

  1. [libFuzzer] update docs on -print_coverage/-dump_coverage — kcc / ViewSVN
  2. Fix Windows tests when __config_site is present.
    Previously, the force includes would complain about a missing _DEBUG symbol.
    Now we dump macros before adding the force includes to the command line.
    Now with proper newlines. — bcraig / ViewSVN
  3. Revert "Fix Windows tests when __config_site is present."
    It's 2017, and line endings are still an issue. — bcraig / ViewSVN
  4. [CodeGen][ObjC] Emit @objc_retain at -O0 for variables captured by

    r302270 made changes to avoid emitting clang.arc.use at -O0 and instead
    emit @objc_release. We also have to emit @objc_retain for the captured
    variable at -O0 to match the @objc_release instead of just storing the
    pointer to the capture field. — ahatanak / ViewSVN
  5. [libFuzzer] make sure the input data is not overwritten in the fuzz target (if it is -- report an error) — kcc / ViewSVN
  6. Revert "Use the frame index side table for byval and inalloca arguments"

    This reverts r302483 and it's follow up fix. — rnk / ViewSVN

r302492 (#5781) (May 8, 2017 6:31:14 PM)

  1. [XRay] Add __xray_customeevent(...) as a clang-supported builtin

    We define the `__xray_customeevent` builtin that gets translated to
    IR calls to the correct intrinsic. The default implementation of this is
    a no-op function. The codegen side of this follows the following logic:

    - When `-fxray-instrument` is not provided in the driver, we elide all
    calls to `__xray_customevent`.
    - When `-fxray-instrument` is enabled and a function is marked as "never
    instrumented", we elide all calls to `__xray_customevent` in that
    function; if either marked as "always instrumented" or subject to
    threshold-based instrumentation, we emit a call to the
    `llvm.xray.customevent` intrinsic from LLVM for each
    `__xray_customevent` occurrence in the function.

    This change depends on D27503 (to land in LLVM first).

    Reviewers: echristo, rsmith

    Subscribers: mehdi_amini, pelikan, lrl, cfe-commits

    Differential Revision: — dberris / ViewSVN
  2. [Modules] Allow umbrella frameworks to define private submodules for subframeworks

    In r298391 we fixed the umbrella framework model to work when submodules
    named "Private" are used. This complements the work by allowing the
    umbrella framework model to work in general.

    rdar://problem/31790067 — Bruno Lopes / ViewSVN

r302490 (#5780) (May 8, 2017 6:08:12 PM)

  1. Rename a method. NFC. — Vedant Kumar / ViewSVN
  2. XFAIL noexcept member function throw/catch test under GCC.

    I'm still not exactly sure why the test fails, but I suspect it's
    a bug in GCC. More investigation needed. — ericwf / ViewSVN

r302488 (#5779) (May 8, 2017 5:40:41 PM)

  1. Fix GCC 7 test failures.

    This patch fixes the test failures and unexpected passes that occur
    when testing against GCC 7. Specifically:

    * don't mark __gcd as always inline because it's a recursive function. GCC diagnoses this.
    * don't XFAIL the aligned allocation tests. GCC 7 supports them but not the -faligned-allocation option.
    * Work around in variants constructors. — ericwf / ViewSVN

r302487 (#5778) (May 8, 2017 5:30:35 PM)

  1. [APInt] Use default constructor instead of explicitly creating a 1-bit APInt in udiv and urem. NFC

    The default constructor does the same thing. — ctopper / ViewSVN
  2. [APInt] Remove 'else' after 'return' in udiv and urem. NFC — ctopper / ViewSVN

r302485 (#5777) (May 8, 2017 5:24:56 PM)

  1. Ignore !associated metadata with null argument.

    Fixes PR32577 (comment 10).
    Such metadata may legitimately appear in LTO. — eugenis / ViewSVN
  2. Relax Dwarf filecheck test for 32-bit hosts — rnk / ViewSVN
  3. Use the frame index side table for byval and inalloca arguments

    For inalloca functions, this is a very common code pattern:

      %argpack = type <{ i32, i32, i32 }>
      define void @f(%argpack* inalloca %args) {
        %a = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 0
        %b = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 1
        %c = getelementptr inbounds %argpack, %argpack* %args, i32 0, i32 2
        tail call void @llvm.dbg.declare(metadata i32* %a, ... "a")
        tail call void @llvm.dbg.declare(metadata i32* %c, ... "b")
        tail call void @llvm.dbg.declare(metadata i32* %b, ... "c")

    Even though these GEPs can be simplified to a constant offset from EBP
    or RSP, we don't do that at -O0, and each GEP is computed into a
    register. Registers used to compute argument addresses are typically
    spilled and clobbered very quickly after the initial computation, so
    live debug variable tracking loses information very quickly if we use
    DBG_VALUE instructions.

    This change moves processing of dbg.declare between argument lowering
    and basic block isel, so that we can ask if an argument has a frame
    index or not. If the argument lives in a register as is the case for
    byval arguments on some targets, then we don't put it in the side table
    and during ISel we emit DBG_VALUE instructions.

    Reviewers: aprantl

    Subscribers: llvm-commits

    Differential Revision: — rnk / ViewSVN
  4. Add basic test case for -instnamer — sanjoy / ViewSVN
  5. [InstNamer] Use range-for — sanjoy / ViewSVN
  6. [InstNamer] Don't check type of arguments (they're never void) — sanjoy / ViewSVN
  7. Delete trailing whitespace — sanjoy / ViewSVN

r302478 (#5776) (May 8, 2017 4:45:15 PM)

  1. Skip install step if not requested. — gkistanova / ViewSVN
  2. Changed a default source code directory from llvm.src to llvm. — gkistanova / ViewSVN
  3. Update testcase for upstream LLVM changes. — Adrian Prantl / ViewSVN
  4. [InstCombine] add tests from D32285 to show current problems; NFC — spatel / ViewSVN
  5. Refactor <locale> RAII guards to aid upcoming Windows locale changes.

    Previously <locale> used std::unique_ptr<remove_ptr<locale_t>, locale-mgmt-function>
    as a scope guard for (A) creating new locales, and (B) setting the thread specific locale
    in RAII safe manner.

    However using unique_ptr has some problems, first it requires that locale_t is a pointer
    type, which may not be the case (Windows will need a non-pointer locale_t type that emulates _locale_t).

    The second problem is that users of the guards had to supply the locale management function to the custom
    deleter at every call site. However these locale management functions don't exist natively Windows, making
    a good Windows implementation of locale more difficult.

    This patch creates distinct and simply RAII guards that replace unique_ptr. These guards handle calling
    the correct locale management function so that callers don't have too. This simplification will
    aid in upcoming Windows fixes. — ericwf / ViewSVN
  6. Fix possible loss of data warnings on amd64

    In T_size_size.pass, there is an explicit template argument to std::min to ask
    for unsigned, to avoid type deduction errors. However, C1XX' warnings still
    hate this use, because a 64 bit value (a size_t) is being passed to a function
    accepting an unsigned (a 32 bit value).

    Instead, change the tests to pass around std::size_t instances, and explicitly
    narrow when constructing the string type under test. This also allows
    removal of explicit template arguments to std::min. — bion / ViewSVN
  7. Resolve integer overflow warnings in GCD and LCM tests

    19: Update headers to that actually used in the test.
    41: test0 was triggering narrowing warnings for all callers, because the
    inputs were always ints, but some of the explicit template arguments were
    smaller than that. Instead, have this function accept ints and static_cast
    explicitly to the types we want before calling std::lcm.
    47: Replace unnecessary ternary.
    55: Use foo_t instead of typename foo<>::type
    111/116: intX_t were not std::qualified but only <cfoo> headers were included.
    141: C1XX has a bug where it interprets 2147483648 as unsigned int. Then the
    negation trips "negation of unsigned value, result still unsigned" warnings.
    Perma-workaround this issue by saying INT_MIN, which better documents the
    intended behavior and avoids triggering warnings on C1XX.

    Same changes as lcm.pass.cpp but for GCD. — bion / ViewSVN
  8. Add const to "DWARFDie &Die" in a few functions as they can't change the DWARFDie. — gclayton / ViewSVN
  9. Fix typo — eugene / ViewSVN
  10. Make it illegal for two Functions to point to the same DISubprogram

    As recently discussed on llvm-dev [1], this patch makes it illegal for
    two Functions to point to the same DISubprogram and updates
    FunctionCloner to also clone the debug info of a function to conform
    to the new requirement. To simplify the implementation it also factors
    out the creation of inlineAt locations from the Inliner into a
    general-purpose utility in DILocation.


    Differential Revision: — Adrian Prantl / ViewSVN
  11. [Driver] Don't enable -fsanitize-use-after-scope when ASan is disabled

    When enabling any sanitizer, -fsanitize-use-after-scope is enabled by
    default. This doesn't actually turn ASan on, because we've been getting
    lucky and there are extra checks in BackendUtil that stop this from

    However, this has been causing a behavior change: extra lifetime markers
    are emitted in some cases where they aren't needed or expected. — Vedant Kumar / ViewSVN
  12. STLExtras: Fix enumerate() documentation — matze / ViewSVN
  13. Fix typo "veify" to "verify". — gclayton / ViewSVN
  14. [InstCombine] add folds for not-of-shift-right

    This is another step towards getting rid of dyn_castNotVal,
    so we can recommit:

    As the tests show, we were missing the lshr case for constants
    and both ashr/lshr vector splat folds. The ashr case with constant
    was being performed inefficiently in 2 steps. It's also possible
    there was a latent bug in that case because we can't do that fold
    if the constant is positive: — spatel / ViewSVN
  15. [PartialInlining] Capture by reference rather than by value. — davide / ViewSVN
  16. If we are building a module, and we read a second description of the same
    module from a different module map, ignore it.

    This happens during builds of preprocessed modules (where it is harmless). — rsmith / ViewSVN

r302462 (#5775) (May 8, 2017 3:15:52 PM)

  1. ARM: use divmod libcalls on embedded MachO platforms too.

    The separated libcalls are implemented in terms of __divmodsi4 and __udivmodsi4
    anyway, so we should always use them if possible. — Tim Northover / ViewSVN
  2. Don't add DBG_VALUE instructions for static allocas in dbg.declare

    An llvm.dbg.declare of a static alloca is always added to the
    MachineFunction dbg variable map, so these values are entirely
    redundant. They survive all the way through codegen to be ignored by
    DWARF emission.

    Effectively revert r113967

    Two bugpoint-reduced test cases from 2012 broke as a result of this
    change. Despite my best efforts, I haven't been able to rewrite the test
    case using dbg.value. I'm not too concerned about the lost coverage
    because these were reduced from the test-suite, which we still run.

    Reviewers: aprantl, dblaikie

    Subscribers: llvm-commits

    Differential Revision: — rnk / ViewSVN
  3. Add some useful helper methods / operators to TypeIndex. — zturner / ViewSVN
  4. Update instructions for using the experimental monorepo — rnk / ViewSVN
  5. [BitVector] Make find_prev member function const.

    NFC. — zturner / ViewSVN

r302457 (#5774) (May 8, 2017 1:46:48 PM)

  1. Set ENABLE_WERROR=OFF for ABITestsuitBuilder. — gkistanova / ViewSVN
  2. Add a blurb to the release notes about the WeakVH -> WeakTrackingVH transition — sanjoy / ViewSVN
  3. Fixed 'haltOnFailure' for build step. — gkistanova / ViewSVN
  4. [CodeView] Add support for random access type visitors.

    Previously type visitation was done strictly sequentially, and
    TypeIndexes were computed by incrementing the TypeIndex of the
    last visited record.  This works fine for situations like dumping,
    but not when you want to visit types in random order.  For example,
    in a debug session someone might lookup a symbol by name, find that
    it has TypeIndex 10,000 and then want to go straight to TypeIndex

    In order to make this work, the visitation framework needs a mode
    where it can plumb TypeIndices through the callback pipeline.  This
    patch adds such a mode.  In doing so, it is necessary to provide
    an alternative implementation of TypeDatabase that supports random
    access, so that is done as well.

    Nothing actually uses these random access capabilities yet, but
    this will be done in subsequent patches.

    Differential Revision: — zturner / ViewSVN
  5. [AArch64][RegisterBankInfo] Change the default mapping of fp loads.

    This fixes PR32550, in a way that does not imply running the greedy
    mode at O0.

    The fix consists in checking if a load is used by any floating point
    instruction and if yes, we return a default mapping with FPR instead
    of GPR. — qcolombet / ViewSVN
  6. [AArch64][RegisterBankInfo] Fix mapping cost for GPR.

    In r292478, we changed the order of the enum that is referenced by
    PMI_FirstXXX. This had the side effect of changing the cost of the
    mapping of all the loads, instead of just the FPRs ones.

    Reinstate the higher cost for all but GPR loads.
    Note: This did not have any external visible effects:
    - For Fast mode, the cost would have been higher, but we don't care
      because we don't try to use alternative mappings.
    - For Greedy mode, the higher cost of the GPR loads, would have
      triggered the use of the supposedly alternative mapping, that
      would be in fact the same GPR mapping but with a lower cost. — qcolombet / ViewSVN
  7. [InstCombine] move/add tests for not(shr (not X), Y); NFC — spatel / ViewSVN
  8. [ARM] Use a Changed flag to avoid making a pass's return value dependent on a compare with a Statistic object.

    Statistic compile to always be 0 in release build so this compare would always return false. And in the debug builds Statistic are global variables and remember their values across pass runs. So this compare returns true anytime the pass runs after the first time it modifies something.

    This was found after reviewing all usages of comparison operators on a Statistic object. We had some internal code that did a compare with a statistic that caused a mismatch in output between debug and release builds. So we did an audit out of paranoia. — ctopper / ViewSVN

r302449 (#5773) (May 8, 2017 12:17:44 PM)

  1. [SCEV] Make setRange take ConstantRange by value instead of rvalue reference so we don't force anything on the caller. — ctopper / ViewSVN
  2. [SCEV] Don't use std::move on both inputs to APInt::operator+ or operator-. It might be confusing to the reader. NFC — ctopper / ViewSVN
  3. ConstantFold: Handle gep nonnull, undef as well — dannyb / ViewSVN
  4. ConstantFold: Fold  getelementptr (i32, i32* null, i64 undef) to null.
    Transforms/IndVarSimplify/2011-10-27-lftrnull will fail if this regresses.
    Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll has been changed to still test what it was
    trying to test. — dannyb / ViewSVN
  5. [X86][LWP] Add __LWP__ macro tests

    Missed in rL302418

    Differential Revision: — rksimon / ViewSVN
  6. [ValueTracking] Use KnownOnes to provide a better bound on known zeros for ctlz/cttz intrinics

    This patch uses KnownOnes of the input of ctlz/cttz to bound the value that can be returned from these intrinsics. This makes these intrinsics more similar to the handling for ctpop which already uses known bits to produce a similar bound.

    Differential Revision: — ctopper / ViewSVN
  7. Fix grammar in comment. NFC — jroelofs / ViewSVN

r302442 (#5772) (May 8, 2017 10:48:45 AM)

  1. [X86] Split test configurations. NFC.

    Split test that includes reproducer for pr32967 to KNL and SKX. — zvi / ViewSVN
  2. Simplify orphan section positioning.

    The code following this one already considers every possible insertion
    point for orphan sections, there is no point in sorting them before. — rafael / ViewSVN
  3. [AST] Fix copy&paste error in comment. NFC. — malcolm.parsons / ViewSVN
  4. [InstSimplify] fix typo; NFC — spatel / ViewSVN
  5. [InstCombine] use local variable to reduce code duplication; NFCI — spatel / ViewSVN
  6. [ValueTracking] Introduce a version of computeKnownBits that returns a KnownBits struct. Begin using it to replace internal usages of ComputeSignBit

    This introduces a new interface for computeKnownBits that returns the KnownBits object instead of requiring it to be pre-constructed and passed in by reference.

    This is a much more convenient interface as it doesn't require the caller to figure out the BitWidth to pre-construct the object. It's so convenient that I believe we can use this interface to remove the special ComputeSignBit flavor of computeKnownBits.

    As a step towards that idea, this patch replaces all of the internal usages of ComputeSignBit with this new interface. As you can see from the patch there were a couple places where we called ComputeSignBit which really called computeKnownBits, and then called computeKnownBits again directly. I've reduced those places to only making one call to computeKnownBits. I bet there are probably external users that do it too.

    A future patch will update the external users and remove the ComputeSignBit interface. I'll also working on moving more locations to the KnownBits returning interface for computeKnownBits.

    Differential Revision: — ctopper / ViewSVN
  7. [InstCombine/InstSimplify] add comments about code duplication; NFC — spatel / ViewSVN
  8. [Sema] Fix typos handling in an overloadable call.

    In C typos in arguments in a call of an overloadable function lead
    to a failure of construction of CallExpr and following recovery does
    not handle created delayed typos. This causes an assertion fail in
    Sema::~Sema since Sema::DelayedTypos remains not empty.

    The patch fixes that behavior by handling a call with arguments
    having dependant types in the way that C++ does.

    Differential Revision:

    Patch by Dmitry Borisenkov! — stulova / ViewSVN
  9. [InstCombine] add another test for PR32949; NFC

    A patch for the InstSimplify variant of this bug is up for review here: — spatel / ViewSVN
  10. InstructionSimplify: Refactor foldIdentityShuffles. NFC.

    Minor refactoring of foldIdentityShuffles() which allows the removal of a
    ConstantDataVector::get() in SimplifyShuffleVectorInstruction.

    Reviewers: spatel

    Reviewed By: spatel

    Subscribers: llvm-commits

    Differential Revision:

    lib/Analysis/InstructionSimplify.cpp — zvi / ViewSVN
  11. Fix comment typos. — gberry / ViewSVN
  12. [clang-tidy] Fix readability-implicit-bool-cast false positives

    The patch makes the check treat binary conditional operator (`x ?: y`), `while`
    and regular `for` loops as conditional statements for the purpose of
    AllowConditional*Cast options. — alexfh / ViewSVN

r302430 (#5771) (May 8, 2017 9:19:17 AM)

  1. [powerpc] Remove XFAIL for on powerpc64

    This test case works fine on powerpc64 (both BE and LE). — seurer / ViewSVN
  2. clang-tidy: add IgnoreMacros option to modernize-use-default-member-init

    And also enable it by default to be consistent with e.g.

    This helps e.g. when running this check on cppunit client code where the
    macro is provided by the system, so there is no easy way to modify it.

    Reviewers: alexfh, malcolm.parsons

    Reviewed By: malcolm.parsons

    Subscribers: cfe-commits

    Differential Revision: — vmiklos / ViewSVN
  3. [clang-format] Convert AlignEscapedNewlinesLeft to an enum, adding

    This converts the clang-format option AlignEscapedNewlinesLeft from a
    boolean to an enum, named AlignEscapedNewlines, with options Left (prev.
    true), Right (prev. false), and a new option DontAlign.

    When set to DontAlign, the backslashes are placed just after the last token in each line:
      #define EXAMPLE \
        do { \
            int x = aaaaa; \
            int b; \
            int dddddddddd; \
        } while (0)

    Patch by jtbandes. Thank you! — djasper / ViewSVN
  4. [clang-format] Don’t propagate AvoidBinPacking into argument

    This is an attempt to fix the issue described in a recent email:

    Patch by jtbandes. Thank you!
    Review: — djasper / ViewSVN
  5. Adding reproducer for pr32967. NFC. — zvi / ViewSVN
  6. [clang-tidy] Ignore private =deleted methods in macros.

    modernize-use-equals-delete is extremely noisy in code using
    DISALLOW_COPY_AND_ASSIGN-style macros and there's no easy way to automatically
    fix the warning when macros are in play. — alexfh / ViewSVN
  7. [X86][SSE] Improve combineLogicBlendIntoPBLENDV to use general masks.

    Currently combineLogicBlendIntoPBLENDV can only match ASHR to detect sign splatting of a bit mask, this patch generalises this to use computeNumSignBits instead.

    This is a first step in several things we can do to improve PBLENDV support:

    * Better matching of X86ISD::ANDNP patterns.
    * Handle floating point cases.
    * Better vector and bitcast support in computeNumSignBits.
    * Recognise that PBLENDV only uses the sign bit of the mask, we should be able strip away sign splats (ASHR, PCMPGT isNeg tests etc.).

    Differential Revision: — rksimon / ViewSVN

r302423 (#5770) (May 8, 2017 7:50:12 AM)

  1. [Polly][GPUJIT] Fixed OpenCL 2.0 min requirement for Error codes

    Summary: Removed OpenCL error code identifiers introduced in version 2.0.

    Reviewers: grosser, bollu

    Reviewed By: bollu

    Subscribers: yaxunl, Anastasia, pollydev, llvm-commits

    Tags: #polly

    Differential Revision: — bollu / ViewSVN
  2. Normalize line endings. NFCI, — rksimon / ViewSVN

r302421 (#5769) (May 8, 2017 6:54:23 AM)

  1. Fix Windows tests when __config_site is present.
    Previously, the force includes would complain about a missing _DEBUG symbol.
    Now we dump macros before adding the force includes to the command line. — bcraig / ViewSVN
  2. IR: Add a shufflevector mask commutation helper function. NFC.

    Following up on Sanjay's suggetion in D32955, move this functionality
    into ShuffleVectornstruction.

    Reviewers: spatel, RKSimon

    Reviewed By: RKSimon

    Subscribers: llvm-commits

    Differential Revision: — zvi / ViewSVN
  3. Correct the attribute spelling for guarded_var and pt_guarded_var.

    Patch by Roman Lebedev. — aaronballman / ViewSVN

r302418 (#5768) (May 8, 2017 5:49:26 AM)

  1. [X86][LWP] Add clang support for LWP instructions.

    This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

    Differential Revision: — rksimon / ViewSVN
  2. [ARM][NEON] Add support for ISD::ABS lowering

    Update NEON int_arm_neon_vabs intrinsic to use the ISD::ABS opcode directly

    Added constant folding tests.

    Differential Revision: — rksimon / ViewSVN
  3. [ARM] Clear the constant pool cache on explicit .ltorg directives

    Multiple ldr pseudoinstructions with the same constant value will
    reuse the same constant pool entry. However, if the constant pool
    is explicitly flushed with a .ltorg directive, we should not try
    to reference constants in the previous pool any longer, since they
    may be out of range.

    This fixes assembling hand-written assembler source which repeatedly
    loads the same constant value, across a binary size larger than the
    pc-relative fixup range for ldr instructions (4096 bytes). Such
    assembler source already uses explicit .ltorg instructions to emit
    constant pools with regular intervals. However if we try to reuse
    constants emitted in earlier pools, they end up out of range.

    This makes the output of the testcase match what binutils gas does
    (prior to this patch, it would fail to assemble).

    Differential Revision: — mstorsjo / ViewSVN
  4. [AARCH64][NEON] Add support for ISD::ABS lowering

    Update int_aarch64_neon_abs intrinsic to use the ISD::ABS opcode directly

    Differential Revision: — rksimon / ViewSVN
  5. [ELF] - Set DF_STATIC_TLS flag for i386 target.

    This is PR32437.

    If set in a shared object or executable, this flag instructs the
    dynamic linker to reject attempts to load this file dynamically.
    It indicates that the shared object or executable contains code
    using a static thread-local storage scheme. Implementations need
    not support any form of thread-local storage.

    Patch checks if IE/LE relocations were used to check if code uses
    static model. If so it sets the DF_STATIC_TLS flag.

    Differential revision: — grimar / ViewSVN
  6. [ELF] - Linkerscript: support combination of linkerscript and --compress-debug-sections.

    Previously it was impossible to use linkerscript with --compress-debug-sections
    because of assert failture:
    Assertion failed: isFinalized(), file C:\llvm\lib\MC\StringTableBuilder.cpp, line 64

    Patch fixes the issue — grimar / ViewSVN

r302412 (#5767) (May 8, 2017 3:30:16 AM)

  1. [GlobalISel][X86] G_GEP selection support.

    Summary: [GlobalISel][X86] G_GEP selection support.

    Reviewers: zvi, guyblank

    Reviewed By: guyblank

    Subscribers: dberris, rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN
  2. [OpenCL] Check that global samplers are const

    Patch by Simon Perretta.

    Differential Revision: — svenvh / ViewSVN
  3. [GlobalISel][X86] G_MUL legalizer/selector support.

    G_MUL legalizer/selector/regbank support.
    Use only Tablegen-erated instruction selection.
    This patch dealing with legal operations only.

    Reviewers: zvi, guyblank

    Reviewed By: guyblank

    Subscribers: krytarowski, rovka, kristof.beyls, llvm-commits

    Differential Revision: — ibreger / ViewSVN

r302409 (#5766) (May 8, 2017 2:34:21 AM)

  1. [Lit] Fix to prevent creation of "%SystemDrive%" directory on Windows.

    This patch propogates the environment variable SYSTEMDRIVE on Windows when
    running the unit tests. This prevents the creation of a directory named
    "%SystemDrive%" when running the unit tests from FileSystemTest that use the
    function llvm::sys::fs::remove_directories which in turn uses SHFileOperationW.
    It is within SHFileOperationW that this environment variable may be used and if
    undefined causes the creation of a "%SystemDrive%" directory in the current

    Differential Revision: — anng / ViewSVN
  2. [APInt] Modify tcMultiplyPart's overflow detection to not depend on 'i' from the earlier loop. NFC

    The value of 'i' is always the smaller of DstParts and SrcParts so we can just use that fact to write all the code in terms of SrcParts and DstParts. — ctopper / ViewSVN
  3. [APInt] Use std::min instead of writing the same thing with the ternary operator. NFC — ctopper / ViewSVN
  4. [APInt] Remove 'else' after 'return' in tcMultiply methods. NFC — ctopper / ViewSVN

r302405 (#5765) (May 7, 2017 11:30:39 PM)

  1. [XRay] Custom event logging intrinsic

    This patch introduces an LLVM intrinsic and a target opcode for custom event
    logging in XRay. Initially, its use case will be to allow users of XRay to log
    some type of string ("poor man's printf"). The target opcode compiles to a noop
    sled large enough to enable calling through to a runtime-determined relative
    function call. At runtime, when X-Ray is enabled, the sled is replaced by
    compiler-rt with a trampoline to the logic for creating the custom log entries.

    Future patches will implement the compiler-rt parts and clang-side support for
    emitting the IR corresponding to this intrinsic.

    Reviewers: timshen, dberris

    Subscribers: igorb, pelikan, rSerge, timshen, echristo, dberris, llvm-commits

    Differential Revision: — dberris / ViewSVN

r302404 (#5764) (May 7, 2017 10:34:27 PM)

  1. [SCEV] Use APInt::operator*=(uint64_t) to avoid a temporary APInt for a constant. — ctopper / ViewSVN
  2. [APInt] Take advantage of new operator*=(uint64_t) to remove a temporary APInt. — ctopper / ViewSVN
  3. [APInt] Add support for multiplying by a uint64_t.

    This makes multiply similar to add, sub, xor, and, and or. — ctopper / ViewSVN
  4. Hopefully one last commit to fix this patch, addresses string reference
    issues. — ecbeckmann / ViewSVN
  5. Quick fix to D32609, it seems .o files are not transferred in all cases.

    Therefore the .o file in question is renamed to .obj.coff. — ecbeckmann / ViewSVN
  6. Update llvm-readobj -coff-resources to display tree structure.

    Summary: Continue making updates to llvm-readobj to display resource sections.  This is necessary for testing the up and coming cvtres tool.

    Reviewers: zturner

    Subscribers: llvm-commits

    Differential Revision: — ecbeckmann / ViewSVN
  7. [SCEV] Have getRangeForAffineARHelper take StartRange by const reference to avoid a copy in many of the cases. — ctopper / ViewSVN
  8. Revert "Hopefully one last commit to fix this patch, addresses string reference"

    This reverts commit 56beec1b1cfc6d263e5eddb7efff06117c0724d2.

    Revert "Quick fix to D32609, it seems .o files are not transferred in all cases."

    This reverts commit 7652eecd29cfdeeab7f76f687586607a99ff4e36.

    Revert "Update llvm-readobj -coff-resources to display tree structure."

    This reverts commit 422b62c4d302cfc92401418c2acd165056081ed7.

    Reviewers: zturner

    Subscribers: llvm-commits

    Differential Revision: — ecbeckmann / ViewSVN

r302396 (#5763) (May 7, 2017 8:33:58 PM)

  1. Fix Windows locale detection — ericwf / ViewSVN
  2. Hopefully one last commit to fix this patch, addresses string reference
    issues. — ecbeckmann / ViewSVN
  3. Fix shared_mutex dll import errors on Windows — ericwf / ViewSVN

r302393 (#5762) (May 7, 2017 7:03:43 PM)

  1. [libc++] Implement exception_ptr on Windows

    This patch implements exception_ptr on Windows using the `__ExceptionPtrFoo` functions provided by MSVC.

    The `__ExceptionPtrFoo` functions are defined inside the C++ standard library, `msvcprt`, which is unfortunate because it requires libc++ to link to the MSVC STL. However this doesn't seem to cause any immediate problems. However to be safe I kept all usages within the libc++ dylib so that user programs wouldn't have to link to MSVCPRT as well.

    Note there are still 2 outstanding exception_ptr/nested_exception test failures.

    * `current_exception.pass.cpp` needs to be rewritten for the Windows exception_ptr semantics which copy the exception every time.
    * `rethrow_if_nested.pass.cpp` need investigation. It hits a stack overflow, likely from recursion.

    This patch also gets most of the `<future>` tests passing as well.

    Reviewers: mclow.lists, compnerd, bcraig, rmaprath, majnemer, BillyONeal, STL_MSFT

    Subscribers: mgorny, cfe-commits

    Differential Revision: — ericwf / ViewSVN
  2. [XRay][compiler-rt] XFAIL on ppc

    Follow-up on D32846. — dberris / ViewSVN
  3. Fix DLL import/export on Win32 locale helpers — ericwf / ViewSVN
  4. Fix DLL import for __time_get_c_storage member functions. — ericwf / ViewSVN
  5. Revert "Actually remove the MSVC STL when linking and testing libc++ on Windows"

    This reverts commit r302387. — ericwf / ViewSVN
  6. Quick fix to D32609, it seems .o files are not transferred in all cases.

    Therefore the .o file in question is renamed to .obj.coff. — ecbeckmann / ViewSVN

r302387 (#5761) (May 7, 2017 5:34:59 PM)

  1. Actually remove the MSVC STL when linking and testing libc++ on Windows — ericwf / ViewSVN
  2. Update llvm-readobj -coff-resources to display tree structure.

    Summary: Continue making updates to llvm-readobj to display resource sections.  This is necessary for testing the up and coming cvtres tool.

    Reviewers: zturner

    Subscribers: llvm-commits

    Differential Revision: — ecbeckmann / ViewSVN
  3. [ConstantRange][SimplifyCFG] Add a helper method to allow SimplifyCFG to determine if a ConstantRange has more than 8 elements without requiring an allocation if the ConstantRange is 64-bits wide.

    Previously SimplifyCFG used getSetSize which returns an APInt that is 1 bit wider than the ConstantRange's bit width. In the reasonably common case that the ConstantRange is 64-bits wide, this requires returning a 65-bit APInt. APInt's can only store 64-bits without a memory allocation so this is inefficient.

    The new method takes the 8 as an input and tells if the range contains more than that many elements without requiring any wider math. — ctopper / ViewSVN
  4. Temporarly XFAIL aligned new/delete tests on Windows.

    Libc++ doesn't provide its own definitions of new/delete on Windows,
    instead using the versions provided by VCRuntime. However VCRuntime
    does not yet implement aligned new/delete so these tests fail.

    It might be possible for libc++ to provide its own definitions only
    for aligned new/delete as long as MSVC doesn't provide it. However
    before this can be done libc++ needs to figure out how to implement
    std::get_new_handler. — ericwf / ViewSVN
  5. [ConstantRange] Remove 'Of' from name of ConstantRange::isSizeStrictlySmallerThanOf so that it reads better. NFC — ctopper / ViewSVN

r302382 (#5760) (May 7, 2017 4:06:12 PM)

  1. Fix Windows test failures caused by identical temp file names.

    This patch fixes test failures that occur on Windows because
    the tests attempt to generate two distinct temp file names but
    get the same name both time.

    The fix for this is to create the first temp file before requesting
    a second temporary file name. This ensures that the second name
    will be unique. — ericwf / ViewSVN
  2. Accept Windows specific output in system error tests — ericwf / ViewSVN
  3. Fix two test failures caused by Windows mangling of function types.

    On Windows the function template `template <class T> void test()` has
    the same mangled name when instantiated with the distinct types `void()`
    and `void() noexcept`. When this occurs Clang emits an error. This error
    was causing two type-traits tests to fail.

    However this can be worked around by using class templates instead of
    function templates, which is what this patch does to fix the errors. — ericwf / ViewSVN
  4. [Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGen

    When compiling for GPU, one can now choose to compile for OpenCL or CUDA,
    with the corresponding polly-gpu-runtime flag (libopencl / libcudart). The
    GPURuntime library (GPUJIT) has been extended with the OpenCL Runtime library
    for that purpose, correctly choosing the corresponding library calls to the
    option chosen when compiling (via different initialization calls).

    Additionally, a specific GPU Target architecture can now be chosen with -polly-gpu-arch (only nvptx64 implemented thus far).

    Reviewers: grosser, bollu, Meinersbur, etherzhhb, singam-sanjay

    Reviewed By: grosser, Meinersbur

    Subscribers: singam-sanjay, llvm-commits, pollydev, nemanjai, mgorny, yaxunl, Anastasia

    Tags: #polly

    Differential Revision: — bollu / ViewSVN
  5. [X86][AVX1] Improve 256-bit vector costs for integer unary intrinsics.

    Account for subvector extraction/insertion, helps prevent the vectorizers from selecting 256-bit vectors that will have to be split anyhow on AVX1 targets. — rksimon / ViewSVN

r302377 (#5759) (May 7, 2017 2:36:36 PM)

  1. [Orc] Remove trailing whitespace. — Lang Hames / ViewSVN
  2. [Polly] [GPUJIT] Adapted argument capitalization to fit standard

    Summary: Function argument naming changed to reflect capitalization standards.

    Reviewers: grosser, Meinersbur

    Reviewed By: grosser

    Differential Revision: — bollu / ViewSVN

r302375 (#5758) (May 7, 2017 1:08:07 PM)

  1. [Polly] [GPUJIT] Moved error prints to stderr

    Summary: Errors previously printed to stdout now get printed to stderr.

    Reviewers: grosser, Meinersbur

    Reviewed By: grosser

    Differential Revision: — bollu / ViewSVN
  2. [InstSimplify] add tests for PR32949 miscompile; NFC — spatel / ViewSVN
  3. InstructionSimplify: Relanding r301766

    Re-applying r301766 with a fix to a typo and a regression test.

    The log message for r301766 was:
        InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

         Apply canonicalization rules:
            1. Input vectors with no elements selected from can be replaced with undef.
            2. If only one input vector is constant it shall be the second one.

        This allows constant-folding to cover more ad-hoc simplifications that
        were in place and avoid duplication for RHS and LHS checks.

        There are more rules we may want to add in the future when we see a
        justification. e.g. mask elements that select undef elements can be
        replaced with undef.

    Reviewers: spatel, RKSimon

    Reviewed By: spatel

    Subscribers: llvm-commits

    Differential Revision: — zvi / ViewSVN

r302372 (#5757) (May 7, 2017 11:38:50 AM)

  1. Make llvm-rtdlyd -check preserve automatic address mappings made by RuntimeDyld.

    Currently llvm-rtdyld in -check mode will map sections to back-to-back 4k
    aligned slabs starting at 0x1000. Automatically remapping sections by default is
    helpful because it quickly exposes relocation bugs due to use of local addresses
    rather than load addresses (these would silently pass if the load address was
    not remapped). These mappings can be explicitly overridden on a per-section
    basis using llvm-rtdlyd's -map-section option. This patch extends this scheme to
    also preserve any mappings made by RuntimeDyld itself. Preserving RuntimeDyld's
    automatic mappings allows us to write test cases to verify that these automatic
    mappings have been applied.

    This will allow the fix in to be tested with
    llvm-rtdyld -check. — Lang Hames / ViewSVN

r302371 (#5756) (May 7, 2017 10:09:25 AM)

  1. [SCEV] Use move semantics in ScalarEvolution::setRange

    Summary: This makes setRange take ConstantRange by rvalue reference since most callers were passing an unnamed temporary ConstantRange. We can then move that ConstantRange into the DenseMap caches. For the callers that weren't passing a temporary, I've added std::move to to the local variable being passed.

    Reviewers: sanjoy, mzolotukhin, efriedma

    Reviewed By: sanjoy

    Subscribers: takuto.ikuta, llvm-commits

    Differential Revision: — ctopper / ViewSVN

r302370 (#5755) (May 7, 2017 8:49:33 AM)

  1. [InstSimplify] use ConstantRange to simplify or-of-icmps

    We can simplify (or (icmp X, C1), (icmp X, C2)) to 'true' or one of the icmps in many cases.
    I had to check some of these with Alive to prove to myself it's right, but everything seems
    to check out. Eg, the deleted code in instcombine was completely ignoring predicates with
    mismatched signedness.

    This is a follow-up to: — spatel / ViewSVN

r302369 (#5754) (May 7, 2017 4:39:30 AM)

  1. [Kaleidoscope] toy.cpp use after move fix

    The variable Proto is moved at the beginning of the codegen() function.
    According to the comment above, the pointed object should be used due the
    reference P.

    Differential Revision: — szepet / ViewSVN

r302368 (#5753) (May 6, 2017 11:09:27 PM)

  1. Remove unnecessary const_cast — sanjoy / ViewSVN
  2. Use array_pod_sort instead of std::sort — sanjoy / ViewSVN

r302366 (#5752) (May 6, 2017 9:34:38 PM)

  1. Fix comment. — Lang Hames / ViewSVN
  2. COFF: add ARM64 relocation types

    Add the ARM64 COFF relocation types.  This will be needed to add support
    for the AArch64 Windows object file emission support. — Saleem Abdulrasool / ViewSVN

r302364 (#5751) (May 6, 2017 5:11:44 PM)

  1. Update LanguageExtensions doc to refer to C++14 instead of C++1y — ericwf / ViewSVN

r302363 (#5750) (May 6, 2017 3:49:21 PM)

  1. Fix undefined pthread references when building against libc++ — ericwf / ViewSVN

r302362 (#5749) (May 6, 2017 2:39:30 PM)

  1. Ensure showbase does not overflow do_put buffers

    In, Daniel McRobb describes how using
    std::showbase with ostreams can cause truncation of unsigned long long
    when output format is octal.  In fact, this can even happen with
    unsigned int and unsigned long.

    To ensure this does not happen, add one additional character to the
    do_put buffers if std::showbase is on.  Also add a test case.

    Reviewers: EricWF, mclow.lists

    Reviewed By: EricWF

    Subscribers: cfe-commits, emaste

    Differential Revision: — dim / ViewSVN
  2. [X86][AVX512] Relax assertion and just exit combine for unsupported types (PR32907) — rksimon / ViewSVN
  3. Really disable test as intended in the previous commit — grosser / ViewSVN
  4. [X86][AVX512] Move v2i64/v4i64 VPABS lowering to tablegen

    Extend NoVLX targets to use the 512-bit versions — rksimon / ViewSVN

r302358 (#5748) (May 6, 2017 1:31:02 PM)

  1. Disable test to avoid buildbot noise

    This test was introduced in r302339. It works on my system, but breaks on the
    buildbots. — grosser / ViewSVN

r302357 (#5747) (May 6, 2017 12:34:59 PM)

  1. [X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI. — rksimon / ViewSVN

r302356 (#5746) (May 6, 2017 11:39:00 AM)

  1. [NVPTX] Add support for ISD::ABS lowering

    Use the ISD::ABS opcode directly

    Differential Revision: — rksimon / ViewSVN
  2. [X86][SSE] Break register dependencies on v16i8/v8i16 BUILD_VECTOR on SSE41

    rL294581 broke unnecessary register dependencies on partial v16i8/v8i16 BUILD_VECTORs, but on SSE41 we (currently) use insertion for full BUILD_VECTORs as well. By allowing full insertion to occur on SSE41 targets we can break register dependencies here as well. — rksimon / ViewSVN

r302354 (#5745) (May 6, 2017 10:35:15 AM)

  1. [Analysis] Print out unreachable loops

    When writing a loop pass I made a mistake and hit the assertion
    "Unreachable block in loop". Later, I hit an assertion when I called
    `BasicBlock::eraseFromParent()` incorrectly: "Use still stuck around
    after Def is destroyed". This latter assertion, however, printed out
    exactly which value is being deleted and what uses remain, which helped
    me debug the issue.

    To help people debugging their loop passes in the future, print out
    exactly which basic block is unreachable in a loop.

    Reviewers: sanjoy, hfinkel, mehdi_amini

    Reviewed By: mehdi_amini

    Subscribers: mzolotukhin

    Differential Revision: — modocache / ViewSVN

r302353 (#5744) (May 6, 2017 9:39:14 AM)

  1. Updating branches/google/stable to r302012 — djasper / ViewSVN
  2. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  3. Updating branches/google/stable to r302012 — djasper / ViewSVN
  4. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  5. Updating branches/google/stable to r302012 — djasper / ViewSVN
  6. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  7. Updating branches/google/stable to r302012 — djasper / ViewSVN
  8. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  9. Updating branches/google/stable to r302012 — djasper / ViewSVN
  10. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  11. Updating branches/google/stable to r302012 — djasper / ViewSVN
  12. Creating tags/google/stable/2017-05-06 from r302012 — djasper / ViewSVN
  13. Cleaning up stable branch — djasper / ViewSVN
  14. [builtins] Fixup emulated TLS for mingw.

    Enabled emulated TLS on WOA for mingw
    Fix <windows.h> include for mingw

    Reviewed By: chapuni, mstorsjo

    Subscribers: compnerd, llvm-commits

    Differential Revision: — martell / ViewSVN

r302339 (#5743) (May 6, 2017 8:43:18 AM)

  1. [DeLICM] Known knowledge.

    Extend the Knowledge class to store information about the contents
    of array elements and which values are written. Two knowledges do
    not conflict the known content is the same. The content information
    if computed from writes to and loads from the array elements, and
    represented by "ValInst": isl spaces that compare equal if the value
    represented is the same.

    Differential Revision: — meinersbur / ViewSVN

r302338 (#5742) (May 6, 2017 7:28:04 AM)

  1. [X86][AVX2] Add scheduling latency/throughput tests for some AVX2 instructions

    Many more to come... — rksimon / ViewSVN
  2. [DAGCombiner] If ISD::ABS is legal/custom, use it directly instead of canonicalizing first.

    Remove an extra canonicalization step if ISD::ABS is going to be used anyway.

    Updated x86 abs combine to check that we are lowering from both canonicalizations. — rksimon / ViewSVN
  3. [CMake] Introduce POLLY_BUNDLED_JSONCPP.

    Allow using a system's install jsoncpp library instead of the bundled
    one with the setting POLLY_BUNDLED_JSONCPP=OFF.

    This fixes

    Differential Revision: — meinersbur / ViewSVN

r302335 (#5741) (May 5, 2017 11:52:29 PM)

  1. [SCEV] Remove extra APInt copies from getRangeForAffineARHelper.

    This changes one parameter to be a const APInt& since we only read from it. Use std::move on local APInts once they are no longer needed so we can reuse their allocations. Lastly, use operator+=(uint64_t) instead of adding 1 to an APInt twice creating a new APInt each time. — ctopper / ViewSVN
  2. [SCEV] Use std::move to avoid some APInt copies. — ctopper / ViewSVN

r302333 (#5740) (May 5, 2017 10:54:38 PM)

  1. [SCEV] Use APInt's uint64_t operations instead of creating a temporary APInt to hold 1. — ctopper / ViewSVN
  2. [SCEV] Avoid a couple APInt copies by capturing by reference since the method returns a reference. — ctopper / ViewSVN

r302331 (#5739) (May 5, 2017 9:43:57 PM)

  1. [LazyValueInfo] Avoid unnecessary copies of ConstantRanges

    ConstantRange contains two APInts which can allocate memory if their width is larger than 64-bits. So we shouldn't copy it when we can avoid it.

    This changes LVILatticeVal::getConstantRange() to return its internal ConstantRange by reference. This allows many places that just need a ConstantRange reference to avoid making a copy.

    Several places now capture the return value of getConstantRange() by reference so they can call methods on it that don't need a new object.

    Lastly it adds std::move in one place to capture to move a local ConstantRange into an LVILatticeVal.

    Reviewers: reames, dberlin, sanjoy, anna

    Reviewed By: reames

    Subscribers: grandinj, llvm-commits

    Differential Revision: — ctopper / ViewSVN

r302330 (#5738) (May 5, 2017 8:48:27 PM)

  1. Fix lgamma_r linking errors on Windows. It appears the normal lgamma function is thread safe anyway — ericwf / ViewSVN
  2. Note addition of NetBSD support in googletest

    Recreated patch for __NetBSD__ has been pushed upstream to Google. — kamil / ViewSVN

r302328 (#5737) (May 5, 2017 7:52:40 PM)

  1. Add GCC ToT libc++ builder — ericwf / ViewSVN

r302327 (#5736) (May 5, 2017 6:56:45 PM)

  1. Be a little more permissive in DynamicLoaderMacOS::CanLoadImage

    If we can't find the "is dyld locked" symbol, assume it is safe
    to load the image unless we only have 1 image loaded - in which case
    we are in _dyld_start and it is definitely NOT safe.

    Also add a little better errors to that function, and better logging
    in SBProcess.cpp.

    <rdar://problem/30174817> — jingham / ViewSVN

r302326 (#5735) (May 5, 2017 6:00:27 PM)

  1. Use the same terminology as ELF.

    This patch do s/color/class/g. — ruiu / ViewSVN
  2. [libcxx] [test] Suppress MSVC's /analyze warning C6294 in a more fine-grained manner.

    Fixes D32926. — stl_msft / ViewSVN
  3. Remove dead file. — ruiu / ViewSVN
  4. Added "info threads", "thread 1" and "apropos". — jingham / ViewSVN
  5. [libcxx] [test] Fix MSVC "warning C6326: Potential comparison of a constant with another constant".

    The expressions `1 == 1` and `true` have the same type, value category, and value.

    Fixes D32924. — stl_msft / ViewSVN
  6. [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. compiler-rt part (test only). — kcc / ViewSVN
  7. [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. clang part. — kcc / ViewSVN
  8. [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a hidden -mllvm flag. llvm part. — kcc / ViewSVN
  9. [libcxx] [test] Be compatible with LWG 2438 "std::iterator inheritance shouldn't be mandated".

    In C++17, these iterators are allowed but not required
    to inherit from the deprecated std::iterator base class.

    Fixes D32727. — stl_msft / ViewSVN
  10. [clang-tidy] Use cxxStdInitializerListExpr in modernize-use-emplace

    Summary: Use the cxxStdInitializerListExp matcher from ASTMatchers.h instead of a local one.

    Reviewers: aaron.ballman, alexfh, Prazek

    Reviewed By: aaron.ballman

    Subscribers: xazax.hun, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — kuhar / ViewSVN
  11. [RegisterBankInfo] Uniquely allocate instruction mapping.

    This is a step toward having statically allocated instruciton mapping.
    We are going to tablegen them eventually, so let us reflect that in
    the API.

    NFC. — qcolombet / ViewSVN
  12. [BitVector] Improve the description of the BitVector::clear to say it removes the bits rather than clearing since clearing could be interpreted as just zeroing. NFC — ctopper / ViewSVN
  13. Add DidStartExecuting/WillFinishExecuting methods to Expression.

    These methods can be used by the derived expression types to perform expression
    specific and/or language specific actions before and after the expression runs.
    (ThreadPlanCallUserExpression is modified to call these methods on the
    expression immediately before/after execution of the expression).

    The immediate motivation is allowing Swift expressions to notify the swift
    runtime that exclusivity enforcement should be suspended while the expression
    runs (we want LLDB expressions to be able to access variables even when they're
    considered exclusively owned by someone else in the original program).

    Reviewed in — Lang Hames / ViewSVN

r302313 (#5734) (May 5, 2017 4:33:42 PM)

  1. AArch64: fix weird edge case in ABI.

    It turns out there are some sort-of-but-not-quite empty structs that break all
    the rules. For example:

    struct SuperEmpty { int arr[0]; };
    struct SortOfEmpty { struct SuperEmpty e; };

    Both of these have sizeof == 0, even in C++ mode, for GCC compatibility. The
    first one also doesn't occupy a register when passed by value in GNU C++ mode,
    unlike everything else.

    On Darwin, we want to ignore the lot (and especially don't want to try to use
    an i0 as we were). — Tim Northover / ViewSVN
  2. Permit keywords in module names in #pragma clang module *.

    This is necessary to be able to build a libc++ module from preprocessed source
    (due to the submodule — rsmith / ViewSVN
  3. Fix spelling error in command line option description. NFC — ctopper / ViewSVN
  4. [IR] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). — eugenezelenko / ViewSVN
  5. Add support for building modules from preprocessed source.

    To support this, an optional marker "#pragma clang module contents" is
    recognized in module map files, and the rest of the module map file from that
    point onwards is treated as the source of the module. Preprocessing a module
    map produces the input module followed by the marker and then the preprocessed
    contents of the module.

    Ignoring line markers, a preprocessed module might look like this:

      module A {
        header "a.h"
      #pragma clang module contents
      #pragma clang module begin A
      // ... a.h ...
      #pragma clang module end

    The preprocessed output generates line markers, which are not accepted by the
    module map parser, so -x c++-module-map-cpp-output should be used to compile
    such outputs.

    A couple of major parts do not work yet:

    1) The files that are listed in the module map must exist on disk, in order to
       build the on-disk header -> module lookup table in the PCM file. To fix
       this, we need the preprocessed output to track the file size and other stat
       information we might use to build the lookup table.

    2) Declaration ownership semantics don't work properly yet, since mapping from
       a source location to a module relies on mapping from FileIDs to modules,
       which we can't do if module transitions can occur in the middle of a file. — rsmith / ViewSVN
  6. Override invalidate of ProfileSummaryInfo to return false.

    Differential revision: — eraman / ViewSVN
  7. [Hexagon] Disable predicated calls by default — kparzysz / ViewSVN
  8. [Hexagon] Remove C6 and C7 as separate registers

    These are M0 and M1. Removing duplicated registers reduces the number
    of explicit register aliasing. — kparzysz / ViewSVN
  9. [RDF] Remove covered parts of reached uses for phi and use in same block — kparzysz / ViewSVN
  10. lld Fixups for TypeDatabase changes. — zturner / ViewSVN
  11. ARM: Compute MaxCallFrame size early

    This exposes a method in MachineFrameInfo that calculates
    MaxCallFrameSize and calls it after instruction selection in the ARM

    This avoids
    giving different answers in early/late phases of codegen.

    The testcase shows a particular nasty example result of that where we
    would fail to properly align an alloca.

    Differential Revision: — matze / ViewSVN
  12. [CodeView] Reserve TypeDatabase records up front.

    Most of the time we know exactly how many type records we
    have in a list, and we want to use the visitor to deserialize
    them into actual records in a database.  Previously we were
    just using push_back() every time without reserving the space
    up front in the vector.  This is obviously terrible from a
    performance standpoint, and it's not uncommon to have PDB
    files with half a million type records, where the performance
    degredation was quite noticeable. — zturner / ViewSVN

r302301 (#5733) (May 5, 2017 3:37:32 PM)

  1. Add missing target triple to test — matze / ViewSVN
  2. [scudo] Add Android support

    This change adds Android support to the allocator (but doesn't yet enable it in
    the cmake config), and should be the last fragment of the rewritten change

    Android has more memory constraints than other platforms, so the idea of a
    unique context per thread would not have worked. The alternative chosen is to
    allocate a set of contexts based on the number of cores on the machine, and
    share those contexts within the threads. Contexts can be dynamically reassigned
    to threads to prevent contention, based on a scheme suggested by @dvyuokv in
    the initial review.

    Additionally, given that Android doesn't support ELF TLS (only emutls for now),
    we use the TSan TLS slot to make things faster: Scudo is mutually exclusive
    with other sanitizers so this shouldn't cause any problem.

    An additional change made here, is replacing `thread_local` by `THREADLOCAL`
    and using the initial-exec thread model in the non-Android version to prevent
    extraneous weak definition and checks on the relevant variables.

    Reviewers: kcc, dvyukov, alekseyshl

    Reviewed By: alekseyshl

    Subscribers: srhines, mgorny, llvm-commits

    Differential Revision: — cryptoad / ViewSVN
  3. Delete LinkerScript::getSectionIndex.

    We can set SectionIndex tentatively as we process the linker script
    instead of looking it repeatedly.

    In general we should try to have as few name lookups as possible. — rafael / ViewSVN
  4. Mark test using <sys/time.h> as UNSUPPORTED on Windows — ericwf / ViewSVN
  5. Fix condition_variable::wait_until and wait_for on Windows.

    The ERROR_TIMEDOUT returned by the Windows API does not
    have the same value as ETIMEDOUT. This caused condition_variable
    to return timeouts as unknown errors. — ericwf / ViewSVN
  6. Multilib: add dump methods — jroelofs / ViewSVN
  7. Fix build breakage on Linux. — ruiu / ViewSVN
  8. Fix -Wreorder warning. — zturner / ViewSVN
  9. Fix another incorrectly cased header include. — zturner / ViewSVN
  10. [StreamArray] Pipe the Offset through the constructor.

    When randomly accessing an element by offset, we weren't passing
    the offset through so if you called .offset() it would return a
    value of 0. — zturner / ViewSVN
  11. Fix #include case sensitivity problem. — zturner / ViewSVN
  12. [AMDGPU] In the new waitcnt insertion pass, use getHeader
             instead of getTopBlock to find the loop header.

    Differential Revision: — kannann / ViewSVN
  13. MIParser/MIRPrinter: Compute block successors if not explicitely specified

    - MIParser: If the successor list is not specified successors will be
      added based on basic block operands in the block and possible

    - MIRPrinter: Adds a new `simplify-mir` option, with that option set:
      Skip printing of block successor lists in cases where the
      parser is guaranteed to reconstruct it. This means we still print the
      list if some successor cannot be determined (happens for example for
      jump tables), if the successor order changes or branch probabilities
      being unequal.

    Differential Revision: — matze / ViewSVN
  14. Split up Parallel and LLVM'ize naming conventions.

    This is one step in preparation of raising this up to
    LLVM.  This hides all of the Executor stuff in a private
    implementation file, leaving only the core algorithms and
    the TaskGroup class exposed.  In doing so, fix up all the
    variable names to conform to LLVM style.

    Differential Revision: — zturner / ViewSVN
  15. Add cxxStdInitializerListExpr AST matcher

    This adds a new ASTMatcher for CXXStdInitializerListExprs that matches C++ initializer list expressions.

    The primary motivation is to use it to fix [[ | PR32896 ]] (review here [[ | D32767 ]]).

    Reviewers: alexfh, Prazek, aaron.ballman

    Reviewed By: alexfh, aaron.ballman

    Subscribers: malcolm.parsons, cfe-commits, klimek

    Differential Revision: — kuhar / ViewSVN
  16. [X86] Use SDValue::getConstantOperandVal helper. NFCI. — rksimon / ViewSVN
  17. Fix detection for [[fallthrough]] with GCC — ericwf / ViewSVN
  18. [ODRHash] Fix typo, NFC

    NestedNameSpecifer to NestedNameSpecifier.  This was not a problem before since
    one of the included headers transitively brought in the definition of the class
    and only manifested as a problem when using the typoed NestedNameSpecifer and
    getting an incomplete type error instead of a typo correction. — rtrieu / ViewSVN

r302283 (#5732) (May 5, 2017 2:41:43 PM)

  1. Fix remaining GCC 7 build warnings — ericwf / ViewSVN
  2. Fix UDP Socket connections

    Some of the refactoring in r301492 broke UDP socket connections. This is a partial revert of that refactoring. At some point I'll spend more time diagnosing where the refactoring went wrong and how to better clean up this code, but I don't have time to do that today. — cbieneman / ViewSVN
  3. [clang-tidy] Fix PR32896: detect initializer lists in modernize-use-empalce

    This patch fixes [[ | PR32896 ]].

    The problem was that modernize-use-emplace incorrectly removed changed push_back into emplace_back, removing explicit constructor call with initializer list parameter, resulting in compiler error after applying fixits.
    modernize-use-emplace used to check if matched constructor had InitListExpr, but didn't check against CXXStdInitializerListExpr.


    std::vector<std::vector<int>> v;
      v.push_back(std::vector<int>({1})); // --> v.emplace_back({1});

    Reviewers: Prazek, alexfh, aaron.ballman

    Reviewed By: Prazek, alexfh, aaron.ballman

    Subscribers: xazax.hun, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — kuhar / ViewSVN
  4. Fix new warnings emitted by GCC 7 — ericwf / ViewSVN
  5. Remove isTlsLocalDynamicRel and isTlsInitialExecRel.

    This feels a bit hackish, but I think it is still an improvement.

    The way a tls address is computed in the various architectures is not
    that different. For example, for local dynamic we need the base of the
    tls (R_TLSLD or R_TLSLD_PC), and the offset of that particular symbol

    Given the similarity, we can just use the expressions instead of
    having two additional target hooks. — rafael / ViewSVN
  6. TargetLibraryInfo: Introduce wcslen

    wcslen is part of the C99 and C++98 standards.

    - This introduces the function to TargetLibraryInfo.
    - Also set attributes for wcslen in llvm::inferLibFuncAttributes().

    Differential Revision: — matze / ViewSVN

    This field is populated by the CP

    Differential Revision: — kzhuravl / ViewSVN
  8. [ScopBuilder] Move Scop::init to ScopBuilder. NFC.

    Scop::init is used only during SCoP construction. Therefore ScopBuilder
    seems the more appropriate place for it. We integrate it onto its only
    caller ScopBuilder::buildScop where some other construction steps
    already took place.

    Differential Revision: — meinersbur / ViewSVN

r302275 (#5731) (May 5, 2017 1:45:28 PM)

  1. Do not redefine the THREAD_ANNOTATION_ATTRIBUTE__ macro in the documentation.

    Patch by Roman Lebedev. — aaronballman / ViewSVN
  2. [ARM] Limit the diagnose when an ISR calls a regular function

    When the function is compiled with soft-float or on CPU with no FPU, we
    don't need to diagnose for a call from an ISR to a regular function.

    Reviewers: jroelofs, eli.friedman

    Reviewed By: jroelofs

    Subscribers: aemerson, rengolin, javed.absar, cfe-commits

    Differential Revision: — weimingz / ViewSVN
  3. Remove redundant `explicit`. — ruiu / ViewSVN

r302272 (#5730) (May 5, 2017 12:49:11 PM)

  1. CFI: Add a blacklist entry for std::_Sp_counted_ptr_inplace::_Sp_counted_ptr_inplace().

    This ctor is used by std::make_shared and needs to cast to uninitialized T*
    in order to call std::allocator_traits<T>::construct. — pcc / ViewSVN
  2. Make sure sdk is set on darwin

    I noticed in some places xcrun was not correctly picking the macOS sdk.
    Lets set that explicitly. — Chris Matthews / ViewSVN
  3. CodeGen: avoid use of @clang.arc.use intrinsic at O0

    The clang.arc.use intrinsic is removed via the ARC Contract Pass.  This
    pass is only executed in optimized builds (>= opt level 1).  Prevent the
    optimization implemented in SVN r301667 from triggering at optimization
    level 0 like every other ARC use intrinsic usage. — Saleem Abdulrasool / ViewSVN
  4. Fix LNT’s js to corrrectly determine base URL when server has a prefix

    There was a number of errors in the JS leading to a invalid prefix being
    generated at runtime. That made some of the URLs and ajax requests
    invalid. The prefix was being overwritten, and had the wrong value.

    Now we use a global determined by Flask (which should know these things)
    and update the urls to not overwrite each other. — Chris Matthews / ViewSVN
  5. Fix missing strftime in production — Chris Matthews / ViewSVN
  6. Simplify dbg.value handling in SDISel with early returns

    No functional change other than improving dbgs logging accuracy on
    constant dbg values. Previously we would add things like "i32 42" as
    debug values, and then log that we were dropping the debug info, which
    is silly.

    Delete some dead code that was checking for static allocas. This
    remained after r207165, but served no purpose. Currently, static alloca
    dbg.values are always sent through the DanglingDebugInfoMap, and are
    usually made valid the first time the alloca is used. — rnk / ViewSVN
  7. [WebAssembly] Add ObjectYAML support for wasm name section

    Differential Revision: — sbc / ViewSVN
  8. [bpf] fix a bug which causes incorrect big endian reloc fixup

      o Add bpfeb support in BPF dwarfdump unit test case

    Signed-off-by: Yonghong Song <>
    Signed-off-by: Alexei Starovoitov <> — ast / ViewSVN
  9. Add NetBSD to the list of platforms supporting death tests. Two unit
    tests require this for compilation. — joerg / ViewSVN
  10. If posix_fallocate returns EOPNOTSUPP, fallback to ftruncate.
    This can happen at least on NetBSD. — joerg / ViewSVN
  11. [KnownBits] Add wrapper methods for setting and clear all bits in the underlying APInts in KnownBits.

    This adds routines for reseting KnownBits to unknown, making the value all zeros or all ones. It also adds methods for querying if the value is zero, all ones or unknown.

    Differential Revision: — ctopper / ViewSVN
  12. [clang-tidy] Fix misc-move-const-arg for move-only types.

    Summary: Fix misc-move-const-arg false positives on move-only types.

    Reviewers: sbenza

    Reviewed By: sbenza

    Subscribers: xazax.hun, cfe-commits

    Differential Revision: — alexfh / ViewSVN
  13. Add missing 'arch' key to valid qHostInfo keys

    'arch' is a valid qHostInfo key, but the unit
    test for qHostInfo did not include it in the set of possible keys.

    Reviewers: tfiala, labath

    Subscribers: lldb-commits

    Differential Revision: — fjricci / ViewSVN
  14. ANSIfy more. Still no behavior change. — nico / ViewSVN
  15. ANSIfy. No behavior change. — nico / ViewSVN
  16. Allow operator-> to work from a FixedStreamArrayIterator.

    This is similar to my recent fix for VarStreamArrayIterator, but the cause
    (and thus the fix) is subtley different.  The FixedStreamArrayIterator
    iterates over a const Array, so the iterator's value type must be const. — amccarth / ViewSVN
  17. [Float2Int] Replace a ConstantRange copy with a move. Remove an extra call to MapVector::find. — ctopper / ViewSVN
  18. Warn that the [] spelling of uuid(...) is deprecated. — nico / ViewSVN
  19. [ADT] Add BitVector::find_prev.

    This almost completes the matrix of all possible find




    Differential Revision: — zturner / ViewSVN

r302253 (#5729) (May 5, 2017 11:19:37 AM)

  1. Add a fix-it for -Wunguarded-availability

    This patch adds a fix-it for the -Wunguarded-availability warning. This fix-it
    is similar to the Swift one: it suggests that you wrap the statement in an
    `if (@available)` check. The produced fixits are indented (just like the Swift
    ones) to make them look nice in Xcode's fix-it preview.


    Differential Revision: — arphaman / ViewSVN

r302252 (#5728) (May 5, 2017 10:15:22 AM)

  1. Add more variations of addcarry in the tests. NFC. — deadalnix / ViewSVN
  2. [InstSimplify] fix copy-paste mistake in test comments; NFC — spatel / ViewSVN
  3. [ObjC] Don't disallow vector parameters/return values in methods
    whose introduced version is lower than the allowed version.

    We should just rely on the target version as this introduced version can lead
    to false positives (e.g. deprecated declarations).

    rdar://31964333 — arphaman / ViewSVN
  4. [llvm-dwarfdump] - Add comment for maybeDecompress(). NFC.

    Addresses post commit review comment. — grimar / ViewSVN
  5. [InstSimplify] add tests for (icmp X, C1 | icmp X, C2); NFC

    These are the 'or' counterparts for the tests added with r300493. — spatel / ViewSVN
  6. Introduce Wzero-as-null-pointer-constant.

    Add an opt-in warning that fires when 0 is used as a null pointer.
    gcc has this warning, and there's some demand for it. — nico / ViewSVN
  7. fix build on Cygwin — nlopes / ViewSVN
  8. [AArch64] Remove AArch64AddressTypePromotion pass

    Remove the AArch64AddressTypePromotion pass as we migrated all transformations
    done in this pass into CGP in r299379.

    Reviewers: qcolombet, jmolloy, javed.absar, mcrosier

    Reviewed By: qcolombet

    Subscribers: aemerson, rengolin, mgorny, llvm-commits

    Differential Revision: — junbuml / ViewSVN
  9. Fix typo — grosser / ViewSVN
  10. [X86][SSE] Add 128/256/512 bit vector build vector from register tests — rksimon / ViewSVN

r302242 (#5727) (May 5, 2017 9:19:26 AM)

  1. Remember OffsetInArchive in LazyObjectFile.

    LazyObjectFile might turn out to be a BitcodeFile, so we need
    OffsetInArchive. — rafael / ViewSVN
  2. Use the archive offset with --whole-archive.

    The test ELF/lto/thin-archivecollision.ll was not testing what it
    wanted to test. It needs two archive members with the same name, but
    different offsets.

    Without this we could remove all references of OffsetInArchive and all
    tests would still pass.

    Fixing the test showed that the --whole-archive case was broken, which
    this patch fixes. — rafael / ViewSVN
  3. [Driver] Add a "-mmacos_version_min" option that's an alias for

    The option -mmacosx_version_min will still be the canonical option for now, but
    in the future we will switch over to -mmacos_version_min and make
    -mmacosx_version_min an alias instead.


    Differential Revision: — arphaman / ViewSVN
  4. [ubsan]: temporarily disable test

    Some problems with ARM stack unwinding led to inaccurate stack traces being
    printed, which caused this test to fail on — glider / ViewSVN
  5. [LoopIdiom] check for safety while expanding

    Loop Idiom recognition was generating memset in a case that
    would result generating a division operation to an unsafe location.

    Differential Revision: — hiraditya / ViewSVN

r302237 (#5726) (May 5, 2017 8:16:21 AM)

  1. [powerpc] Mark as XFAIL on powerpc64le

    When run this test case causes a segementation fault on powerpc64le.
    The xfail should be removed when the problem is fixed. — seurer / ViewSVN
  2. [Tooling] Remove redundant check, NFCi

    Summary: The Database check looks redundant.

    Reviewers: bkramer

    Subscribers: klimek, cfe-commits

    Differential Revision: — krasimir / ViewSVN
  3. Remember archive name when creating LazyObjectFile.

    It is needed for creating an unique identifier for ThinLTO.

    This fixes pr32931. — rafael / ViewSVN
  4. [ScopBuilder] Do not verify unfeasible SCoPs.

    SCoPs with unfeasible runtime context are thrown away and therefore
    do not need their uses verified.

    The added test case requires a complexity limit to exceed.
    Normally, error statements are removed from the SCoP and for that
    reason are skipped during the verification. If there is a unfeasible
    runtime context (here: because of the complexity limit being reached),
    the removal of error statements and other SCoP construction steps are
    skipped to not waste time. Error statements are not modeled in SCoPs
    and therefore have no requirements on whether the scalars used in
    them are available. — meinersbur / ViewSVN

r302233 (#5725) (May 5, 2017 7:20:39 AM)

  1. [X86][AVX512] Improve support and testing for CTLZ of 512-bit vectors without CDI — rksimon / ViewSVN
  2. Empty CMAKE_C_FLAGS_{build_type} when setting flags manually.

    This is for lnt runtest test-suite.
    When requesting specific compiler flags, users probably don't want
    whatever the cmake defaults are for a particular build type to be
    injected too into the build command line.
    For example, 'lnt runtest test-suite --cppflags="-O0 -g"', would still
    build the test-suite at -O3, since the test-suite sets CMAKE_BUILD_TYPE to
    RELEASE by default, which appends flags "-O3 -DNDEBUG" after "-O0 -g" on the
    command line (at least on my linux setup).
    To make sure that doesn't happen, clear the default build flags for
    all cmake build types, when the user requested specific build flags. — kbeyls / ViewSVN
  3. Fix handling of signWrappedSets in access relations

    Since r294891, in MemoryAccess::computeBoundsOnAccessRelation(), we skip
    manually bounding the access relation in case the parameter of the load
    instruction is already a wrapped set. Later on we assume that the lower
    bound on the set is always smaller or equal to the upper bound on the
    set. Bug 32715 manages to construct a sign wrapped set, in which case
    the assertion does not necessarily hold. Fix this by handling a sign
    wrapped set similar to a normal wrapped set, that is skipping the

    Contributed-by: Maximilian Falkenstein <>

    Reviewers: grosser

    Subscribers: pollydev, llvm-commits

    Tags: #Polly

    Differential Revision: — grosser / ViewSVN
  4. [X86] Remove duplicate operation actions. NFCI. — rksimon / ViewSVN
  5. [X86][AVX512CDI] Move v2i64/v4i64 and v4i32/v8i32 VPLZCNT lowering to tablegen

    Extend NoVLX targets to use the 512-bit versions — rksimon / ViewSVN
  6. Remove stale live-ins in the branch folder

    Hoisting common code can cause registers that live-in in the successor
    blocks to no longer be live-in. The live-in information needs to be
    updated to reflect this, or otherwise incorrect code can be generated
    later on.

    Differential Revision: — kparzysz / ViewSVN

r302227 (#5724) (May 5, 2017 6:25:00 AM)

  1. [ELF] - Accept --defsym foo=value form.

    Previously we accepted --defsym=foo=value only.

    Reported by Sean Silva. — grimar / ViewSVN
  2. Remove unused variable — rksimon / ViewSVN
  3. Fix segfault resulting from empty print prompt

    I have found a way to segfault lldb in 7 keystrokes! Steps to reproduce:
    1) Launch lldb
    2) Type `print` and hit enter. lldb will now prompt you to type a list of
        expressions, followed by an empty line.
    3) Hit enter, indicating the end of your input.
    4) Segfault!

    After some investigation, I've found the issue in Host/common/Editline.cpp.
    Editline::MoveCursor() relies on m_input_lines not being empty when the `to`
    argument is CursorPosition::BlockEnd. This scenario, as far as I can tell,
    occurs in one specific instance: In Editline::EndOrAddLineCommand() when the
    list of lines being processed contains exactly one string (""). Meeting this
    condition is fairly simple, I have posted steps to reproduce above.

    Reviewers: krytarowski, zturner, labath

    Reviewed By: labath

    Subscribers: scott.smith, lldb-commits

    Differential Revision:
    Patch by Alex Langford. — labath / ViewSVN

r302224 (#5723) (May 5, 2017 5:29:27 AM)

  1. [ARM] Add support for ORR and ORN instruction substitutions

    Recently support was added for substituting one intruction for another by
    negating or inverting the immediate, but ORR and ORN were missed so this patch
    adds them.

    This one is slightly different to the others in that ORN only exists in thumb,
    so we only do the substitution in thumb.

    Differential Revision: — john.brawn / ViewSVN
  2. Add TaskMap for iterating a function over a set of integers

    Many parallel tasks just want to iterate over all the possible numbers from 0 to N-1.  Rather than enqueue N work items, instead just "map" the function across the requested integer space.

    Reviewers: clayborg, labath, tberghammer, zturner

    Reviewed By: clayborg, zturner

    Subscribers: zturner, lldb-commits

    Differential Revision:
    Patch by Scott Smith <>. — labath / ViewSVN
  3. [X86][AVX] Add LowerIntUnary helpers to split unary vector ops in half. NFCI.

    Same as LowerIntArith helpers but for unary ops instead of binary. — rksimon / ViewSVN
  4. [llvm-dwarfdump] - Print an error message if section decompression failed.

    llvm-dwarfdump currently prints no message if decompression fails
    for some reason. I noticed that during work on one of LLD patches
    where LLD produced an broken output. It was a bit confusing to see
    no output for section dumped and no any error message at all.

    Patch adds error message for such cases.

    Differential revision: — grimar / ViewSVN
  5. ABISysV_arm64: compute return value for large vectors correctly

    Arm64 Procedure Call Standard specifies than only vectors up to 16 bytes
    are stored in v0 (which makes sense, as that's the size of the
    register). 32-byte vector types are passed as regular structs via x8
    pointer. Treat them as such.

    This fixes TestReturnValue for arm64-clang. I also split the test case
    into two so I can avoid the if(gcc) line, and annotate each test
    instead. (It seems the vector type tests fail with gcc only when
    targetting x86 arches).

    Reviewers: tberghammer, eugene

    Subscribers: aemerson, omjavaid, rengolin, srhines, lldb-commits

    Differential Revision: — labath / ViewSVN

r302219 (#5722) (May 5, 2017 4:00:41 AM)

  1. [X86] Remove unused code from X86 optimize LEAs. NFC.

    This patch removes unused code which is no longer required because of changes
    to the DIExpression::prepend function. — anng / ViewSVN

r302218 (#5721) (May 5, 2017 3:01:28 AM)

  1. [ubsan] Implement __sanitizer_print_stack_trace for standalone UBSan runtime.

    Patch by Max Moroz, reviewed at — glider / ViewSVN
  2. Revert "[Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGen"

    This reverts commit 17a84e414adb51ee375d14836d4c2a817b191933.

    Patches should have been submitted in the order of:

    1. D32852
    2. D32854
    3. D32431

    I mistakenly pushed D32431(3) first. Reverting to push in the correct
    order. — bollu / ViewSVN
  3. [ArgPromotion] Add a testcase for PR32917

    Differential Revision: — mstorsjo / ViewSVN

r302215 (#5720) (May 5, 2017 2:05:41 AM)

  1. [Polly] Added OpenCL Runtime to GPURuntime Library for GPGPU CodeGen

    When compiling for GPU, one can now choose to compile for OpenCL or CUDA,
    with the corresponding polly-gpu-runtime flag (libopencl / libcudart). The
    GPURuntime library (GPUJIT) has been extended with the OpenCL Runtime library
    for that purpose, correctly choosing the corresponding library calls to the
    option chosen when compiling (via different initialization calls).

    Additionally, a specific GPU Target architecture can now be chosen with -polly-gpu-arch (only nvptx64 implemented thus far).

    Reviewers: grosser, bollu, Meinersbur, etherzhhb, singam-sanjay

    Reviewed By: grosser, Meinersbur

    Subscribers: singam-sanjay, llvm-commits, pollydev, nemanjai, mgorny, yaxunl, Anastasia

    Tags: #polly

    Differential Revision: — bollu / ViewSVN

r302214 (#5719) (May 5, 2017 1:09:35 AM)

  1. Initialize new member X86Operand::FrontendSize in all codepaths.

    This fixes MSAN-builds after r302179. — djasper / ViewSVN

r302213 (#5718) (May 4, 2017 10:59:45 PM)

  1. Document XFAIL's with the relevent bug number — ericwf / ViewSVN

r302212 (#5717) (May 4, 2017 7:52:56 PM)

  1. [XRay][compiler-rt] Remove dependency on FileCheck from function id utilities tests

    Follow-up on D32846 to simplify testing and not rely on FileCheck to
    test boundary conditions, and instead do all the testing in code
    instead. — dberris / ViewSVN
  2. [ubsan] Fix error summary message for ObjC BOOL invalid loads — Vedant Kumar / ViewSVN
  3. [XRay][compiler-rt] Add function id utilities for XRay

    This change allows us to provide users and implementers of XRay handlers
    a means of converting XRay function id's to addresses. This, in
    combination with the facilities provided in D32695, allows users to find

      - How many function id's there are defined in the current binary.
      - Get the address of the function associated with this function id.
      - Patch only specific functions according to their requirements.

    While we don't directly provide symbolization support in XRay, having
    the function's address lets users determine this information easily
    either during runtime, or offline with tools like 'addr2line'.

    Reviewers: dblaikie, echristo, pelikan

    Subscribers: kpw, llvm-commits

    Differential Revision: — dberris / ViewSVN
  4. Update VP prof metadata during inlining.

    Summary: r298270 added profile update logic for branch_weights. This patch implements profile update logic for VP prof metadata too.

    Reviewers: eraman, tejohnson, davidxl

    Reviewed By: eraman

    Subscribers: llvm-commits

    Differential Revision: — dehao / ViewSVN

r302208 (#5716) (May 4, 2017 6:23:46 PM)

  1. [ADT] A few minor improvements to BitVector

    Fixes some spelling mistakes, uses a helper function, and
    adds an additional test case. — zturner / ViewSVN
  2. Document that Multilib flags must be actual flags

    This is because -print-multi-lib depends on them being flags for correctness.

    Fixes a case of this in the arm-android multilib selection logic. — jroelofs / ViewSVN
  3. [pdb] Don't verify TPI hash values up front.

    Verifying the hash values as we are currently doing
    results in iterating every type record before the user
    even tries to access the first one, and the API user
    has no control over, or ability to hook into this

    As a result, when the user wants to iterate over types
    to print them or index them, this results in a second
    iteration over the same list of types.  When there's
    upwards of 1,000,000 type records, this is obviously
    quite undesirable.

    This patch raises the verification outside of TpiStream
    , and llvm-pdbdump hooks a hash verification visitor
    into the normal dumping process.  So we still verify
    the hash records, but we can do it while not requiring
    a second iteration over the type stream.

    Differential Revision: — zturner / ViewSVN
  4. [PDB] Don't build the entire source file list up front.

    I tried to run llvm-pdbdump on a very large (~1.5GB) PDB to
    try and identify show-stopping performance problems.  This
    patch addresses the first such problem.

    When loading the DBI stream, before anyone has even tried to
    access a single record, we build an in memory map of every
    source file for every module.  In the particular PDB I was
    using, this was over 85 million files.  Specifically, the
    complexity is O(m*n) where m is the number of modules and
    n is the average number of source files (including headers)
    per module.

    The whole reason for doing this was so that we could have
    constant time access to any module and any of its source
    file lists.  However, we can still get O(1) access to the
    source file list for a given module with a simple O(m)
    precomputation, and access to the list of modules is
    already O(1) anyway.

    So this patches reduces the O(m*n) up-front precomputation
    to an O(m) one, where n is ~6,500 and n*m is about 85 million
    in my pathological test case.

    Differential Revision: — zturner / ViewSVN
  5. [llvm-pdbdump] Only build the TypeDatabase if necessary.

    Building the type database is expensive, and can take multiple
    minutes for large PDBs.  But we only need it in certain cases
    depending on what command line options are specified.  So only
    build it when we know we're about to need it. — zturner / ViewSVN
  6. Remap metadata attached to global variables.

    Fix for PR32577.
    Global variables may have !associated metadata, which includes a reference to another global. It needs remapping. — eugenis / ViewSVN

r302202 (#5715) (May 4, 2017 4:54:39 PM)

  1. [RegisterBankInfo] Fix 80-col introduced in r293506.

    NFC. — qcolombet / ViewSVN
  2. [GlobalISel] Add missing doxygen keyword for doxygen groups.

    NFC — qcolombet / ViewSVN
  3. AMDGPU: GFX9 GS and HS shaders always have the scratch wave offset in SGPR5

    Reviewers: arsenm, nhaehnle

    Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

    Differential Revision: — mareko / ViewSVN
  4. [GISel]:Skip legalizing Intermediate inst(with generic types)

    During legalization, targets can create Pseudo Instructions with
    generic types. We shouldn't try to legalize them.

    Reviewed by Quentin, dsanders — aditya_nandakumar / ViewSVN
  5. [JumpThreading] When processing compares, explicitly check that the result type is not a vector rather than check for it being an integer.

    Compares always return a scalar integer or vector of integers. isIntegerTy returns false for vectors, but that's not completely obvious. So using isVectorTy is less confusing. — ctopper / ViewSVN
  6. [JumpThreading] Change a dyn_cast that is already protected by an isa check to a static cast. Combine the with another static cast. NFC

    Differential Revision: — ctopper / ViewSVN
  7. [GISel]: Add support to translate ConstantVectors

    Reviewed by Quentin — aditya_nandakumar / ViewSVN
  8. Fix whitespace before token-paste of an argument.

    The whitespace should come from the argument name in the macro
    expansion, rather than from the token passed to the macro (same as it
    does when not pasting).

    Added a new test case for the change in behavior to stringize_space.c.

    FileCheck'ized macro_paste_commaext.c, tweaked the test case, and
    added a comment; no behavioral change to this test.

    Differential Revision: — jyknight / ViewSVN
  9. [ConstantRange] Add LLVM_NODISCARD to ConstantRange since a large number of its methods construct new ConstantRange objects. — ctopper / ViewSVN
  10. [Float2Int] Remove return of ConstantRange from seen method. Nothing uses it so it just creates and discards a ConstantRange object for no reason. — ctopper / ViewSVN

r302192 (#5714) (May 4, 2017 3:25:21 PM)

  1. Strip trailing whitespace. NFCI. — rksimon / ViewSVN
  2. [clangd] Add documentation page

    Add a simple documentation page for Clangd.
    This will be useful for interested users and contributors to get basic information about how
    to get started and the progress of Clangd.

    Reviewers: krasimir, bkramer

    Reviewed By: krasimir

    Subscribers: Prazek, jbcoe, JDevlieghere, mgehre, JonasToth, kromanenkov, xazax.hun, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — malaperle / ViewSVN

r302190 (#5713) (May 4, 2017 1:56:14 PM)

  1. Turn on -Wmicrosoft-enum-forward-reference by default.

    clang-cl already errs or warns on everything that cl
    warns on in /permissive- mode, except for enum foward
    declarations (and ATL attributes).
    So warn on enum forward declarations by default. — nico / ViewSVN
  2. [InstSimplify] add folds for or-of-casted-icmps

    The sibling folds for 'and' with casts were added with
    This is a preliminary step for adding the 'or' variants for the folds added with

    The reason for the strange form with constant LHS in the 1st test is because there's another missing fold in that
    case for the inverted predicate. That should be fixed when we add the ConstantRange functionality for 'or-of-icmps'
    that already exists for 'and-of-icmps'.

    I'm hoping to share more code for the and/or cases, so we won't have these differences. This will allow us to remove
    code from InstCombine. It's also possible that we can remove some code here in InstSimplify. I think we have some
    duplicated folds because patterns are not matched in a general way.

    Differential Revision: — spatel / ViewSVN
  3. Fix bugs checking va_start in lambdas and erroneous contexts

    First, getCurFunction looks through blocks and lambdas, which is wrong.
    Inside a lambda, va_start should refer to the lambda call operator
    prototype. This fixes PR32737.

    Second, we shouldn't use any of the getCur* methods, because they look
    through contexts that we don't want to look through (EnumDecl,
    CapturedStmtDecl). We can use CurContext directly as the calling

    Finally, this code assumed that CallExprs would never appear outside of
    code contexts (block, function, obj-c method), which is wrong. Struct
    member initializers are an easy way to create and parse exprs in a
    non-code context.

    Reviewers: rsmith

    Subscribers: cfe-commits

    Differential Revision: — rnk / ViewSVN
  4. Turn -Wmicrosoft-enum-value off by default.

    The warning is currently way too noisy to be useful. The plan is
    to make it warn when an MS enum that's negative is compared to
    something, but until that's done the warning shouldn't default
    to on. — nico / ViewSVN
  5. Simplify the header allocation.

    In the non linker script case we would try very early to find out if
    we could allocate the headers. Failing to do that would add extra
    alignment to the first ro section, since we would set PageAlign
    thinking it was the first section in the PT_LOAD.

    In the linker script case the header allocation must be done in the
    end, causing some duplication.

    We now tentatively add the headers to the first PT_LOAD and if it
    turns out they don't fit, remove them. With this we only need to
    allocate the headers in one place in the code. — rafael / ViewSVN
  6. [WebAssembly] Add wasm symbol table support to llvm-objdump

    Differential Revision: — sbc / ViewSVN

r302184 (#5711) (May 4, 2017 1:16:23 PM)

  1. Driver: only inject libstdc++ paths when needed on CrossWindows

    When building with libc++ don't bother with injecting the libstdc++
    search paths into the linker search path.  This will make it easier to
    switch between ld and lld. — Saleem Abdulrasool / ViewSVN
  2. [PPC] When restoring R30 (PIC base pointer), mark it as <def>

    This happened on the PPC32/SVR4 path and was discovered when building
    FreeBSD on PPC32. It was a typo-class error in the frame lowering code.

    This fixes PR26519. — kparzysz / ViewSVN
  3. Fix test failure with GCC 4.9 — ericwf / ViewSVN
  4. Change Appveyor to download Clang from instead of my private server — ericwf / ViewSVN
  5. Don't return an invalid line table if the DW_AT_stmt_list value is not in the .debug_line section. — gclayton / ViewSVN
  6. [ms-inline-asm] Use the frontend size only for ambiguous instructions

    This avoids problems on code like this:
      char buf[16];
      __asm {
        movups xmm0, [buf]
        mov [buf], eax

    The frontend size in this case (1) is wrong, and the register makes the
    instruction matching unambiguous. There are also enough bytes available
    that we shouldn't complain to the user that they are potentially using
    an incorrectly sized instruction to access the variable.

    Supersedes D32636 and D26586 and fixes PR28266 — rnk / ViewSVN
  7. [InstSimplify] move logic-of-icmps helper functions; NFC

    Putting these next to each other should make it easier to see
    what's missing from each side. Patch to plug one of those holes
    should be posted soon. — spatel / ViewSVN
  8. [powerpc] Reactivate ppc64le lnt buildbot

    The tests that were flakey have been disabled.  Initially this will be run
    on the silent master. — seurer / ViewSVN
  9. Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
    with a fix for the clang backend. — pcc / ViewSVN
  10. Fix a typo. — Michael Zolotukhin / ViewSVN

r302174 (#5710) (May 4, 2017 12:09:24 PM)

  1. [InstSimplify] add tests for or-of-casted-icmps; NFC — spatel / ViewSVN
  2. [NewGVN] Remove unneeded newline and format assertions. NFCI. — davide / ViewSVN
  3. Add markup for libc++ dylib availability

    Libc++ is used as a system library on macOS and iOS (amongst others). In order
    for users to be able to compile a binary that is intended to be deployed to an
    older version of the platform, clang provides the
    availability attribute <>_
    that can be placed on declarations to describe the lifecycle of a symbol in the

    See docs/DesignDocs/AvailabilityMarkup.rst for more information.

    Differential Revision: — Mehdi Amini / ViewSVN
  4. [APInt] Reduce number of allocations involved in multiplying. Reduce worst case multiply size

    Currently multiply is implemented in operator*=. Operator* makes a copy and uses operator*= to modify the copy.

    Operator*= itself allocates a temporary buffer to hold the multiply result as it computes it. Then copies it to the buffer in *this.

    Operator*= attempts to bound the size of the result based on the number of active bits in its inputs. It also has a couple special cases to handle 0 inputs without any memory allocations or multiply operations. The best case is that it calculates a single word regardless of input bit width. The worst case is that it calculates the a 2x input width result and drop the upper bits.

    Since operator* uses operator*= it incurs two allocations, one for a copy of *this and one for the temporary allocation. Neither of these allocations are kept after the method operation is done.

    The main usage in the backend appears to be ConstantRange::multiply which uses operator* rather than operator*=.

    This patch moves the multiply operation to operator* and implements operator*= using it. This avoids the copy in operator*. operator* now allocates a result buffer sized the same width as its inputs no matter what. This buffer will be used as the buffer for the returned APInt. Finally, we reuse tcMultiply to implement the multiply operation. This function is capable of not calculating additional upper words that will be discarded.

    This change does lose the special optimizations for the inputs using less words than their size implies. But it also removed the getActiveBits calls from all multiplies. If we think those optimizations are important we could look at providing additional bounds to tcMultiply to limit the computations.

    Differential Revision: — ctopper / ViewSVN
  5. [PM] Add ProfileSummaryAnalysis as a required pass in the new pipeline.

    Differential revision: — eraman / ViewSVN
  6. [Lexicon] Add BDCE

    Summary: Add an entry to the Lexicon for "BDCE."

    Reviewers: jmolloy, hfinkel

    Reviewed By: jmolloy

    Differential Revision: — modocache / ViewSVN

r302168 (#5709) (May 4, 2017 10:52:01 AM)

  1. Use lgamma_r instead of lgamma in binomial_distribution, because freakin' POSIX took a perfectly fine call and made it not thread safe. — marshall / ViewSVN
  2. Add accidentally deleted testcase back. — Adrian Prantl / ViewSVN
  3. Cleanup tests to not share a DISubprogram between multiple Functions.

    rdar://problem/31926379 — Adrian Prantl / ViewSVN
  4. [test-release] Status update *before* long gzip — rengolin / ViewSVN
  5. [clang-tidy] fix readability-implicit-bool-cast false positive with xor — alexfh / ViewSVN
  6. [ScopBuilder] Add missing semicolon after LLVM_FALLTHROUGH.

    It was forgotten in r302157. — meinersbur / ViewSVN
  7. [test] Name the local variable in the C1XX implementation of DoNotOptmize

    Differential Revision: — caseycarter / ViewSVN

r302161 (#5708) (May 4, 2017 9:44:03 AM)

  1. [clang-tidy] fix readability-implicit-bool-cast false alarm on |=, &= — alexfh / ViewSVN
  2. [clang-tidy] Code cleanup, (almost) NFC (*).

    (*) Printed types of member pointers don't use elaborated type specifiers
    (`int struct S::*` -> `int S::*`). — alexfh / ViewSVN
  3. [Tooling] add a createReplacement overload for StringRef — alexfh / ViewSVN
  4. [test] variant: enable constexpr construction tests on MSVC STL

    * Add a new macro _MSVC_STL_VER to detect when the MSVC STL is being tested
    * Workaround C1XX __is_trivially_copyable bug — caseycarter / ViewSVN
  5. Introduce VirtualUse. NFC.

    If a ScopStmt references a (scalar) value, there are multiple
    possibilities where this value can come. The decision about what kind of
    use it is must be handled consistently at different places, which can be
    error-prone. VirtualUse is meant to centralize the handling of the
    different types of value uses.

    This patch makes ScopBuilder and CodeGeneration use VirtualUse. This
    already helps to show inconsistencies with the value handling. In order
    to keep this patch NFC, exceptions to the general rules are added.
    These might be fixed later if they turn to problems. Overall, this
    should result in fewer post-codegen IR-verification errors, but instead
    assertion failures in `getNewValue` that are closer to the actual error.

    Differential Revision: — meinersbur / ViewSVN
  6. clang-format: [JS] exponentiation operator

    Summary: While its precedence should be higher than multiplicative, LLVM does not have a level for that, so for the time being just treat it as multiplicative.

    Reviewers: djasper

    Subscribers: cfe-commits, klimek

    Differential Revision: — mprobst / ViewSVN

r302155 (#5707) (May 4, 2017 8:44:40 AM)

  1. Reduce code duplication. NFC. — rafael / ViewSVN
  2. [globalisel][tablegen] Add several GINodeEquiv's for operators that do not require additional support.

    As of this patch, 350 out of 3938 rules are currently imported.

    Depends on D32229

    Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

    Reviewed By: ab

    Subscribers: dberris, llvm-commits, igorb

    Differential Revision: — dsanders / ViewSVN
  3. [DAGCombine] Transform (fadd A, (fmul B, -2.0)) -> (fsub A, (fadd B, B)).

    Differential Revision: — mcrosier / ViewSVN

r302152 (#5706) (May 4, 2017 7:54:20 AM)

  1. [ASAN] Add interceptor for __longjmp_chk

    glibc on Linux calls __longjmp_chk instead of longjmp (or _longjmp) when
    _FORTIFY_SOURCE is defined. Ensure that an ASAN-instrumented program
    intercepts this function when a system library calls it, otherwise the
    stack might remain poisoned and result in CHECK failures and false


    Reviewed By: eugenis

    Differential Revision: — lekensteyn / ViewSVN
  2. DiagnosticsEngine should clear DelayedDiagID before reporting the
    delayed diagnostic

    This fix avoids an infinite recursion that was uncovered in one of our internal
    tests by r301992. The testcase is the most reduced version of that
    auto-generated test.

    This is an improved version of the reverted commit r302037. The previous fix
    actually managed to expose another subtle bug whereby `fatal_too_many_errors`
    error was reported twice, with the second report setting the
    `FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic
    the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes
    that follow `fatal_too_many_errors` but that belong to the diagnostic that
    caused `fatal_too_many_errors` won't be emitted by setting the
    `FatalErrorOccurred` when emitting `fatal_too_many_errors`.

    rdar://31962618 — arphaman / ViewSVN
  3. [X86][AVX512] Fix VPABSD file checks

    Fix capitalization and string matching — rksimon / ViewSVN
  4. [X86][SSE] Add i686 triple tests for partial vector and re-association — rksimon / ViewSVN
  5. Refactoring with range-based for, NFC

    Patch by Wei-Ren Chen.

    Differential Revision: — kparzysz / ViewSVN
  6. [compiler-rt][mips] Add support for quad precision builtins for mips64

    Match the builtins that GCC provides for IEEE754 quad precision
    on MIPS64. Also, enable building them with clang as PR20098 is resolved.

    Disable tests for xf and xc modes as MIPS doesn't support that mode in
    hardware or software.

    Reviewers: slthakur

    Differential Revision: — sdardis / ViewSVN
  7. [SystemZ]  Make copyPhysReg() add impl-use operands of super reg.

    When a 128 bit COPY is lowered into two instructions, an impl-use operand of
    the super-reg should be added to each new instruction in case one of the
    sub-regs is undefined.

    Review: Ulrich Weigand — jonpa / ViewSVN

r302145 (#5705) (May 4, 2017 7:03:58 AM)

  1. [X86][SSE] Add i686 triple tests for PBLENDW commutation — rksimon / ViewSVN
  2. [X86][AVX1] Regenerate checks and add i686 triple tests for folded logical ops — rksimon / ViewSVN
  3. Add support of the next Ubuntu (Ubuntu 17.10 - Artful Aardvark) — sylvestre / ViewSVN

    The test subdirectory POLLY_TEST_DIRECTORIES was heavily outdated and
    only used in out-of-LLVM-tree builds
    (to generate polly-test-${subdir} targets). — meinersbur / ViewSVN
  5. Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."

    This reverts commit r302108. — ioeric / ViewSVN
  6. Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."

    This reverts commit r302108. This causes crash in clang bootstrap with LTO.

    Contacted the auther in the original commit. — ioeric / ViewSVN
  7. [LLDB][MIPS] Fix failure.

    Reviewers: jingham, labath

    Subscribers: jaydeep, bhushan, lldb-commits, slthakur

    Differential Revision: — nitesh.jain / ViewSVN

r302138 (#5704) (May 4, 2017 5:42:57 AM)

  1. [mips][XRay] Use the base version of emitXRayTable

    Follow up rL290858 by removing the MIPS specific version of XRayTable
    emission in favour of the basic version.

    This resolves a buildbot failure where the ELF sections were malformed
    causing the linker to reject the object files with xray related sections.

    Reviewers: dberris, slthakur

    Differential Revision: — sdardis / ViewSVN

r302137 (#5703) (May 4, 2017 4:52:40 AM)

  1. [ArgPromotion] Fix a truncated variable

    This fixes a regression since SVN rev 273808 (which was supposed to
    not change functionality).

    The regression caused miscompilations (noted in the wild when targeting
    AArch64) on platforms with 32 bit long.

    Differential Revision: — mstorsjo / ViewSVN
  2. [Index] The relation between the declarations in template
    specializations that 'override' declarations in the base template should use
    the 'specializationOf' relation instead of 'specializationOf | overrideOf'.

    The indexer relations are meant to be orthogonal, so 'specializationOf' is
    better than the combined relation. — arphaman / ViewSVN
  3. [LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'

    In this patch, I introduce a new altmacro string delimiter.
    This review is the second review in a series of four reviews.
    (one for each altmacro feature: LOCAL, string delimiter, string '!' escape sign and absolute expression as a string '%' ).

    In the alternate macro mode, you can delimit strings with matching angle brackets <..>
    when using it as a part of calling macro arguments.

    As described in the
    You can delimit strings with matching angle brackets."


    1. If an argument begins with '<' and ends with '>'. The argument is considered as a string.
    2. Except adding new string mark '<..>', a regular macro behavior is expected.
    3. The altmacro cannot affect the regular less/greater behavior.
    4. If a comma is present inside an angle brackets it considered as a character and not as a separator.

    Differential Revision: — mzuckerm / ViewSVN

r302134 (#5702) (May 4, 2017 4:01:23 AM)

  1. [ScopDetection] Check for already known required-invariant loads [NFC]

    For certain test cases we spent over 50% of the scop detection time in
    checking if a load is likely invariant. We can avoid most of these checks by
    testing early on if a load is expected to be invariant. Doing this reduces
    scop-detection time on a large benchmark from 52 seconds to just 25 seconds.

    No functional change is expected. — grosser / ViewSVN
  2. MainLoop: Add unit tests

    This adds a couple of unit tests to the MainLoop class. To get the
    kqueue based version of the signal handling passing, I needed to
    modify the implementation a bit to make the queue object persistent.
    Otherwise, only the signals which are send during the Run call would get
    processed, which did not match the ppoll behaviour.

    I also took the opportunity to remove the ForEach template functions and
    replace them with something more reasonable.

    Reviewers: beanz, eugene

    Subscribers: lldb-commits, mgorny

    Differential Revision: — labath / ViewSVN
  3. Adjust test case to not trigger the SCEV optimization committed in r302096

    This makes sure we still test the case that a PHI-NODE cannot be analyzed by
    scalar evolution and consequently must be code generated explicitly.  As
    Michael's optimization triggers only on a very specific "add %iv, %step"
    pattern, just changing 'add' to 'mul' adds back test coverage. — grosser / ViewSVN

r302131 (#5701) (May 4, 2017 2:33:18 AM)

  1. [ARM] ACLE Chapter 9 intrinsics

    Implemented the remaining integer data processing intrinsics from
    the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style

    Differential Revision: — sam_parker / ViewSVN
  2. Dummy commit to trigger CMake reconfiguration and unbreak Sphinx build — ericwf / ViewSVN
  3. Fix incorrect usage of __libcpp_mutex_trylock. Patch from Andrey Khalyavin — ericwf / ViewSVN
  4. Update Appveyor bot link to point to new llvm-mirror Appveyor account — ericwf / ViewSVN
  5. [X86][AVX-512] Allow EVEX encoded instruction selection when available for mul v8i32.

    Differential Revision: — ibreger / ViewSVN
  6. [ARM] ACLE Chapter 9 intrinsics

    Added the integer data processing intrinsics from ACLE v2.1 Chapter 9
    but I have missed out the saturation_occurred intrinsics for now. For
    the instructions that read and write the GE bits, a chain is included
    and the only instruction that reads these flags (sel) is only
    selectable via the implemented intrinsic.

    Differential Revision: — sam_parker / ViewSVN
  7. [OpenCL] Add intel_reqd_sub_group_size attribute support

    Add intel_reqd_sub_group_size attribute support as intel extension  cl_intel_required_subgroup_size from

    Reviewers: Anastasia, bader, hfinkel, pxli168

    Reviewed By: Anastasia, bader, pxli168

    Subscribers: cfe-commits, yaxunl

    Differential Revision: — pxl / ViewSVN
  8. [X86] Disabling PLT in Regcall CC Functions

    According to psABI, PLT stub clobbers XMM8-XMM15.
    In Regcall calling convention those registers are used for passing parameters.
    Thus we need to prevent lazy binding in Regcall.

    Differential Revision: — orenb / ViewSVN

r302123 (#5700) (May 4, 2017 1:06:35 AM)

  1. [AVX-512VL] Autogenerate checks. Add --show-mc-encoding to check instruction predicate. — ibreger / ViewSVN
  2. test commit — ericwf / ViewSVN
  3. [XRay][compiler-rt][NFC] Update comments to doxygen format; group functions better. — dberris / ViewSVN
  4. test commit — ericwf / ViewSVN
  5. [AVX] Fix vpcmpeqq predicate.

    Fix vpcmpeqq predicate. AVX512 version of vpcmpeqq is not equivalent to AVX one.
    Split from

    Reviewers: craig.topper, zvi, aymanmus

    Reviewed By: craig.topper

    Subscribers: llvm-commits

    Differential Revision: — ibreger / ViewSVN
  6. [libcxxabi][CMake] Set library dir when built under runtimes/

    This will put libraries into the build root's lib/ directory by default.

    Differential Revision: — hahnfeld / ViewSVN
  7. [libcxx][CMake] Set library dir when built under runtimes/

    This will put libraries into the build root's lib/ directory by default.

    Differential Revision: — hahnfeld / ViewSVN
  8. update buildbot doc to link to the new Appveyor builders — ericwf / ViewSVN

r302115 (#5699) (May 3, 2017 11:45:29 PM)

  1. Attempt to enable the LIT progress bar on Appveyor — ericwf / ViewSVN
  2. Use right function in LoopVectorize.

    -    unsigned AS = getMemInstAlignment(I);
    +    unsigned AS = getMemInstAddressSpace(I);

    Review: Hal Finkel — jonpa / ViewSVN
  3. Setup Appveyor bot for MSVC 2017 and MSVC 2015 — ericwf / ViewSVN
  4. [XRay][compiler-rt] Support patching/unpatching specific functions

    This change allows us to patch/unpatch specific functions using the
    function ID. This is useful in cases where implementations might want to
    do coverage-style, or more fine-grained control of which functions to
    patch or un-patch at runtime.

    Depends on D32693.

    Reviewers: dblaikie, echristo, kpw

    Subscribers: llvm-commits

    Differential Revision: — dberris / ViewSVN
  5. [XRay] Use wordsize-dependent alignment for index

    This makes it simpler for the runtime to consistently handle the entries
    in the function sled index in both 32 and 64 bit platforms where the
    XRay runtime works.

    Follow-up on D32693. — dberris / ViewSVN

r302110 (#5698) (May 3, 2017 10:25:02 PM)

  1. [SelectionDAG] Improve known bits support for CTPOP.

    This is based on the same concept from ValueTracking's version of computeKnownBits. — ctopper / ViewSVN

r302109 (#5697) (May 3, 2017 9:34:43 PM)

  1. [XRay] Create an Index of sleds per function

    This change adds a new section to the xray-instrumented binary that
    stores an index into ranges of the instrumentation map, where sleds
    associated with the same function can be accessed as an array. At
    runtime, we can get access to this index by function ID offset allowing
    for selective patching and unpatching by function ID.

    Each entry in this new section (xray_fn_idx) will include two pointers
    indicating the start and one past the end of the sleds associated with
    the same function. These entries will be 16 bytes long on x86 and
    aarch64. On arm, we align to 16 bytes anyway so the runtime has to take
    that into consideration.

    __{start,stop}_xray_fn_idx will be the symbols that the runtime will
    look for when we implement the selective patching/unpatching by function
    id APIs. Because XRay synthesizes the function id's in a monotonically
    increasing manner at runtime now, implementations (and users) can use
    this table to look up the sleds associated with a specific function.
    This is useful in implementations that want to do things like:

      - Implement coverage mode for functions by patching everything
        pre-main, then as functions are encountered, the installed handler
        can unpatch the function that's been encountered after recording
        that it's been called.
      - Do "learning mode", so that the implementation can figure out some
        statistical information about function calls by function id for a
        time being, and then determine which functions are worth
        uninstrumenting at runtime.
      - Do "selective instrumentation" where an implementation can
        specifically instrument only certain function id's at runtime
        (either based on some external data, or through some other
        heuristics) instead of patching all the instrumented functions at

    Reviewers: dblaikie, echristo, chandlerc, javed.absar

    Subscribers: pelikan, aemerson, kpw, llvm-commits, rengolin

    Differential Revision: — dberris / ViewSVN
  2. IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI.

    When profiling a no-op incremental link of Chromium I found that the functions
    computeImportForFunction and computeDeadSymbols were consuming roughly 10% of
    the profile. The goal of this change is to improve the performance of those
    functions by changing the map lookups that they were previously doing into
    pointer dereferences.

    This is achieved by changing the ValueInfo data structure to be a pointer to
    an element of the global value map owned by ModuleSummaryIndex, and changing
    reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs.
    This means that a ValueInfo will take a client directly to the summary list
    for a given GUID.

    Differential Revision: — pcc / ViewSVN

r302107 (#5696) (May 3, 2017 8:39:48 PM)

  1. Fix accounting of tbss.

    We were correctly computing the size contribution of a .tbss input
    section (it is none), but we were incorrectly considering the
    alignment of the output section: it was advancing Dot instead of

    As far as I can tell this was always wrong in our linkerscript
    implementation, but that became more visible now that the code is
    shared with the non linker script case. — rafael / ViewSVN
  2. llvm/IR/Function.h: Prune an obsolete @param in r302060. [-Wdocumentation] — chapuni / ViewSVN
  3. [libcxx] [test] Strip trailing whitespace. NFC. — stl_msft / ViewSVN
  4. [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.

    _HAS_CXX17 indicates whether MSVC's STL is in C++17 mode.

    In MSVC there's a distinction between CRT headers like stdlib.h and STL headers
    like cstdlib. Only the STL headers drag in yvals.h, our internal STL-wide header
    that defines internal macros like _HAS_CXX17.

    _HAS_CXX17 is an MSVC STL library macro, unconditionally defined. We centralize
    everything on this, because we have to ask different questions to determine
    whether C1XX, EDG, or Clang is in 14 or 17 mode, and we additionally permit
    users to override the detection in one way (it's okay to ask for 17 from the
    compiler, but only 14 from the libs, at least for the moment; only noexcept
    in the type system will give us a headache).

    As this header is for testing MSVC's STL, we can assume _HAS_CXX17 is defined.

    Fixes D32726. — stl_msft / ViewSVN
  5. [XRay] Detect loops in functions being lowered

    This is an implementation of the loop detection logic that XRay needs to
    determine whether a function might take time at runtime. Without this
    heuristic, XRay will tend to not instrument short functions that have
    loops that might have runtime dependent on inputs or external values.

    While this implementation doesn't do any further analysis than just
    figuring out whether there is a loop in the MachineFunction being
    code-gen'ed, we're paving the way for being able to perform more
    sophisticated analysis of the function in the future (for example to
    determine whether the trip count for the loop might be constant, and
    make a decision on that instead). This enables us to cover more
    functions with the default heuristics, and potentially identify ones
    that have variable runtime latency just by looking for the presence of

    Reviewers: chandlerc, rnk, pelikan

    Subscribers: llvm-commits

    Differential Revision: — dberris / ViewSVN
  6. Attempt to escape paths correctly — ericwf / ViewSVN
  7. Attempt to setup MSVC 2017 — ericwf / ViewSVN

r302100 (#5695) (May 3, 2017 6:56:56 PM)

  1. Use nullptr instead of the literal 0 — ericwf / ViewSVN
  2. Fix macro redefinition warnings for _LIBCPP_NO_RTTI — ericwf / ViewSVN
  3. Add #pragma clang module begin/end pragmas and generate them when preprocessing a module.

    These pragmas are intended to simulate the effect of entering or leaving a file
    with an associated module. This is not completely implemented yet: declarations
    between the pragmas will not be attributed to the correct module, but macro
    visibility is already functional.

    Modules named by #pragma clang module begin must already be known to clang (in
    some module map that's either loaded or on the search path). — rsmith / ViewSVN
  4. Test commit for Appveyor - Remove incorrect caching logic — ericwf / ViewSVN
  5. [SCEV] createAddRecFromPHI: Optimize for the most common case.

    The existing implementation creates a symbolic SCEV expression every
    time we analyze a phi node and then has to remove it, when the analysis
    is finished. This is very expensive, and in most of the cases it's also
    unnecessary. According to the data I collected, ~60-70% of analyzed phi
    nodes (measured on SPEC) have the following form:
      PN = phi(Start, OP(Self, Constant))
    Handling such cases separately significantly speeds this up.

    Reviewers: sanjoy, pete

    Subscribers: llvm-commits

    Differential Revision: — Michael Zolotukhin / ViewSVN
  6. CMake: Only add test/ subdirectory when it exists

    r296685 started adding the test/ subdirectory even when
    LIBCXX_INCLUDE_TESTS=OFF.  This is great for testing libcxx standalone,
    but it also breaks the build when the test/ subdirectory is removed
    (and our submission system strips all test/ directories).

    This patch updates the logic to check for test/ before adding it.

    rdar://problem/31931366 — Duncan P. N. Exon Smith / ViewSVN
  7. strlen-1.ll: Fix test

    Change test for `strlen(x) == 0 --> *x == 0` to actually test the
    pattern. — matze / ViewSVN

r302093 (#5694) (May 3, 2017 5:26:29 PM)

  1. [InstCombine][KnownBits] Use KnownBits better to detect nsw adds

    Change checkRippleForAdd from a heuristic to a full check -
    if it is provable that the add does not overflow return true, otherwise false.

    Patch by Yoav Ben-Shalom

    Differential Revision: — ctopper / ViewSVN
  2. Mark functions as not having CFI once we finalize an x86 stack frame

    We'll set it back to true in emitPrologue if it gets called. It doesn't
    get called for naked functions.

    Fixes PR32912 — rnk / ViewSVN
  3. [KnownBits] Add methods for determining if KnownBits is a constant value

    This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.

    Differential Revision: — ctopper / ViewSVN
  4. Remove a comment that is no longer true. — ruiu / ViewSVN
  5. [ValueTracking] Remove handling for BitWidth being 0 in ComputeSignBit and isKnownNonZero.

    I don't believe its possible to have non-zero values here since DataLayout became required. The APInt constructor inside of the KnownBits object will assert if this ever happens. — ctopper / ViewSVN
  6. [KnownBits] Add zext, sext, and trunc methods to KnownBits

    This patch adds zext, sext, and trunc methods to KnownBits and uses them where possible.

    Differential Revision: — ctopper / ViewSVN
  7. [TargetLowering] use isSubsetOf in SimplifyDemandedBits; NFCI

    This is the DAG equivalent of ,
    which will hopefully be committed again. The functionality
    (preferring a 'not' op) is already here in the DAG, so this is
    just intended to be a clean-up and performance improvement. — spatel / ViewSVN
  8. clang-format and restyle DWARFFormValue before working on it. NFC — probinson / ViewSVN
  9. DebugInfo: elide type index entries for synthetic types

    Compiler emitted synthetic types may not have an associated DIFile
    (translation unit).  In such a case, when generating CodeView debug type
    information, we would attempt to compute an absolute filepath which
    would result in a segfault due to a NULL DIFile*.  If there is no source
    file associated with the type, elide the type index entry for the type
    and record the type information.  This actually results in higher
    fidelity debug information than clang/C2 as of this writing.

    Resolves PR32668! — Saleem Abdulrasool / ViewSVN

r302084 (#5693) (May 3, 2017 3:56:45 PM)

  1. Attempt to fix appveyor build — ericwf / ViewSVN
  2. Accept archive files with no symbol table instad of warning on them.

    It seems virtually everyone who tries to do LTO build with Clang and
    LLD was hit by a mistake to forget using llvm-ar command to create
    archive files. I wasn't an exception. Since this is an annoying common
    issue, it is probably better to handle that gracefully rather than
    reporting an error and tell the user to redo build with different

    Differential Revision: — ruiu / ViewSVN
  3. Qualify calls to __invoke, __apply_fuctor, and __mu — ericwf / ViewSVN
  4. [AArch64] Fix variable name ambiguity in r302078.

    ArchKind is passed to the function, but it's also a type. — Ahmed Bougacha / ViewSVN
  5. [TailCallElim] Remove an unused argument. NFCI — trentxintong / ViewSVN
  6. [Driver] Update AArch64 testcase to match llvm r302078. — Ahmed Bougacha / ViewSVN
  7. [AArch64] Make the TargetParser add CPU exts provided by the arch.

    Otherwise, each CPU has to manually specify the extensions it supports,
    even though they have to be a superset of the base arch extensions.
    And when there's redundant data there's stale data, so most of the CPUs
    lie about the features they support (almost none lists AEK_FP).

    Instead, do the saner thing: add the optional extensions on top of the
    base extensions provided by the architecture.

    The ARM TargetParser has the same behavior.

    Differential Revision: — Ahmed Bougacha / ViewSVN
  8. [AArch64] armv8-A doesn't have CRC.

    That's only a required extension as of v8.1a.

    Remove it from the "generic" CPU as well: it should only support the
    base ISA (and binutils agrees).

    Also unify the MC tests into crc.s and arm64-crc32.s — Ahmed Bougacha / ViewSVN
  9. [libFuzzer] exit without running atexit handlers in libfuzzer's crash handler

    It's not safe to assume that atexit handlers can be run once the app crashed.

    Patch by Jochen Eisinger.

    Reviewers: kcc, vitalybuka

    Subscribers: llvm-commits

    Differential Revision: — Vitaly Buka / ViewSVN
  10. Refactored ABITestsuitBuilder to use UnifiedTreeBuilder, so it could track the changes in all dependent projects. — gkistanova / ViewSVN
  11. Remove source code only if clean build has been requested by a property. — gkistanova / ViewSVN
  12. [Hexagon] Use automatically-generated scheduling information for HVX

    Patch by Jyotsna Verma. — kparzysz / ViewSVN
  13. [ScopInfo] Do not use LLVM names to identify statements, arrays, and parameters

    LLVM-IR names are commonly available in debug builds, but often not in release
    builds. Hence, using LLVM-IR names to identify statements or memory reference
    results makes the behavior of Polly depend on the compile mode. This is
    undesirable. Hence, we now just number the statements instead of using LLVM-IR
    names to identify them (this issue has previously been brought up by Zino

    However, as LLVM-IR names help in making test cases more readable, we add an
    option '-polly-use-llvm-names' to still use LLVM-IR names. This flag is by
    default set in the polly tests to make test cases more readable.

    This change reduces the time in ScopInfo from 32 seconds to 2 seconds for the
    following test case provided by Eli Friedman <> (already
    used in one of the previous commits):

      struct X { int x; };
      void a();
      #define SIG (int x, X **y, X **z)
      typedef void (*fn)SIG;
      #define FN { for (int i = 0; i < x; ++i) { (*y)[i].x += (*z)[i].x; } a(); }
      #define FN5 FN FN FN FN FN
      #define FN25 FN5 FN5 FN5 FN5
      #define FN125 FN25 FN25 FN25 FN25 FN25
      #define FN250 FN125 FN125
      #define FN1250 FN250 FN250 FN250 FN250 FN250
      void x SIG { FN1250 }

    For a larger benchmark I have on-hand (10000 loops), this reduces the time for
    running -polly-scops from 5 minutes to 4 minutes, a reduction by 20%.

    The reason for this large speedup is that our previous use of printAsOperand
    had a quadratic cost, as for each printed and unnamed operand the full function
    was scanned to find the instruction number that identifies the operand.

    We do not need to adjust the way memory reference ids are constructured, as
    they do not use LLVM values.

    Reviewed by: efriedma

    Tags: #polly

    Differential Revision: — grosser / ViewSVN
  14. Merge r296561 - Fix PR32097 - is_abstract doesn't work on class templates. — ericwf / ViewSVN
  15. Merge r300397 - Fix PR32642 - string::insert and string::append don't work with move_iterator. — ericwf / ViewSVN
  16. Remove unused private field. — zturner / ViewSVN

r302068 (#5692) (May 3, 2017 2:13:00 PM)

  1. Avoid warning of unused variable in release builds. NFC — annat / ViewSVN
  2. Revert r301897, "ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO."

    It doesn't matter what binding we store in a non-UsedInRegularObj undefined
    symbol because we should reset it when we see a real undefined symbol in
    a combined LTO object. The fact that we weren't doing so before is a bug
    (PR32899) which is now fixed. — pcc / ViewSVN
  3. Tests: strengthen CHECK line to avoid picking up stray path.

    A bot had "-LTO" in its working directory, which matched the regex used in this
    test. Since the arg is quoted, we can exploit that instead. Still broken if
    there's a path with a quote in, but I think that's pretty niche. — Tim Northover / ViewSVN

r302065 (#5691) (May 3, 2017 12:53:56 PM)

  1. Handle mixed strong and weak undefined symbols.

    We were ignoring strong undefined symbols if they followed weak ones.

    Fixes pr32899. — rafael / ViewSVN
  2. [asan] print the 'unexpected format specifier in printf interceptor' warning just once (came up in Not touching a similar scanf warning -- for some reason it does not fire for me. — kcc / ViewSVN
  3. Fix typos in comment — sanjoy / ViewSVN
  4. Break verification down into smaller functions to keep code clean.

    Adrian requested that we break things down to make things clean in the DWARFVerifier. This patch breaks everything down into nice individual functions and cleans up the code quite a bit and prepares us for the next round of verifiers.

    Differential Revision: — gclayton / ViewSVN
  5. Fix PPC64 warning for missing parantheses. NFC. — annat / ViewSVN

r302060 (#5690) (May 3, 2017 12:03:21 PM)

  1. [IR] Abstract away ArgNo+1 attribute indexing as much as possible

    Do three things to help with that:
    - Add AttributeList::FirstArgIndex, which is an enumerator currently set
      to 1. It allows us to change the indexing scheme with fewer changes.
    - Add addParamAttr/removeParamAttr. This just shortens addAttribute call
      sites that would otherwise need to spell out FirstArgIndex.
    - Remove some attribute-specific getters and setters from Function that
      take attribute list indices.  Most of these were only used from
      BuildLibCalls, and doesNotAlias was only used to test or set if the
      return value is malloc-like.

    I'm happy to split the patch, but I think they are probably easier to
    review when taken together.

    This patch should be NFC, but it sets the stage to change the indexing
    scheme to this, which is more convenient when indexing into an array:
      0: func attrs
      1: retattrs
      2...: arg attrs

    Reviewers: chandlerc, pete, javed.absar

    Subscribers: david2050, llvm-commits

    Differential Revision: — rnk / ViewSVN
  2. [CodeView] Remove constructor initialization of a removed field.

    I should've staged this with my last commit. — davide / ViewSVN
  3. [RuntimeLoopUnroller] Add assert that we dont unroll non-rotated loops

    Cloning basic blocks in the loop for runtime loop unroller depends on loop being
    in rotated form (i.e. loop latch target is the exit block).
    Assert that this is true, so that callers of runtime loop unroller pass in
    canonical loops.
    The single caller of this function has that check recently added:

    Reviewers: davide

    Subscribers: llvm-commits

    Differential Revision: — annat / ViewSVN
  4. Delete dead function causing compilation failure. — zturner / ViewSVN
  5. [CodeView] Remove unused private field. NFCI. — davide / ViewSVN
  6. [bpf] add relocation support

      . there should be no runtime relocation inside the bpf function.
      . relocation supported here mostly for debugging.
      . a test case is added.

    Signed-off-by: Yonghong Song <>
    Signed-off-by: Alexei Starovoitov <> — ast / ViewSVN
  7. Revert "CMake: Move sphinx detection into AddSphinxTarget.cmake"

    This reverts commit r302025.

    clang and lld need to be updated too so they don't break with this patch. — tstellar / ViewSVN

r302053 (#5689) (May 3, 2017 11:15:53 AM)

  1. [CodeView] Use actual strings for dealing with checksums and lines.

    The raw CodeView format references strings by "offsets", but it's
    confusing what table the offset refers to.  In the case of line
    number information, it's an offset into a buffer of records,
    and an indirection is required to get another offset into a
    different table to find the final string.  And in the case of
    checksum information, there is no indirection, and the offset
    refers directly to the location of the string in another buffer.

    This would be less confusing if we always just referred to the
    strings by their value, and have the library be smart enough
    to correctly resolve the offsets on its own from the right

    This patch makes that possible.  When either reading or writing,
    all the user deals with are strings, and the library does the
    appropriate translations behind the scenes. — zturner / ViewSVN
  2. [llvm-readobj] Update readobj to re-use parsing code.

    llvm-readobj hand rolls some CodeView parsing code for string
    tables, so this patch updates it to re-use some of the newly
    introduced parsing code in LLVMDebugInfoCodeView.

    Differential Revision: — zturner / ViewSVN
  3. ARM: add extra test for addrmode folding.

    I was worried we might replace a mul with a mul+shift even if there were later
    uses. Turns out to be unfounded but I'd just as well add an actual test for it. — Tim Northover / ViewSVN
  4. [tsan] Detect races on modifying accesses in Swift code

    This patch allows the Swift compiler to emit calls to `__tsan_external_write` before starting any modifying access, which will cause TSan to detect races on arrays, dictionaries and other classes defined in non-instrumented modules. Races on collections from the Swift standard library and user-defined structs and a frequent cause of subtle bugs and it's important that TSan detects those on top of existing LLVM IR instrumentation, which already detects races in direct memory accesses.

    Differential Revision: — kuba.brecka / ViewSVN
  5. [X86][LWP] Add stack folding mappings and tests for LWPINS/LWPVAL instructions — rksimon / ViewSVN
  6. Silence a 'enum and non-enum used in conditional' warning. — rksimon / ViewSVN
  7. [DAGCombine] (addcarry (add|uaddo X, Y), 0, Carry) -> (addcarry X, Y, Carry)

    Summary: Do the transform when the carry isn't used. It's a pattern exposed when legalizing large integers.

    Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

    Subscribers: llvm-commits

    Differential Revision: — deadalnix / ViewSVN

r302046 (#5688) (May 3, 2017 10:25:58 AM)

  1. Revert r302037

    The commit caused the following two buildbot failures:

        Clang :: Misc/error-limit-multiple-notes.cpp
        Clang :: Misc/error-limit.c — arphaman / ViewSVN
  2. Revert my bad winasan coverage test fix and apply one that actually works

    trace-pc doesn't work, but trace-pc-guard does. *shrug* — rnk / ViewSVN
  3. Create DWARFVerifier.cpp and .h and move all DWARF verification code over into it.

    Adrian requested we create a DWARFVerifier.cpp file to contain all of the DWARF verification stuff. This change simply moves the functionality over into DWARFVerifier.h and DWARFVerifier.cpp, renames the DWARFVerifier methods to start with lower case, and switches DWARFContext.cpp over to using the new functionality.

    Differential Revision: — gclayton / ViewSVN
  4. Speculative fix for WinASan after r301994 — rnk / ViewSVN
  5. Resubmit r301986 and r301987 "Add codeview::StringTable"

    This was reverted due to a "missing" file, but in reality
    what happened was that I renamed a file, and then due to
    a merge conflict both the old file and the new file got
    added to the repository.  This led to an unused cpp file
    being in the repo and not referenced by any CMakeLists.txt
    but #including a .h file that wasn't in the repo.  In an
    even more unfortunate coincidence, CMake didn't report the
    unused cpp file because it was in a subdirectory of the
    folder with the CMakeLists.txt, and not in the same directory
    as any CMakeLists.txt.

    The presence of the unused file was then breaking certain
    tools that determine file lists by globbing rather than
    by what's specified in CMakeLists.txt

    In any case, the fix is to just remove the unused file from
    the patch set. — zturner / ViewSVN
  6. [X86][LWP] Add llvm support for LWP instructions (reapplied).

    This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

    Reapplied - this time without changing line endings of existing files.

    Differential Revision: — rksimon / ViewSVN
  7. [APInt] Give the value union a name so we can remove assumptions on VAL being the larger member

    Currently several places assume the VAL member is always at least the same size as pVal. In particular for a memcpy in the move assignment operator. While this is a true assumption, it isn't good practice to assume this.

    This patch gives the union a name so we can write the memcpy in terms of the union itself. This also adds a similar memcpy to the move constructor where we previously just copied using VAL directly.

    This patch is mostly just a mechanical addition of the U in front of VAL and pVAL everywhere. But several constructors had to be modified since we can't directly initializer a field of named union from the initializer list.

    Differential Revision: — ctopper / ViewSVN
  8. Verify that no compile units share the same line table in "llvm-dwarfdump --verify"

    Check to make sure no compile units have the same DW_AT_stmt_list values. Report a verification error if they do.

    Differential Revision: — gclayton / ViewSVN
  9. Revert rL302028 due to accidental line ending changes. — rksimon / ViewSVN
  10. DiagnosticsEngine should clear DelayedDiagID before reporting the
    delayed diagnostic

    This avoids an infinite loop that was uncovered in one of our internal tests
    by r301992. The testcase is the most reduced version of that auto-generated

    rdar://31962618 — arphaman / ViewSVN

r302036 (#5687) (May 3, 2017 9:35:48 AM)

  1. [Hexagon] Handle S2_storerf_io in HexagonInstrInfo — kparzysz / ViewSVN
  2. [Hexagon] Misc fixes in HexagonInstrInfo, NFC

    Formatting changes + remove unused function. — kparzysz / ViewSVN
  3. [Hexagon] Adjust latency between allocframe and the first store on stack

    Allocframe and the following stores on the stack have a latency of 2 cycles
    when not in the same packet. This happens because R29 is needed early by the
    store instruction. Since one of such stores can be packetized along with
    allocframe and use old value of R29, we can assign it 0 cycle latency
    while leaving latency of other stores to the default value of 2 cycles.

    Patch by Jyotsna Verma. — kparzysz / ViewSVN
  4. [Hexagon] Handle J2_jumptpt and J2_jumpfpt in HexagonInstrInfo — kparzysz / ViewSVN
  5. [Hexagon] Implement undoing .cur instructions in packetizer

    The packetizer needs to convert .cur instruction to its regular form if
    the use is not in the same packet as the .cur. The code in the packetizer
    handles one type of .cur, which is the vector load case. This patch
    updates the packetizer so that it can undo all the .cur instructions.
    In the test case, the .cur is the 128B version, but there are also the
    post-increment versions.

    Patch by Brendon Cahoon. — kparzysz / ViewSVN
  6. [OpenMP] Extended parse for 'always' map modifier

    This patch allows the map modifier 'always' to be separated by the map type (to, from, tofrom) only by a whitespace, rather than strictly by a comma as in current trunk. — cbertol / ViewSVN
  7. [Hexagon] Add memory operands to a rewritten load — kparzysz / ViewSVN
  8. [Hexagon] Reset spill alignment when variable-sized objects are present — kparzysz / ViewSVN
  9. [X86][LWP] Add llvm support for LWP instructions.

    This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4).

    Differential Revision: — rksimon / ViewSVN
  10. Don't attempt to use mpx registers on unsupported platforms

    The existing cpp-level checks using PR_MPX_ENABLE_MANAGEMENT aren't sufficient,
    as this isn't defined for linux kernel versions below 3.19.

    Reviewers: valentinagiusti, zturner, labath

    Subscribers: lldb-commits

    Differential Revision: — fjricci / ViewSVN

    When apps or other libraries link against a library with symbol
    versions, the version string is recorded in the import table, and used
    at runtime to resolve the symbol back to a library that provides that
    version (vaguely like how two-level namespaces work in Mach-O).  ld's
    --default-symver flag tags every exported symbol with a symbol version
    string equal to the library's soname.  Using --default-symver means
    multiple versions of libLLVM can coexist within the same process, at
    least to the extent that they don't try to pass data between each
    other's llvms.

    As an example, imagine a language like Rust using llvm for CPU codegen,
    binding to OpenGL, with Mesa as the OpenGL implementation using llvm for
    R600 codegen.  With --default-symver Rust and Mesa will resolve their
    llvm usage to the version each was linked against, which need not match.

    (Other ELF platforms like BSD and Solaris might have similar semantics,
    I've not checked.)

    This is based on an autoconf version of this patch by Adam Jackson.

    This new option can be used to add --default-symver to the linker flags

    Reviewers: beanz

    Reviewed By: beanz

    Subscribers: mgorny, llvm-commits

    Differential Revision: — tstellar / ViewSVN

r302025 (#5686) (May 3, 2017 8:45:31 AM)

  1. CMake: Move sphinx detection into AddSphinxTarget.cmake

    Reviewers: chandlerc, beanz, mgorny

    Reviewed By: beanz

    Subscribers: llvm-commits

    Differential Revision: — tstellar / ViewSVN
  2. Reusing an existing attribute diagnostic

    In a previous patch, a new generic error diagnostic for inconsistent attributes was added.
    In this commit I reuse this diagnostic for ns_returns_retained attribute check.

    Differential Revision: — orenb / ViewSVN

r302023 (#5685) (May 3, 2017 7:55:31 AM)

  1. [X86][AVX512] remove unnecessary case. NFC

    VFPCLASS is for vector types and not scalar, so it cannot get here.

    Differential Revision: — guyblank / ViewSVN
  2. [SystemZ]  Properly check number of operands in getCmpOpsType()

    It is needed to check that the number of operands are 2 when
    finding the case of a logic combination, e.g. 'and' of two compares.

    Review: Ulrich Weigand — jonpa / ViewSVN
  3. [CUDA Managed Memory] Fix regression introduced by Managed Memory

    - Fixes breakage from commit 5536f.
    - Interference with commit 764f3 caused testcase to fail. Reverting
      764f3 allows commit 5536f to succeed.
    - Generated kernel code was slightly different due to 764f3, which
      caused testcase to fail. — bollu / ViewSVN
  4. [X86] Support of no_caller_saved_registers attribute

    This patch implements the LLVM part for no_caller_saved_registers attribute as appears here:;a=commit;h=5ed3cc7b66af4758f7849ed6f65f4365be8223be.
    In order to implement the attribute, we use the dynamic CSR mechanism to remove returned/passed arguments from the function regmask/CSR list.

    Differential Revision: — orenb / ViewSVN

r302019 (#5684) (May 3, 2017 7:05:30 AM)

  1. Don't crash on the profile/admin page

    ... when there are no profiles on the server.
    Fixes PR32724. — kbeyls / ViewSVN

r302018 (#5683) (May 3, 2017 6:15:27 AM)

  1. Support arbitrary address space pointers in masked gather/scatter intrinsics.

    Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a
    non-default address space pointer we fail with a "Calling a function with a
    bad singature!" assertion. This patch solves this by adding the 'vector of
    pointers' argument as an overloaded type which will determine the address

    Differential revision: — eladcohen / ViewSVN
  2. [AVR] Reserve the Y register in all functions — dylanmckay / ViewSVN
  3. [analyzer] Fix memory error bug category capitalization.

    It was written as "Memory Error" in most places and as "Memory error" in a few
    other places, however it is the latter that is more consistent with
    other categories (such as "Logic error").


    Differential Revision: — dergachev / ViewSVN
  4. [Loop Deletion] Delete loops that are never executed

    Currently, loop deletion deletes loop where the only values
    that are used outside the loop are loop-invariant.
    This patch adds logic to delete loops where the loop is proven to be
    never executed (i.e. the only predecessor of the loop preheader has a
    constant conditional branch as terminator, and the preheader is not the
    taken target). This will remove loops that become dead after
    loop-unswitching generates constant conditional branches.

    The next steps are:
    1. moving the loop deletion implementation to LoopUtils.
    2. Add logic in loop-simplifyCFG which will support changing conditional
    constant branches to unconditional branches. If loops become unreachable in this
    process, they can be removed using `deleteDeadLoop` function.

    Reviewers: chandlerc, efriedma, sanjoy, reames

    Reviewed by: sanjoy

    Subscribers: mzolotukhin, llvm-commits

    Differential Revision: — annat / ViewSVN

r302014 (#5682) (May 3, 2017 5:25:40 AM)

  1. Revert "[AVR] Enable the frame pointer for all functions"

    This reverts commit 358ad02d999e88853d2cfc954bd2f668308a51f7. — dylanmckay / ViewSVN
  2. Windows fix for TestConflictingDefinition makefile

    gnuwin32 rm does not like wildcards that match nothing even if we
    specify -f (probably because the wildcard expansion happens in-process
    there). We could use make $(wildcard) here, but it seems safer to
    explicitly list the files here, just like the normal Makefile.rules
    does. — labath / ViewSVN
  3. Undo turning ExtBehavior into a bitfield.

    This produces warnings that I can't explain in a GCC build:

    In file included from ../tools/clang/include/clang/Lex/LexDiagnostic.h:13:0,
                     from /usr/local/google/home/djasper/llvm/tools/clang/lib/Lex/PTHLexer.cpp:19:
    ../tools/clang/include/clang/Basic/Diagnostic.h:219:34: warning: ‘clang::DiagnosticsEngine::DiagState::ExtBehavior’ is too small to hold all values of ‘enum class clang::diag::Severity’ [enabled by default]
         diag::Severity ExtBehavior : 4;     // Map extensions to warnings or errors?

    While I don't think this warning makes sense, I'd like to get this back to being
    warning-free. This only seems to trigger for "enum class".

    Reproducer: — djasper / ViewSVN

r302011 (#5681) (May 3, 2017 4:35:22 AM)

  1. [Triple] Add a "macos" OS type that acts as a synonym for "macosx"

    The "macosx" OS type is still the canonical type. In the future "macos" will
    become the canonical OS type (but we will still support "macosx").


    Differential Revision: — arphaman / ViewSVN
  2. [X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.

    Pre-commit as requested in D32769. — rksimon / ViewSVN
  3. Fix tests after speculatable intrinsics patch

    These were relying on the attribute group numbering — djasper / ViewSVN

r302008 (#5680) (May 3, 2017 3:45:05 AM)

  1. Check for lack of C++ context first when demangling

    Summary: It seems that if we have no context, then it can't possibly be a method.  Check that first.

    Reviewers: clayborg

    Reviewed By: clayborg

    Subscribers: labath, lldb-commits

    Differential Revision:
    Patch by Scott Smith <>. — labath / ViewSVN
  2. [ELF] Fix problems with fabricateDefaultCommands() and --section-start

    The --section-start <name>=<address> needs to be translated into equivalent
    linker script commands. There are a couple of problems with the existing
    - The --section-start with the lowest address is assumed to be at the start
    of the map. This assumption is incorrect, we have to iterate through the
    SectionStartMap to find the lowest address.
    - The addresses in --section-start were being over-aligned when the
    sections were marked as PageAlign. This is inconsistent with the use of
    SectionStartMap in fixHeaders(), and can cause problems when the PageAlign
    causes an "unable to move location counter backward" error when the
    --section-start with PageAlign is aligned to an address higher than the next
    --section-start. The ld.bfd and seem to be more consistent with this
    approach but this is not a well specified area.
    This change fixes the problems above and also corrects a typo in which
    fabricateDefaultCommands() is called with the wrong parameter, it should be
    called with AllocateHeader not Config->MaxPageSize.

    Differential Revision: — psmith / ViewSVN

r302006 (#5679) (May 3, 2017 2:25:12 AM)

  1. [ELF] - Added testcase gdb-index-ranges.s (

    Before rL301170 was landed, LLD did not produce correct entries in .gdb_index address area.
    Issue was fixed on LLVM DWARF parsers side and was relative to how .debug_ranges
    section was scanned. It was main problem of PR32319.

    It makes sense to have testcase on LLD size too. This checks that we generate proper values
    now, because we do not have any tests for .gdb_index which works with .debug_ranges atm.

    Differential revision: — grimar / ViewSVN
  2. [ScopInfo] Remove code not needed anymore after r302004 — grosser / ViewSVN
  3. [ScopInfo] Do not add array name into memory reference ids

    Before this change a memory reference identifier had the form:

      <STMT>_<ACCESSTYPE><ID>_<MEMREF>, e.g., Stmt_bb9_Write0_MemRef_tmp11

    After this change, we use the format:

      <STMT>_<ACCESSTYPE><ID>, e.g., Stmt_bb9_Write0

    The name of the array that is accessed through a memory reference is not
    necessary to uniquely identify a memory reference, but was only added to
    provide additional information for debugging. We drop this information now
    for the following two reasons:

      1) This shortens the names and consequently improves readability
      2) This removes a second location where we decide on the name of a scop array,
         leaving us only with the location where the actual scop array is created.

    Having after 2) only a single location to name scop arrays will allow us to
    change the naming convention of scop arrays more easily, which we will do
    in a future commit to reduce compilation time. — grosser / ViewSVN
  4. Silences gcc's -Wnarrowing.

    I think this is a false positive in GCC's warning, but nonetheless, we
    should try to be warning-free. Smaller reproducer (reproduces with GCC
    6.3): — djasper / ViewSVN
  5. Revert r301986 (and subsequent r301987).

    The patch is failing to add StringTableStreamBuilder.h, but that isn't
    even discovered because the corresponding StringTableStreamBuilder.cpp
    isn't added to any CMakeLists.txt file and thus never built. I think
    this patch is just incomplete. — djasper / ViewSVN

r302001 (#5678) (May 3, 2017 1:04:49 AM)

  1. [sanitizer] Intercept mcheck and mprobe on Linux

    This patch addresses
    Users can use mcheck and mprobe functions to verify heap state so we should intercept them to avoid breakage of valid code.

    Differential Revision: — chefmax / ViewSVN

r302000 (#5677) (May 3, 2017 12:13:03 AM)

  1. Revert rL301998: "Fix a bug that -isysroot is completely ignored on Unix"

    This reverts commit because it broke
    sanitizer-x86_64-linux-autoconf bot and
    clang-ppc64be-linux-multistage  bot. — yamaguchi / ViewSVN
  2. Fix use after free in BinaryStream library.

    This was reported by the ASAN bot, and it turned out to be
    a fairly fundamental problem with the design of VarStreamArray
    and the way it passes context information to the extractor.

    The fix was cumbersome, and I'm not entirely pleased with it,
    so I plan to revisit this design in the future when I'm not
    pressed to get the bots green again.  For now, this fixes
    the issue by storing the context information by value instead
    of by reference, and introduces some impossibly-confusing
    template magic to make things "work". — zturner / ViewSVN

r301998 (#5676) (May 2, 2017 11:20:07 PM)

  1. Fix a bug that -isysroot is completely ignored on Unix

    -isysroot is the flag which set the system root directory.
    This bug report
    shows that -isysroot is not handled at all on Unix, so fixed this bug.

    After this diff, I could get this result .

    Differential Revision: — yamaguchi / ViewSVN

r301997 (#5675) (May 2, 2017 10:29:52 PM)

  1. Add Falcon to Users.html — sanjoy / ViewSVN

r301996 (#5674) (May 2, 2017 8:55:29 PM)

  1. Fix tests after speculatable intrinsics patch

    These were relying on the attribute group numbering — arsenm / ViewSVN

r301995 (#5673) (May 2, 2017 8:05:33 PM)

  1. Replace hardcoded intrinsic list with speculatable attribute.

    No change in which intrinsics should be speculated. — arsenm / ViewSVN
  2. [sanitizer-coverage] add a deprecation warning to the old sanitizer-coverage flag combinations — kcc / ViewSVN

r301993 (#5672) (May 2, 2017 7:15:45 PM)

  1. Fixed a bug where we did not properly use the complete versions of Objective-C classes.
    Also added a test case, thanks to Greg Clayton.

    <rdar://problem/18913551> — Sean Callanan / ViewSVN
  2. [modules] Round-trip -Werror flag through explicit module build.

    The intent for an explicit module build is that the diagnostics produced within
    the module are those that were configured when the module was built, not those
    that are enabled within a user of the module. This includes diagnostics that
    don't actually show up until the module is used (for instance, diagnostics
    produced during template instantiation and weird cases like -Wpadded).

    We serialized and restored the diagnostic state for individual warning groups,
    but previously did not track the state for flags like -Werror and -Weverything,
    which are implemented as separate bits rather than as part of the diagnostics
    mapping information. — rsmith / ViewSVN
  3. Revert r295861, "[ModuleSummaryAnalysis] Don't crash when referencing unnamed globals."

    We should always expect values to be named before running the module summary
    analysis (see NameAnonGlobals pass), so it's fine if we crash in that case. — pcc / ViewSVN

r301990 (#5671) (May 2, 2017 6:25:54 PM)

  1. [PowerPC, DAGCombiner] Fold a << (b % (sizeof(a) * 8)) back to a single instruction

    This is the corresponding llvm change to D28037 to ensure no performance

    Reviewers: bogner, kbarton, hfinkel, iteratee, echristo

    Subscribers: nemanjai, llvm-commits

    Differential Revision: — timshen / ViewSVN
  2. [ODRHash] Add support for array and decayed types, and parameter names and types. — rtrieu / ViewSVN

r301988 (#5670) (May 2, 2017 5:35:40 PM)

  1. [ubsan] Skip overflow checks on safe arithmetic (fixes PR32874)

    Currently, ubsan emits overflow checks for arithmetic that is known to
    be safe at compile-time, e.g:

      1 + 1 => CheckedAdd(1, 1)

    This leads to breakage when using the __builtin_prefetch intrinsic. LLVM
    expects the arguments to @llvm.prefetch to be constant integers, and
    when ubsan inserts unnecessary checks on the operands to the intrinsic,
    this contract is broken, leading to verifier failures (see PR32874).

    Instead of special-casing __builtin_prefetch for ubsan, this patch fixes
    the underlying problem, i.e that clang currently emits unnecessary
    overflow checks.

    Testing: I ran the check-clang and check-ubsan targets with a stage2,
    ubsan-enabled build of clang. I added a regression test for PR32874, and
    some extra checking to make sure we don't regress runtime checking for
    unsafe arithmetic. The existing ubsan-promoted-arithmetic.cpp test also
    provides coverage for this change. — Vedant Kumar / ViewSVN
  2. Fix type conversion error. — zturner / ViewSVN
  3. Make codeview::StringTable.

    Previously we had knowledge of how to serialize and deserialize
    a string table inside of DebugInfo/PDB, but the string table
    that it serializes contains a piece that is actually considered
    CodeView and can appear outside of a PDB.  We already have logic
    in llvm-readobj and MCCodeView to read and write this format,
    so it doesn't make sense to duplicate the logic in DebugInfoPDB
    as well.

    This patch makes codeview::StringTable (for writing) and
    codeview::StringTableRef (for reading), updates DebugInfoPDB
    to use these classes for its own writing, and updates llvm-readobj
    to additionally use StringTableRef for reading.

    It's a bit more difficult to get MCCodeView to use this for
    writing, but it's a logical next step. — zturner / ViewSVN
  4. Typo in LangRef.rst. NFC — trentxintong / ViewSVN

r301984 (#5669) (May 2, 2017 4:45:27 PM)

  1. Add line table verification to lldb-dwarfdump --verify

    This patch verifies the .debug_line:
    - verify all addresses in a line table sequence have ascending addresses
    - verify that all line table file indexes are valid

    Unit tests added for both cases.

    Differential Revision: — gclayton / ViewSVN
  2. ARM: avoid handing a deleted node back to TableGen during ISel.

    When we replaced the multiplicand the destination node might already exist.
    When that happens the original gets CSEd and deleted. However, it's actually
    used as the offset so nonsense is produced.

    Should fix PR32726. — Tim Northover / ViewSVN
  3. Remove a dead function declaration. — ruiu / ViewSVN
  4. Re-land r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"

    This time, I fixed, built, and tested clang.

    This reverts r301712. — rnk / ViewSVN

r301980 (#5668) (May 2, 2017 3:55:10 PM)

  1. [AArch64] ILP32 Backend Relocation Support

    Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
      TLSDESC_ADD_LO12 relocations
    Rearrange ordering in AArch64.def to follow relocation encoding
    Fix name:
      R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
    Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
    Fix return values from isNonILP32reloc
    Add implementations for
      R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
    Modify error messages to give name of equivalent relocation in the
      ABI not being used, along with better checking for non-existent
      requested relocations.
    Added assembler support for "pg_hi21_nc"
    Relocation definitions added without implementations:
    Fix encoding:

    Reviewers: Peter Smith

    Patch by: Joel Jones (

    Differential Revision: — joel_k_jones / ViewSVN
  2. Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12 — joel_k_jones / ViewSVN
  3. [DWARFv5] Parse new line-table header format.

    The directory and file tables now have form-based content descriptors.
    Parse these and extract the per-directory/file records based on the
    descriptors.  For now we support only DW_FORM_string (inline) for the
    path names; follow-up work will add support for indirect forms (i.e.,
    DW_FORM_strp, strx<N>, and line_strp).

    Differential Revision: — probinson / ViewSVN
  4. revert r301766: InstructionSimplify: Canonicalize shuffle operands. NFC-ish

    Turns out this wasn't NFC-ish at all because there's a bug processing shuffles
    that change the size of their input vectors (that case always seems to trip us

    This should fix PR32872 while we investigate how it failed and reduce a testcase: — spatel / ViewSVN
  5. [asan] Mark some more testcases as unsupported on iOS. — kuba.brecka / ViewSVN
  6. Fix typo. — ruiu / ViewSVN

r301974 (#5667) (May 2, 2017 3:04:00 PM)

  1. [NewGVN] Fix typo and format comment. NFCI. — davide / ViewSVN
  2. [NFC] Add original test that triggered crash post r301735
    - this is added just for completeness sake (though the general case should be represented by the test added in the revision to that patch: ) — faisalv / ViewSVN
  3. Fix PR32831 (Try Again): 'this' capture while instantiating generic lambda call operator specialization

    When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda.

    This patch was initially committed here:
    Then reverted here:

    The issue with the original patch was a failure to check that the closure type has been created within the LambdaScopeInfo before querying its DeclContext - instead of just assuming it has (silly!).  A reduced example such as this highlights the problem:
      struct X {
         int data;
         auto foo() { return [] { return [] -> decltype(data) { return 0; }; }; }

    When 'data' within decltype(data) tries to determine the type of 'this', none of the LambdaScopeInfo's have their closure types created at that point. — faisalv / ViewSVN
  4. Verify that all references point to actual DIEs in "llvm-dwarfdump --verify"

    LTO and other fancy linking previously led to DWARF that contained invalid references. We already validate that CU relative references fall into the CU, and the DW_FORM_ref_addr references fall inside the .debug_info section, but we didn't validate that the references pointed to correct DIE offsets. This new verification will ensure that all references refer to actual DIEs and not an offset in between.

    This caught a bug in DWARFUnit::getDIEForOffset() where if you gave it any offset, it would match the DIE that mathes the offset _or_ the next DIE. This has been fixed.

    Differential Revision: — gclayton / ViewSVN
  5. [Sema] Update function doc; NFC — George Burgess IV / ViewSVN
  6. Revert "Fix misnamed #include. Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12"

    This reverts commit r301964. It broke the build. — rafael / ViewSVN
  7. Simplify some va_start checking logic

    Combine the logic doing the ms_abi/sysv_abi checks into one function so
    that each check and its logical opposite are near each other. Now we
    don't need two Sema entry points for MS va_start and regular va_start.

    Refactor the code that checks if the va_start caller is a function,
    block, or obj-c method. We do this in three places, and they are all
    buggy for variadic lambdas (PR32737). After this change, I have one
    place to apply the functional fix.

    NFC — rnk / ViewSVN
  8. [asan] Mark testcase as unsupported on iOS. — kuba.brecka / ViewSVN

r301966 (#5666) (May 2, 2017 2:12:18 PM)

  1. [asan] Mark a bunch of tests as unsupported on iOS

    This patch marks a few ASan tests as unsupported on iOS. These are mostly tests that use files or paths that are invalid/inaccessible on iOS or the simulator. We currently don't have a good way of propagating/copying secondary files that individual tests need. The same problem exists on Android, so I'm just marking the tests as UNSUPPORTED now.

    Differential Revision: — kuba.brecka / ViewSVN
  2. [asan] Disable some Darwin tests that don't work on iOS simulator

    Differential Revision: — kuba.brecka / ViewSVN
  3. Fix misnamed #include. Remove _NC suffix from ELF relocations TLSDESC_{LD64,ADD}_LO12 — joel_k_jones / ViewSVN

r301963 (#5665) (May 2, 2017 1:16:03 PM)

  1. Revert r301822 (and dependent r301825), which tried to improve the
    handling of constexprs with unknown bounds.

    This triggers a corner case of the language where it's not yet clear
    whether this should be an error:

      struct A {
        static void *const a[];
        static void *const b[];
      constexpr void *A::a[] = {&b[0]};
      constexpr void *A::b[] = {&a[0]};

    When discovering the initializer for A::a, the bounds of A::b aren't known yet.
    It is unclear whether warning about errors should be deferred until the end of
    the translation unit, possibly resolving errors that can be resolved. In
    practice, the compiler can know the bounds of all arrays in this example.

    Credits for reproducers and explanation go to Richard Smith. Richard, please
    add more info in case my explanation is wrong. — djasper / ViewSVN
  2. ARM: add arm1176j-f processor

    I doubt anyone actually uses it, and I'm not even entirely convinced it exists
    myself; but it is our default for "clang -arch armv6". Functionally, if it does
    exist it's identical to the arm1176jz-f from LLVM's point of view (the
    difference is apparently in the "Security Extensions"). — Tim Northover / ViewSVN
  3. PEI: Skip dead objects when looking at CSRs

    On AMDGPU if an SGPR is spilled to a VGPR, the frame index
    is deleted. If there were any CSR SGPRs, this woudl
    assert when setting the offset. — arsenm / ViewSVN
  4. Revert "[docs] UBSan: Mention that print_stacktrace=1 is unsupported on Darwin"

    This reverts commit r300295.

    It's no longer true, print_stacktrace=1 is supported on Darwin/Windows
    as of r301839. — Vedant Kumar / ViewSVN
  5. [PartialInlining] Add more early filtering

    This is a follow up to the previous
    inline cost patch for quicker filtering. — davidxl / ViewSVN
  6. AMDGPU: Don't promote alloca to LDS for leaf functions

    LDS use in leaf functions not currently handled. — arsenm / ViewSVN
  7. [Hexagon] Fix uninitialized value caught with valgrind

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  8. [Hexagon] Change iconst to emit 27bit relocation

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  9. [Hexagon] Add extenders for GD_PLT_B22_PCREL and LD_PLT_B22_PCREL

    Patch by Sid Manning. — kparzysz / ViewSVN
  10. [Hexagon] Don't ignore mult-cycle latency information

    The compiler was generating code that ends up ignoring a multiple
    latency dependence between two instructions by scheduling the
    intructions in back-to-back packets.

    The packetizer needs to end a packet if the latency of the current
    current insruction and the source in the previous packet is
    greater than 1 cycle. This case occurs when there is still room in
    the current packet, but scheduling the instruction causes a stall.
    Instead, the packetizer should start a new packet. Also, if the
    current packet already contains a stall, then it is okay to add
    another instruction to the packet that also causes a stall. This
    occurs when there are no instructions that can be scheduled in
    between the producer and consumer instructions.

    This patch changes the latency for loads to 2 cycles from 3 cycles.
    This change refects that a load only needs to be separated by
    one extra packet to eliminate the stall.

    Patch by Ikhlas Ajbar. — kparzysz / ViewSVN

r301953 (#5664) (May 2, 2017 12:25:56 PM)

  1. [Hexagon] Formatting changes, NFC — kparzysz / ViewSVN
  2. [Hexagon] Remove unused validSubtarget TSFlags

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  3. [Hexagon] Make sure duplexed dealloc_returns are checked for double jumps

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  4. SpeculativeExecution: Stop using whitelist for costs

    Just let TTI's cost do this instead of arbitrarily restricting
    this. — arsenm / ViewSVN
  5. [Hexagon] Move checking AXOK to checker

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  6. Rename pdb::StringTable -> pdb::PDBStringTable.

    With the forthcoming codeview::StringTable which a pdb::StringTable
    would hold an instance of as one member, this ambiguity becomes
    confusing.  Rename to PDBStringTable to avoid this. — zturner / ViewSVN
  7. [Hexagon] Remove unneeded code from HexagonShuffler

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  8. [Hexagon] Extract function that checks endloops with other branches

    Change location number to point to conflicting branch instruction.

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  9. [Hexagon] Add new packet iterator which will iterate through duplexes

    Patch by Colin LeMahieu. — kparzysz / ViewSVN

r301944 (#5663) (May 2, 2017 11:35:47 AM)

  1. Revert "Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and"

    This reverts commit c08155afc5d3230792da2ad30a046a8617735a73.

    This is causing undefined symbol errors with some of the constants. — zturner / ViewSVN
  2. [Hexagon] Check for .cur def without use without using a map data structure

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  3. Bitcode: Simplify how we enumerate summaries in the index. NFCI.

    Instead of defining a custom iterator class, just use a function with a
    callback, which is much easier to understand and less error prone.

    Differential Revision: — pcc / ViewSVN
  4. [lit] Try to exit more cleanly

    If all jobs complete successfully, use pool.close() instead of
    pool.terminate() before waiting for the workers. Zach Turner reported
    that he was getting "access denied" exceptions from pool.terminate().

    Make the workers abort immediately without printing to stderr when they
    are interrupted.

    Finally, catch exceptions when attempting to remove our temporary
    testing directory. On abnormal exit, there can often be open handles
    that haven't been cleaned up yet. — rnk / ViewSVN
  5. Make DWARFDebugLine use StringRef for directory/file tables. NFC

    Differential Revision: — probinson / ViewSVN
  6. Remove "_NC" suffix and semantics from TLSDESC_LD{64,32}_LO12 and
      TLSDESC_ADD_LO12 relocations
    Rearrange ordering in AArch64.def to follow relocation encoding
    Fix name:
      R_AARCH64_P32_LD64_GOT_LO12_NC => R_AARCH64_P32_LD32_GOT_LO12_NC
    Add support for several "TLS", "TLSGD", and "TLSLD" relocations for
    Fix return values from isNonILP32reloc
    Add implementations for
      R_AARCH64_P32_TLSDESC_LD32_LO12, R_AARCH64_LD64_GOT_LO12_NC,
    Modify error messages to give name of equivalent relocation in the
      ABI not being used, along with better checking for non-existent
      requested relocations.
    Added assembler support for "pg_hi21_nc"
    Relocation definitions added without implementations:
    Fix encoding:

    Reviewers: Peter Smith

    Patch by: Joel Jones (

    Differential Revision: — joel_k_jones / ViewSVN
  7. AMDGPU: Refactor AsmPrinter

    Avoid analyzing functions multiple times. This allows
    asserting that each function is only analyzed once. — arsenm / ViewSVN
  8. AMDGPU: Make intrinsics speculatable — arsenm / ViewSVN
  9. [PDB/CodeView] Read/write codeview inlinee line information.

    Previously we wrote line information and file checksum
    information, but we did not write information about inlinee
    lines and functions.  This patch adds support for that. — zturner / ViewSVN

r301935 (#5662) (May 2, 2017 10:45:41 AM)

  1. Roll back r301831 to fix broken powerpc64le tests. — saugustine / ViewSVN
  2. CMake: Silence more stderr when running git.

    It can confuse bots collecting errors. — Tim Northover / ViewSVN

r301933 (#5661) (May 2, 2017 9:55:44 AM)

  1. Fixing a test failure and refactoring the use of the update_svn_checkout function. — sqlbyme / ViewSVN
  2. Add new test case for addcarry. NFC. — deadalnix / ViewSVN
  3. Avoid empty .eh_frame sections.

    Strip on OpenBSD does not correctly handle an empty .eh_frame section
    and produces broken binaries in that case. Currently lld creates such
    an empty .eh_frame section, despite the fact that the OpenBSD crtend.o
    explicitly inserts a terminator. The Linux LSB "standard":

    explicitly says that

        The .eh_frame section shall contain 1 or more Call Frame Information (CFI) records.

    This diff includes a test that specifically tests the issue I'm seeing
    on OpenBSD.

    Patch by Mark Kettenis! — rafael / ViewSVN
  4. AMDGPU: Add AMDGPU_HS calling convention

    Reviewers: arsenm, nhaehnle

    Subscribers: mehdi_amini, kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

    Differential Revision: — mareko / ViewSVN
  5. [InstCombine] don't use DeMorgan's Law on integer constants (2nd try)

    This was originally checked in here:

    And reverted here:

    Because there's a clang test that would fail after this. I fixed/removed the
    offending CHECK lines in:

    So let's try this again. Original commit message:

    This is the fold that causes the infinite loop in BoringSSL
    when we fix instcombine demanded bits to prefer 'not' ops as in

    There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
    reinstate until dyn_castNotVal is completely eliminated.

    1. As shown here, it transforms 'not' into random xor. This transform is harmful to SCEV and codegen because 'not' can often be folded while random xor cannot.
    2. It does not transform vector constants. This is actually a good thing, but if you don't believe the above argument, then we shouldn't have excluded vectors.
    3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't match the greedy nature of instcombine. If we DeMorganize a pattern that has an extra 'not' in it: ~(~(~X) & Y) --> (~X | ~Y)

      That's just another case of DeMorgan, so we should trust that we'll fold that pattern too: (~X | ~ Y) --> ~(X & Y)

    Differential Revision: — spatel / ViewSVN
  6. [CodeGen] remove/fix checks that will fail when r301923 is recommitted

    Don't test the optimizer as part of front-end verification. — spatel / ViewSVN

r301927 (#5660) (May 2, 2017 9:05:28 AM)

  1. tsan: allow fast large MemoryRangeSet on non-Windows Go

    The fast reset for large memory regions is not working
    only on windows. So enable it for Go/linux/darwin/freebsd.

    for background and motivation.

    Based on idea by Josh Bleecher Snyder. — dvyukov / ViewSVN
  2. [compiler-rt] move tsan's Android __get_tls() to sanitizer_common

    TSan's Android `__get_tls()` and `TLS_SLOT_TSAN` can be used by other sanitizers as well (see D32649), this change moves them to sanitizer_common.
    I picked sanitizer_linux.h as their new home.
    In the process, add the 32-bit versions for ARM, i386 & MIPS.

    Can the address of `__get_tls()[TLS_SLOT_TSAN]` change in between the calls?
    I am not sure if there is a need to repeat the construct as opposed to using a variable. So I left things as they were.

    Testing on my side was restricted to a successful cross-compilation.

    Reviewers: dvyukov, kubamracek

    Reviewed By: dvyukov

    Subscribers: aemerson, rengolin, srhines, dberris, arichardson, llvm-commits

    Differential Revision: — cryptoad / ViewSVN
  3. [NFC] [IslAST] fix typo: "int the" -> "in the" — bollu / ViewSVN
  4. revert r301923 : [InstCombine] don't use DeMorgan's Law on integer constants

    There's a clang test that is wrongly using -O1 and failing after this commit. — spatel / ViewSVN

r301923 (#5659) (May 2, 2017 8:15:05 AM)

  1. [InstCombine] don't use DeMorgan's Law on integer constants

    This is the fold that causes the infinite loop in BoringSSL
    when we fix instcombine demanded bits to prefer 'not' ops as in D32255.

    There are 2 or 3 problems with dyn_castNotVal, and I don't think we can
    reinstate D32255 until dyn_castNotVal is completely eliminated.
    1. As shown here, it transforms 'not' into random xor. This transform is
       harmful to SCEV and codegen because 'not' can often be folded while
       random xor cannot.
    2. It does not transform vector constants. This is actually a good thing,
       but if you don't believe the above argument, then we shouldn't have
       excluded vectors.
    3. It tries to avoid transforming not(not(X)). That's nice, but it doesn't
       match the greedy nature of instcombine. If we DeMorganize a pattern
       that has an extra 'not' in it:
       ~(~(~X) & Y) --> (~X | ~Y)

       That's just another case of DeMorgan, so we should trust that we'll fold
       that pattern too:
       (~X | ~ Y) --> ~(X & Y)

    Differential Revision: — spatel / ViewSVN
  2. [DAGCombine] (uaddo X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

    Summary: This is a common pattern that arise when legalizing large integers operations. Only do it when Y + 1 cannot overflow as this would change the carry behavior of uaddo .

    Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

    Subscribers: llvm-commits

    Differential Revision: — deadalnix / ViewSVN
  3. Add llvm::object::getELFSectionTypeName().

    This is motivated by where I am trying
    to add printing of the section type for incompatible sections to LLD
    error messages. This patch allows us to use the same code in
    llvm-readobj and LLD instead of duplicating the function inside LLD.

    Patch by Alexander Richardson! — rafael / ViewSVN
  4. Improvements to TableGen/LangIntro.rst

    Document the 'code' data type, and that value{15-17} is different to

    Patch by @chenwj (Wei-Ren Chen).

    Differential Revision: — asb / ViewSVN

r301919 (#5658) (May 2, 2017 7:24:56 AM)

  1. [DAGCombine] (add X, (addcarry Y, 0, Carry)) -> (addcarry X, Y, Carry)

    Summary: Common pattern when legalizing large integers operations. Similar to D32687, when the carry isn't used.

    Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

    Differential Revision: — deadalnix / ViewSVN
  2. Android.rules: set "ar" path correctly — labath / ViewSVN

r301917 (#5657) (May 2, 2017 6:34:56 AM)

  1. ObjectFileELF: Fix symbol lookup in bss section

    If we have symbol information in a separate file, we need to be very
    careful about presenting a unified section view of module to the rest of
    the debugger. ObjectFileELF had code to handle that, but it was being
    overly cautious -- the section->GetFileSize()!=0 meant that the
    unification would fail for sections which do not occupy any space in the
    object file (e.g., .bss). In my case, that manifested itself as not
    being able to display the values of .bss variables properly as the
    section associated with the variable did not have it's load address set
    (because it was not present in the unified section list).

    I test this by making sure the unified section list and the variables
    refer to the same section.

    Reviewers: eugene, zturner

    Subscribers: tberghammer, lldb-commits, mgorny

    Differential Revision: — labath / ViewSVN
  2. Revert r301735 (and subsequent r301786).

    It leads to clang crashing, e.g. on this short code fragment (added to

      class SomeClass {
        void foo() {
          auto l = [this] { auto l = [] EXCLUSIVE_LOCKS_REQUIRED(mu_) {}; };
        Mutex mu_;
      }; — djasper / ViewSVN
  3. [X86][SSE] Add test for PR30264 (combining multiple constants inputs in a shuffle) — rksimon / ViewSVN
  4. [clang-move] Find template class forward declarations more precisely.

    Reviewers: ioeric

    Reviewed By: ioeric

    Subscribers: cfe-commits

    Differential Revision: — hokein / ViewSVN
  5. [analyzer] Detect bad free of function pointers

    Differential Revision: — danielmarjamaki / ViewSVN

r301912 (#5656) (May 2, 2017 5:45:02 AM)

  1. [X86] Tidyup subvector insert/extract helpers. NFCI.

    Use getConstantOperandVal where possible. — rksimon / ViewSVN

r301911 (#5655) (May 2, 2017 4:54:57 AM)

  1. Fix typo in comment. NFCI. — rksimon / ViewSVN
  2. [SelectionDAG] Improve support for promotion of <1 x fX> floating point argument types (PR31088)

    PR31088 demonstrated that we were assuming that only integers require promotion from <1 x iX> types, when in fact float types may require it as well - in this case half floats.

    This patch adds support for extension/truncation for both integer and float types.

    Differential Revision: — rksimon / ViewSVN

r301909 (#5654) (May 2, 2017 4:04:37 AM)

  1. Revert r301904 causing tsan test failure in x86_64-linux-autoconf — pgousseau / ViewSVN
  2. Change UniqueCStringMap to use ConstString as the key

    UniqueCStringMap "sorts" the entries for fast lookup, but really it only cares about uniqueness.  ConstString can be compared by pointer alone, rather than with strcmp, resulting in much faster comparisons.  Change the interface to take ConstString instead, and propagate use of the type to the callers where appropriate.

    Reviewers: #lldb, clayborg

    Reviewed By: clayborg

    Subscribers: labath, jasonmolenda, lldb-commits

    Differential Revision:
    Patch by Scott Smith <>. — labath / ViewSVN
  3. [DAGCombiner] Improve MatchBswapHword logic (PR31357)

    The existing code only looks at half of the tree when matching bswap + rol patterns ending in an OR tree (as opposed to a cascade).

    Patch originally introduced by Jim Lewis.

    Submitted on the behalf of Dinar Temirbulatov.

    Differential Revision: — rksimon / ViewSVN
  4. Remove leftover test expectation from rL301902. — emilio / ViewSVN
  5. [ARM] GlobalISel: Use TableGen instruction selector

    Emit and use the TableGen instruction selector for ARM. At the moment,
    this allows us to remove the hand-written code for selecting G_SDIV and

    Future commits will focus on increasing the code coverage for it and
    removing more dead code from the current instruction selector. — rovka / ViewSVN
  6. [asan] Add strndup/__strndup interceptors if targeting linux.

    Differential Revision: — pgousseau / ViewSVN
  7. Remove unused code related to CPlusPlusLanguage::FindEquivalentNames

    Summary: It is simply unused, and the header for it is private, so there should be no external dependencies.

    Reviewers: #lldb, zturner

    Reviewed By: zturner

    Subscribers: zturner, tberghammer, jingham, lldb-commits

    Differential Revision:
    Patch by Scott Smith <>. — labath / ViewSVN

r301902 (#5653) (May 2, 2017 2:14:35 AM)

  1. [libclang] Revert rL301328 and add tests for the regressions introduced.

    Differential Revision: — emilio / ViewSVN

r301901 (#5652) (May 2, 2017 12:30:11 AM)

  1. [APInt] Move APInt::getSplat out of line.

    I think this method is probably too complex to be inlined. — ctopper / ViewSVN

r301900 (#5651) (May 1, 2017 11:39:41 PM)

  1. [APInt] Move the setBit and clearBit methods inline.

    This makes setBit/clearBit more consistent with setBits which is already inlined. — ctopper / ViewSVN
  2. Refactor callsite cost computation into a helper function /NFC

    Makes code more readable. The function will also be used
    by the partial inlining's cost analysis. — davidxl / ViewSVN
  3. clang/test/Modules/diag-flags.cpp: Appease targeting *-win32 with explicit triple. Fixes r301846.

    MicrosoftRecordLayoutBuilder doesn't have ability of -Wpadded.

    FIXME: Would other diag be available here? — chapuni / ViewSVN

r301897 (#5650) (May 1, 2017 10:49:41 PM)

  1. ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO.

    If there is a bug in the LTO implementation that causes it to fail to provide
    an expected symbol definition, the linker should report an undefined symbol
    error. Unfortunately, we were failing to do so if the symbol definition
    was weak, as the undefine() function was turning the definition into a weak
    undefined symbol, which resolves to zero if the symbol remains undefined. This
    patch causes us to set the binding to STB_GLOBAL when we undefine a symbol.

    I can't see a good way to test this. The behaviour should only be observable
    if there is a bug in the LTO implementation.

    Differential Revision: — pcc / ViewSVN

r301896 (#5649) (May 1, 2017 9:29:34 PM)

  1. Update commetns. — ruiu / ViewSVN
  2. Make getArchiveMembers function a non-member function.

    It didn't have to be a member function of Driver. This patch makes
    that function a file-scoped non-member function. — ruiu / ViewSVN

r301894 (#5648) (May 1, 2017 8:39:21 PM)

  1. [PartialInlining] Hook up inline cost analysis

    Differential Revision: — davidxl / ViewSVN
  2. [AVR] Save/restore the frame pointer for all functions

    A recent commit I made made it so that we only did this for signal or
    interrupt handlers. This broke normal functions. — dylanmckay / ViewSVN
  3. [PowerPC] Emit VMX loads/stores for aligned ops to avoid adding swaps on LE

    Fixes PR30730.
    This is a re-commit of a pulled commit. The commit was pulled because some
    software projects contained uses of Altivec vectors that violated alignment
    requirements. Known issues have now been fixed.

    Committing on behalf of Lei Huang.

    Differential Revision: — nemanjai / ViewSVN

r301891 (#5647) (May 1, 2017 7:16:25 PM)

  1. Revert r301785 (and r301787) because they caused PR32864.

    The fix is that ExprEvaluatorBase::VisitInitListExpr should handle transparent exprs instead of exprs with one element. Fixing that uncovers one testcase failure because the AST for "constexpr _Complex float test2 = {1};" is wrong (the _Complex prvalue should not be const-qualified), and a number of test failures in test/OpenMP where the captured stmt contains an InitListExpr that is in syntactic form. — nicholas / ViewSVN
  2. [AArch64] armv8-A doesn't have LSE.

    r288279 mistakenly added it to all arches, but it's only available
    from v8.1 onwards.

    The testcase is awkward, because (I suspect) of PR32873.

    Spotted by inspection. — Ahmed Bougacha / ViewSVN
  3. [sanitizer-coverage] add a deprecation note for the old sanitizer-coverage; remove a TODO printf — kcc / ViewSVN
  4. [sanitizer-coverage] update the SanitizerCoverage docs to reflect the current state — kcc / ViewSVN

r301887 (#5646) (May 1, 2017 6:24:36 PM)

  1. [AVR] Fix a bug where the frame pointer is clobbered

    Because it was a callee-saved register, we automatically generated code
    to spill and unspill its original value so that it is restored after the
    function returns.

    The problem is that this code was being generated before the epilogue.
    The epilogue itself uses the Y register, which could be prematurely
    restored by the CSR restoration process.

    This removes R29R28 from the CSR list and changes the prologue/epilogue
    code to handle it explicitly. — dylanmckay / ViewSVN

r301886 (#5645) (May 1, 2017 5:34:17 PM)

  1. Fixing an unbound local variable in Jenkins/ — sqlbyme / ViewSVN
  2. Revert r301880

    This change caused buildbot failures, apparently because we're not
    passing around types that InstSimplify is used to seeing. I'm not overly
    familiar with InstSimplify, so I'm reverting this until I can figure out
    what exactly is wrong. — George Burgess IV / ViewSVN
  3. [ZORG] Update Jenkins/ to force SVN upgrade of the working directory. — sqlbyme / ViewSVN
  4. Stylistic makeover of DWARFDebugLine before working on it. NFC

    Rename parameters and locals to CamelCase, doxygenize the header, and
    run clang-format on the whole thing. — probinson / ViewSVN
  5. [CodeView] Write CodeView line information.

    Differential Revision: — zturner / ViewSVN

r301881 (#5644) (May 1, 2017 4:56:03 PM)

  1. [AVR] Enable the frame pointer for all functions

    This is a temporary measure while we figure out a way to get the frame
    pointer working correctly. — dylanmckay / ViewSVN
  2. [InstSimplify] Handle selects of GEPs with 0 offset

    In particular (since it wouldn't fit nicely in the summary):
    (select (icmp eq V 0) P (getelementptr P V)) -> (getelementptr P V)

    Differential Revision: — George Burgess IV / ViewSVN

r301879 (#5643) (May 1, 2017 4:54:59 PM)

  1. [X86] Reduce code for setting operations actions by merging into loops across multiple types/ops. NFCI. — rksimon / ViewSVN
  2. Empty Space. NFC — trentxintong / ViewSVN
  3. [IR] Garbage collect unused variants. NFCI. — davide / ViewSVN
  4. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  5. Creating release directory for release_401. — tstellar / ViewSVN
  6. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  7. Creating release directory for release_401. — tstellar / ViewSVN
  8. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  9. Creating release directory for release_401. — tstellar / ViewSVN
  10. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  11. Creating release directory for release_401. — tstellar / ViewSVN
  12. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  13. Creating release directory for release_401. — tstellar / ViewSVN
  14. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  15. Creating release directory for release_401. — tstellar / ViewSVN
  16. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  17. Creating release directory for release_401. — tstellar / ViewSVN
  18. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  19. Creating release directory for release_401. — tstellar / ViewSVN
  20. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  21. Creating release directory for release_401. — tstellar / ViewSVN
  22. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  23. Creating release directory for release_401. — tstellar / ViewSVN
  24. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  25. Creating release directory for release_401. — tstellar / ViewSVN
  26. Creating release candidate rc1 from release_401 branch — tstellar / ViewSVN
  27. Creating release directory for release_401. — tstellar / ViewSVN
  28. Fix a pessimising move warning. — pcc / ViewSVN
  29. MachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC

    This tracks whether MaxCallFrameSize is computed yet. Ideally we would
    assert and fail when the value is queried before it is computed, however
    this fails various targets that need to be fixed first.

    Differential Revision: — matze / ViewSVN
  30. llvm-link: Add BitReader to deps corresponding to r301832. — chapuni / ViewSVN
  31. [NewGVN] Don't derive incorrect implications.

    In the testcase attached,  we believe %tmp1 implies %tmp4.
      br i1 %tmp1, label %bb2, label %bb7
      br i1 %tmp4, label %bb5, label %bb7

    because Wwhile looking at PredicateInfo stuffs we end up calling
    isImpliedTrueByMatchingCmp() with the arguments backwards.

    Differential Revision: — davide / ViewSVN
  32. [InstCombine] check one-use before applying DeMorgan nor/nand folds

    If we have ~(~X & Y), it only makes sense to transform it to (X | ~Y) when we do not need
    the intermediate (~X & Y) value. In that case, we would need an extra instruction to
    generate ~Y + 'or' (as shown in the test changes).

    It's ok if we have multiple uses of ~X or Y, however. In those cases, we may not reduce the
    instruction count or critical path, but we might improve throughput because we can generate
    ~X and ~Y in parallel. Whether that actually makes perf sense or not for a target is something
    we can't answer in IR.

    Differential Revision: — spatel / ViewSVN

r301847 (#5642) (May 1, 2017 4:16:07 PM)

  1. New file missed from r301846. — rsmith / ViewSVN
  2. Fix initial diagnostic state setup for an explicit module with no diagnostic pragmas.

    If a file has no diagnostic pragmas, we build its diagnostic state lazily, but
    in this case we never set up the root state to be the diagnostic state in which
    the module was originally built, so the diagnostic flags for files in the
    module with no diagnostic pragmas were incorrectly based on the user of the
    module rather than the diagnostic state when the module was built. — rsmith / ViewSVN
  3. [sanitizer-coverage] remove more stale code — kcc / ViewSVN
  4. Adds initial llvm-dwarfdump --verify support with unit tests.

    lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.

    The first part of the verify does the following:

    - verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
    - verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
    - verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
    - verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
    - verifies that all DW_FORM_strp attributes have valid .debug_str offsets

    Unit tests were added for each of the above cases.

    Differential Revision: — gclayton / ViewSVN
  5. Bitcode: Make the summary reader responsible for merging. NFCI.

    This is to prepare for an upcoming change which uses pointers instead of
    GUIDs to represent references.

    Differential Revision: — pcc / ViewSVN
  6. [APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.

    We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size. — ctopper / ViewSVN
  7. [AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.

    NFC — qcolombet / ViewSVN
  8. Put back REQUIRES: system-darwin to fix asan bot.

    These tests do not appear to be Darwin-specific, and this REQUIRES: appears to
    be hiding a real bug; this change is just restoring the prior state to get the
    buildbots happy again while we investigate. (The system-darwin requirement is
    covered by PR32851.) — rsmith / ViewSVN
  9. [ubsan] Fall back to the fast unwinder when print_stacktrace=1

    This makes it possible to get stacktrace info when print_stacktrace=1 on
    Darwin (where the slow unwinder is not currently supported [1]). This
    should not regress any other platforms.

    [1] The thread about r300295 has a relatively recent discusion about
    this. We should be able to enable the existing slow unwind functionality
    for Darwin, but this needs more testing.

    Differential Revision: — Vedant Kumar / ViewSVN
  10. [APInt] Fix copy/paste mistake in comment for isNullValue. NFC — ctopper / ViewSVN

r301837 (#5641) (May 1, 2017 3:26:07 PM)

  1. [asan] speed up small memcpy (> 32 but <= 64 bytes) — kcc / ViewSVN
  2. Reorder release notes, fix missing link and a grammar issue.

    Patch by Réka Nikolett Kovács! — xazax / ViewSVN
  3. IPO: Add missing build dep. — pcc / ViewSVN
  4. [X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.

    Since the shuffle refactor, this is only used during BUILD_VECTOR lowering. — rksimon / ViewSVN

r301833 (#5640) (May 1, 2017 2:36:10 PM)

  1. Add comments about how we handle mergeable sections with relocations.

    Also factored out code. — ruiu / ViewSVN
  2. Object: Remove ModuleSummaryIndexObjectFile class.

    Differential Revision: — pcc / ViewSVN
  3. Add powerpc64 and powerpc64le to build infrastructure.

    From Phab D32031. — saugustine / ViewSVN
  4. Fix pr32816.

    When using linkerscripts we were trying to sort SHF_LINK_ORDER
    sections too early. Instead of always doing two runs of
    assignAddresses, record the section order in processCommands. — rafael / ViewSVN
  5. [Hexagon] Replace CVI_VM_CUR_LD type with CVI_VM_LD

    A .cur instruction can be identified by checking isCVINew() && mayLoad().

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  6. [Hexagon] Improving error reporting for writing to read only registers

    Patch by Colin LeMahieu. — kparzysz / ViewSVN
  7. [Hexagon] Give better error messages for solo instruction errors

    Patch by Colin LeMahieu. — kparzysz / ViewSVN

r301826 (#5639) (May 1, 2017 1:46:10 PM)

  1. [sanitizer-coverage] disable coverage_direct=1, will remove the code in a few weeks — kcc / ViewSVN
  2. Silence unused variable warning. NFC. — d0k / ViewSVN
  3. [sanitizer-coverage] add a deprecation note to coverage_direct=1 — kcc / ViewSVN
  4. [Hexagon] Improve shuffle error reporting

    Patch by Colin LeMahieu. — kparzysz / ViewSVN

r301822 (#5638) (May 1, 2017 12:56:05 PM)

  1. Improve handling of arrays of unknown bound in constant expressions.

    Do not spuriously reject constexpr functions that access elements of an array
    of unknown bound; this may later become valid once the bound is known. Permit
    array-to-pointer decay on such arrays, but disallow pointer arithmetic (since
    we do not know whether it will have defined behavior).

    The standard is not clear on how this should work, but this seems to be a
    decent answer.

    Patch by Robert Haberlach! — rsmith / ViewSVN
  2. Change an unusual directory permission back to a sane value after test.

    Leaving a directory with a permission 0o100 is inconvenient.
    For example, macOS's rm can't remove such directory. — ruiu / ViewSVN
  3. Cleanup previous test commit. — saugustine / ViewSVN

r301819 (#5637) (May 1, 2017 12:06:04 PM)

  1. X86: initialize a few subtarget variables.

    Otherwise an indeterminate value gets read, causing a bunch of UBSan failures. — Tim Northover / ViewSVN
  2. Add a blank line as a test-commit.

    Per — saugustine / ViewSVN
  3. Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC

    This was an omission in r301813.  I had made the supporting changes to
    make this happen, but I forgot to actually update the PrevPair
    declaration. — sanjoy / ViewSVN
  4. Take indirect branch into account as well when folding.

    We may not be able to rewrite indirect branch target, but we also want to take it into
    account when folding, i.e. if it and all its successor's predecessors go to the same
    destination, we can fold, i.e. no need to thread. — trentxintong / ViewSVN
  5. Adapt to LLVM's rename of WeakVH to WeakTrackingVH; NFC — sanjoy / ViewSVN
  6. Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts

    In cases where an instruction (a call site, say) is RAUW'ed with some
    other value (this is possible via the `returned` attribute, for
    instance), we want the slot in UnknownInsts to point to the original
    Instruction we wanted to track, not the value it got replaced by.

    Fixes PR32587.

    This relands r301426. — sanjoy / ViewSVN
  7. Add a new WeakVH value handle; NFC

    This relands r301425. — sanjoy / ViewSVN
  8. Rename WeakVH to WeakTrackingVH; NFC

    This relands r301424. — sanjoy / ViewSVN

r301811 (#5636) (May 1, 2017 10:45:17 AM)

  1. [WebAssembly] Fix use of SDNodeFlags after API change in r301803 — dschuff / ViewSVN
  2. [PDB/CodeView] Rename some classes.

    In preparation for introducing writing capabilities for each of
    these classes, I would like to adopt a Foo / FooRef naming
    convention, where Foo indicates that the class can manipulate and
    serialize Foos, and FooRef indicates that it is an immutable view of
    an existing Foo.  In other words, Foo is a writer and FooRef is a
    reader.  This patch names some existing readers to conform to the
    FooRef convention, while offering no functional change. — zturner / ViewSVN
  3. Emulate TrackingVH using WeakVH

    This frees up one slot in the HandleBaseKind enum, which I will use
    later to add a new kind of value handle.  The size of the
    HandleBaseKind enum is important because we store a HandleBaseKind in
    the low two bits of a (in the worst case) 4 byte aligned pointer.

    Reviewers: davide, chandlerc

    Subscribers: mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  4. [JumpThread] Add some assertions for expected ConstantInt/BlockAddress — trentxintong / ViewSVN
  5. Remove unnecessary conditions as suggested by clang-tidy. NFC

    Patch by: Gergely Angeli!

    Differential Revision: — xazax / ViewSVN
  6. [SelectionDAG] Use known ones to provide a better bound for the known zeros for CTTZ/CTLZ operations.

    This is the SelectionDAG version of D32521. If know where at least one 1 is located in the input to these intrinsics we can place an upper bound on the number of bits needed to represent the count and thus increase the number of known zeros in the output.

    I think we can also refine this further for CTTZ_UNDEF/CTLZ_UNDEF by assuming that the answer will never be BitWidth. I've left this out for now because it caused other test failures across multiple targets. Usually because of turning ADD into OR based on this new information.

    I'll fix CTPOP in a future patch.

    Differential Revision: — ctopper / ViewSVN
  7. Relax testcase to fix a PS4 buildbot failure. — Adrian Prantl / ViewSVN

r301804 (#5635) (May 1, 2017 9:25:02 AM)

  1. [JumpThread] Do RAUW in case Cond folds to a constant in the CFG

    Summary: [JumpThread] Do RAUW in case Cond folds to a constant in the CFG

    Reviewers: sanjoy

    Reviewed By: sanjoy

    Subscribers: llvm-commits

    Differential Revision: — trentxintong / ViewSVN
  2. Generalize the specialized flag-carrying SDNodes by moving flags into SDNode.

    This removes BinaryWithFlagsSDNode, and flags are now all passed by value.

    Differential Revision: — aemerson / ViewSVN
  3. [InstCombine] add multi-use variants for DeMorgan folds; NFC — spatel / ViewSVN
  4. [InstCombine] use FileCheck and auto-generate checks; NFC — spatel / ViewSVN

r301800 (#5634) (May 1, 2017 8:05:00 AM)

  1. [InstCombine] consolidate more DeMorgan tests; NFC — spatel / ViewSVN
  2. Fix test for altmacro — mzuckerm / ViewSVN
  3. [powerpc] deactivate flakey tests on powerpc64le

    These test cases occassionally fail when run on powerpc64le:

    The failures cause false problem reports to be sent to developers whose
    code had nothing to do with the failures.  Reactivate them when the real
    problems are fixed.

    This could also be related to the same problems as with the tests
    ThreadedOneSizeMallocStressTest, ThreadedMallocStressTest, ManyThreadsTest,
    and several others that do not run reliably on powerpc. — seurer / ViewSVN
  4. [LLVM][inline-asm] Altmacro absolute expression '%' feature

    In this patch, I introduce a new alt macro feature.
    This feature adds meaning for the % when using it as a prefix to the calling macro arguments.

    In the altmacro mode, the percent sign '%' before an absolute expression convert the expression first to a string.
    As described in the
    "Expression results as strings
    You can write `%expr' to evaluate the expression expr and use the result as a string."

    expression assumptions:

    1. '%' can only evaluate an absolute expression.
    2. Altmacro '%' must be the first character of the evaluated expression.
    3. If no '%' is located before the expression, a regular module operation is expected.
    4. The result of Absolute Expressions can be only integer.

    Differential Revision: — mzuckerm / ViewSVN

r301796 (#5633) (May 1, 2017 6:44:34 AM)

  1. The -coverage-file flag was removed in r280306, and this piece was missed; NFC. — aaronballman / ViewSVN

r301795 (#5632) (May 1, 2017 3:51:43 AM)

  1. tsan: support linker init flag in __tsan_mutex_destroy

    For a linker init mutex with lazy flag setup
    (no __tsan_mutex_create call), it is possible that
    no lock/unlock happened before the destroy call.
    Then when destroy runs we still don't know that
    it is a linker init mutex and will emulate a memory write.
    This in turn can lead to false positives as the mutex
    is in fact linker initialized.

    Support linker init flag in destroy annotation to resolve this. — dvyukov / ViewSVN
  2. [AVR] Implement non-constant bit rotations

    This lets us do bit rotations of variable amount. — dylanmckay / ViewSVN

r301793 (#5631) (May 1, 2017 2:31:32 AM)

  1. [GlobalISel][X86] rename test file. NFC. — ibreger / ViewSVN

r301792 (#5630) (May 1, 2017 1:10:37 AM)

  1. [GlobalISel][X86] Prioritize Tablegen-erated instruction selection. NFC

    Prioritizes Tablegen-erated instruction selection over C++ instruction selection.
    Remove G_ADD/G_SUB C++ selection - implemented by Tablegen.

    Reviewers: dsanders, zvi, guyblank

    Reviewed By: guyblank

    Subscribers: rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN
  2. [X86] Add tests for opportunities to improve known bits for CTTZ and CTLZ. — ctopper / ViewSVN
  3. [GlobalISel][X86] G_SEXT/G_ZEXT support.

    Reviewers: zvi, guyblank

    Reviewed By: zvi

    Subscribers: rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN
  4. Remove unneeded struct; NFC

    Unless I'm missing something, the DeferredGlobal struct's GV field is
    unused, removing which makes the struct itself trivial.

    Reviewers: rafael, chandlerc

    Subscribers: mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN

r301788 (#5629) (Apr 30, 2017 11:49:44 PM)

  1. [GlobalISel][X86] G_LOAD/G_STORE pointer selection support.

    Summary: [GlobalISel][X86] G_LOAD/G_STORE pointer selection support.

    Reviewers: zvi, guyblank

    Reviewed By: zvi, guyblank

    Subscribers: dberris, rovka, kristof.beyls, llvm-commits

    Differential Revision: — ibreger / ViewSVN

r301787 (#5628) (Apr 30, 2017 8:35:48 PM)

  1. Fix test that was incorrected merged between patches. — nicholas / ViewSVN
  2. Fix line endings (dos -> unix) and clang-format while I'm here — dblaikie / ViewSVN

r301785 (#5627) (Apr 30, 2017 7:45:36 PM)

  1. Handle expressions with non-literal types like ignored expressions if we are supposed to continue evaluating them.

    Also fix a crash casting a derived nullptr to a virtual base. — nicholas / ViewSVN

r301784 (#5626) (Apr 30, 2017 6:55:34 PM)

  1. [XRay][compiler-rt] Document and update the XRay Logging API

    In this patch we document the requirements for implementations that want
    to install handlers for the dynamically-controlled XRay "framework".
    This clarifies what the expectations are for implementations that
    want to install their handlers using this API (similar to how the FDR
    logging implementation does so). It also gives users some guarantees on
    semantics for the APIs.

    If all goes well, users can decide to use the XRay APIs to control the
    tracing/logging at the application level, without having to depend on
    implementation details of the installed logging implementation. This
    lets users choose the implementation that comes with compiler-rt, or
    potentially multiple other implementations that use the same APIs.

    We also add one convenience function (__xray_remove_log_impl()) for
    explicitly removing the currently installed log implementation.

    Reviewers: kpw, pelikan

    Subscribers: llvm-commits

    Differential Revision: — dberris / ViewSVN

r301783 (#5625) (Apr 30, 2017 6:05:25 PM)

  1. utils: Silence -Wpedantic warning

    llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp:1673:67: warning: default argument specified for lambda parameter [-Wpedantic]
                        const Record *Constraint = nullptr) {

    Found by gcc 5.4.0. — Saleem Abdulrasool / ViewSVN

r301782 (#5624) (Apr 30, 2017 5:15:21 PM)

  1. [AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset

    Before this, the LDS/STS instructions would have their opcodes
    overwritten while linking. — dylanmckay / ViewSVN

r301781 (#5623) (Apr 30, 2017 4:25:12 PM)

  1. [DAGCombiner] shrink/widen a vselect to match its condition operand size (PR14657)

    We discussed shrinking/widening of selects in IR in D26556, and I'll try to get back to that
    patch eventually. But I'm hoping that this transform is less iffy in the DAG where we can check
    legality of the select that we want to produce.

    A few things to note:

    1. We can't wait until after legalization and do this generically because (at least in the x86
       tests from PR14657), we'll have PACKSS and bitcasts in the pattern.
    2. This might benefit more of the SSE codegen if we lifted the legal-or-custom requirement, but
       that requires a closer look to make sure we don't end up worse.
    3. There's a 'vblendv' opportunity that we're missing that results in andn/and/or in some cases.
       That should be fixed next.
    4. I'm assuming that AVX1 offers the worst of all worlds wrt uneven ISA support with multiple
       legal vector sizes, but if there are other targets like that, we should add more tests.
    5. There's a codegen miracle in the multi-BB tests from PR14657 (the gcc auto-vectorization tests):
       despite IR that is terrible for the target, this patch allows us to generate the optimal loop
       code because something post-ISEL is hoisting the splat extends above the vector loops.

    Differential Revision: — spatel / ViewSVN

r301780 (#5622) (Apr 30, 2017 3:10:35 PM)

  1. [clang-tidy] Fix naming convention in modernize-use-emplace

    Summary: Conform to the llvm naming convention for local variables in modernize-use-emplace check.

    Reviewers: Prazek, JonasToth, alexfh

    Reviewed By: Prazek, JonasToth, alexfh

    Subscribers: cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — kuhar / ViewSVN
  2. [CMake] Move PollyCore to Polly project folder.

    This keeps the artifacts consistently structured in the "Polly"
    folder of Visual Studio solutions. — meinersbur / ViewSVN
  3. Fix comments. — ruiu / ViewSVN

r301777 (#5621) (Apr 30, 2017 2:20:04 PM)

  1. [tsan] Track external tags in thread traces

    To make the TSan external API work with Swift and other use cases, we need to track "tags" for individual memory accesses. Since there is no space to store this information in shadow cells, let's use the thread traces for that. This patch stores the tag as an extra frame in the stack traces (by calling FuncEntry and FuncExit with the address of a registered tag), this extra frame is then stripped before printing the backtrace to stderr.

    Differential Revision: — kuba.brecka / ViewSVN

r301776 (#5620) (Apr 30, 2017 1:29:43 PM)

  1. Rename isKnownNotFullPoison to programUndefinedIfPoison; NFC

    programUndefinedIfPoison makes more sense, given what the function
    does; and I'm about to add a function with a name similar to
    isKnownNotFullPoison (so do the rename to avoid confusion).

    Reviewers: broune, majnemer, bjarke.roune

    Reviewed By: broune

    Subscribers: mcrosier, llvm-commits, mzolotukhin

    Differential Revision: — sanjoy / ViewSVN
  2. Do not legalize large add with addc/adde, introduce addcarry and do it with uaddo/addcarry

    Summary: As per discution on how to get better codegen an large int legalization, it became clear that using a glue for the carry was preventing several desirable optimizations. Passing the carry down as a value allow for more flexibility.

    Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

    Subscribers: igorb, llvm-commits

    Differential Revision: — deadalnix / ViewSVN

r301774 (#5619) (Apr 30, 2017 12:39:29 PM)

  1. [InstCombine] consolidate tests for DeMorgan folds; NFC

    I'm proposing to add tests and change behavior in D32665. — spatel / ViewSVN

r301773 (#5618) (Apr 30, 2017 11:04:37 AM)

  1. [docs] Simplify some language for Error/cantFail in the programmer's manual. — Lang Hames / ViewSVN

r301772 (#5617) (Apr 30, 2017 7:50:16 AM)

  1. Ignore -no-keep-memory.

    When the -no-keep-memory option is given, BFD linker tries to save
    memory in their own way. Since our internal architecture is completely
    different from that linker, that option doesn't make sense to us. — ruiu / ViewSVN
  2. Move LTO options above "all options beyond this are ignored" comment — ruiu / ViewSVN

r301770 (#5616) (Apr 30, 2017 6:29:41 AM)

  1. [MVT] fix typo in size of v1i8 MVT.

    Ths issue was found in the review of another patch — guyblank / ViewSVN

r301769 (#5615) (Apr 30, 2017 1:55:24 AM)

  1. [APInt] Remove support for wrapping from APInt::setBits.

    This features isn't used anywhere in tree. It's existence seems to be preventing selfhost builds from inlining any of the setBits methods including setLowBits, setHighBits, and setBitsFrom. This is because the code makes the method recursive.

    If anyone needs this feature in the future we could consider adding a setBitsWithWrap method. This way only the calls that need it would pay for it. — ctopper / ViewSVN
  2. [APInt] Replace calls to setBits with more specific calls to setBitsFrom and setLowBits where possible. — ctopper / ViewSVN
  3. [X86] Clear KnownBits instead of reconstructing it. NFC — ctopper / ViewSVN

r301766 (#5614) (Apr 30, 2017 1:05:09 AM)

  1. InstructionSimplify: Canonicalize shuffle operands. NFC-ish.

    Apply canonicalization rules:
        1. Input vectors with no elements selected from can be replaced with undef.
        2. If only one input vector is constant it shall be the second one.

    This allows constant-folding to cover more ad-hoc simplifications that
    were in place and avoid duplication for RHS and LHS checks.

    There are more rules we may want to add in the future when we see a
    justification. e.g. mask elements that select undef elements can be
    replaced with undef.

    Reviewers: spatel, RKSimon, andreadb, davide

    Reviewed By: spatel, RKSimon

    Subscribers: llvm-commits

    Differential Revision: — zvi / ViewSVN
  2. InstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.

    Summary: This is a preparatory step for D32338.

    Reviewers: RKSimon, spatel

    Reviewed By: RKSimon, spatel

    Subscribers: spatel, llvm-commits

    Differential Revision: — zvi / ViewSVN

r301764 (#5613) (Apr 29, 2017 11:44:36 PM)

  1. InstructionSimplify: Simplify a shuffle with a undef mask to undef

    Following the discussion in pr32486, adding the simplification:
    shuffle %x, %y, undef -> undef

    Reviewers: spatel, RKSimon, andreadb, davide

    Reviewed By: spatel

    Subscribers: jroelofs, davide, llvm-commits

    Differential Revision: — zvi / ViewSVN

r301763 (#5612) (Apr 29, 2017 10:09:27 PM)

  1. [mips] Emit R_MICROMIPS_TLS_GOTTPREL relocation for %gottprel in case of microMIPS

    In case of microMIPS mode %gottprel operator should emit microMIPS

    Differential Revision: — atanasyan / ViewSVN

r301762 (#5611) (Apr 29, 2017 9:04:49 PM)

  1. clang-tools-extra/test/CMakeLists.txt: Rework r297806 (D29851) to make sure test utils should be built.

    FIXME: This may be moved to llvm's add_lit_target(). — chapuni / ViewSVN

r301761 (#5610) (Apr 29, 2017 7:42:47 PM)

  1. [ConstantRange] Fix a couple cases where we were possibly throwing away an APInt allocation we could reuse. NFC

    This uses setAllBits to replace getMaxValue and operator=(uint64_t) instead of constructing an APInt from uint64_t. — ctopper / ViewSVN

r301760 (#5609) (Apr 29, 2017 6:20:43 PM)

  1. Include <cstdio> in PrettyStackTrace.cpp, since it uses vsnprintf(3). — dim / ViewSVN

r301759 (#5608) (Apr 29, 2017 5:26:10 PM)

  1. Rename RPath Rpath for consistency. NFC.

    For an option -foo-bar-baz, we have Config->FooBarBaz. Since -rpath is
    -rpath and not -r-path, it should be Config->Rpath instead Config->RPath. — ruiu / ViewSVN

r301758 (#5607) (Apr 29, 2017 4:34:53 PM)

  1. Simplify by using getString instead of getLastArg. NFC. — ruiu / ViewSVN
  2. Report an error if --compress-debug-sections is given while zlib is not availble. — ruiu / ViewSVN

r301756 (#5606) (Apr 29, 2017 1:43:09 PM)

  1. [globalisel][tablegen] Fix the test after silencing the unused variable warning in r301755. — dsanders / ViewSVN
  2. [globalisel][tablegen] Silence unused variable warning. — dsanders / ViewSVN
  3. Port recent changes to ELF/MapFile.cpp to COFF. — ruiu / ViewSVN

r301753 (#5605) (Apr 29, 2017 12:11:17 PM)

  1. [ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC — ctopper / ViewSVN
  2. [ConstantRange] Replace getMaxValue+zext with getLowBitsSet. Replace zero-init+setBit with getOneBitSet. NFC — ctopper / ViewSVN
  3. [ConstantRange] Use APInt::operator-= to remove temporary APInts. — ctopper / ViewSVN

r301750 (#5604) (Apr 29, 2017 11:21:04 AM)

  1. [globalisel][tablegen] Compute available feature bits correctly.

    Predicate<> now has a field to indicate how often it must be recomputed.
    Currently, there are two frequencies, per-module (RecomputePerFunction==0)
    and per-function (RecomputePerFunction==1). Per-function predicates are
    currently recomputed more frequently than necessary since the only predicate
    in this category is cheap to test. Per-module predicates are now computed in
    getSubtargetImpl() while per-function predicates are computed in selectImpl().

    Tablegen now manages the PredicateBitset internally. It should only be
    necessary to add the required includes.

    Also fixed a problem revealed by the test case where
    constrainSelectedInstRegOperands() would attempt to tie operands that
    BuildMI had already tied.

    Reviewers: ab, qcolombet, t.p.northover, rovka, aditya_nandakumar

    Reviewed By: rovka

    Subscribers: kristof.beyls, igorb, llvm-commits

    Differential Revision: — dsanders / ViewSVN
  2. [X86][AVX] Added support for _mm256_zext* helper intrinsics (PR32839) — rksimon / ViewSVN
  3. [X86][AVX] Added codegen tests for _mm256_zext* helper intrinsics (PR32839)

    Not great codegen, especially as VEX moves support implicit zeroing of upper bits.... — rksimon / ViewSVN

r301747 (#5603) (Apr 29, 2017 10:31:15 AM)

  1. [KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state

    Summary: This patch adds isNegative, isNonNegative for querying whether the sign bit is known. It also adds makeNegative and makeNonNegative for controlling the sign bit.

    Reviewers: RKSimon, spatel, davide

    Reviewed By: RKSimon

    Subscribers: llvm-commits

    Differential Revision: — ctopper / ViewSVN
  2. [mips][FastISel] Fix a nullptr deference.

    r301392 introduced a potential nullptr deference causing compilation
    failures. — sdardis / ViewSVN

r301745 (#5602) (Apr 29, 2017 9:30:51 AM)

  1. Bring back r301678.

    This version uses a set to speed up the synchronize method.

    Original message:

        Remove LinkerScript::flush.

        This patch replaces flush with a last ditch attempt at synchronizing
        the section list with the linker script "AST".

        The synchronization is a bit of a hack and should in time be avoided
        by creating the AST earlier so that modifications can be made directly
        to it instead of modifying the section list and synchronizing it back.

        This is the main step for fixing With this in place I
        think the only missing thing would be to have processCommands assign
        section indexes as dummy offsets so that the sort in
        OutputSection::finalize works.

        With this LinkerScript::assignAddresses becomes much simpler, which
        should help with the thunk work. — rafael / ViewSVN

r301744 (#5601) (Apr 29, 2017 8:09:36 AM)

  1. [X86][SSE] Add initial <2 x half> tests for PR31088

    As discussed on D32391, test X86/X64 SSE2 and X64 F16C. — rksimon / ViewSVN

r301743 (#5600) (Apr 29, 2017 5:44:33 AM)

  1. [clang-tidy] Expand AllowConditional*Casts to binary logical operators — alexfh / ViewSVN

r301742 (#5599) (Apr 29, 2017 3:14:48 AM)

  1. Remove Sema::CheckForIntOverflow, and instead check all full-expressions.

    CheckForIntOverflow used to implement a whitelist of top-level expressions to
    send to the constant expression evaluator, which handled many more expressions
    than the CheckForIntOverflow whitelist did. — nicholas / ViewSVN

r301741 (#5598) (Apr 29, 2017 1:21:02 AM)

  1. [ConstantRange] Use ternary operator instead of 'if' to avoid copying an APInt and then possibly copying over it. — ctopper / ViewSVN
  2. [ConstantRange] Add std::move to a bunch of places that pass local APInts to ConstantRange constructor.

    The ConstantRange constructor takes APInt by value so without these moves we are making copies. — ctopper / ViewSVN

r301739 (#5597) (Apr 29, 2017 12:30:58 AM)

  1. Update sponsor — tbrethou / ViewSVN

r301738 (#5596) (Apr 28, 2017 11:40:04 PM)

  1. Remove unused private field. — zturner / ViewSVN
  2. [ConstantRange] Remove a temporary APInt I meant to delete in r300621. NFC — ctopper / ViewSVN

r301736 (#5595) (Apr 28, 2017 10:49:25 PM)

  1. [ConstantRange] Improve the efficiency of one of the ConstantRange constructors.

    We were default constructing the Lower/Upper APInts. Then creating min or max value, then doing a move assignment to Lower and copy assignment to upper. The copy assignment operator in particular has an out of line function call that has to examine whether or not a previous allocation exists that can be reused which of course it can't in this case.

    The new code creates the min/max value first, move constructs Lower from it then copy constructs Upper from Lower.

    This also seems to have convinced a self host build that this constructor can be inlined more readily into other methods in ConstantRange. — ctopper / ViewSVN

r301735 (#5594) (Apr 28, 2017 9:46:14 PM)

  1. Fix PR32831: 'this capture while instantiating generic lambda call operator specialization

    When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda. — faisalv / ViewSVN
  2. [Polly] Make PollyCore depends on intrinsics_gen — ether / ViewSVN

r301733 (#5593) (Apr 28, 2017 8:54:22 PM)

  1. Remove the source code as well if a clean build is requested by a property; make sure LIT is in the verbose mode by default. — gkistanova / ViewSVN

r301732 (#5592) (Apr 28, 2017 7:51:22 PM)

  1. Remove some apparently-unnecessary 'REQUIRES: system-darwin' from tests.

    Let's see if any buildbots actually have trouble with these. (They at least pass on Linux.) — rsmith / ViewSVN
  2. Fix "REQUIRES: system-darwin" failing tests after r301725.

    Also remove the apparently-unneeded REQUIRES (the tests also pass on at least
    Linux, and don't appear to have anything Darwin-specific in them). — rsmith / ViewSVN
  3. AMDGPU: Fix copies from physical registers in SIFixSGPRCopies

    This would assert when there were multiple defs of
    a physical register.

    We just need to move all of the users of it. — arsenm / ViewSVN
  4. [ELF] When a rel points to a SHF_MERGE section, don't merge the sec.

    Fixes PR32785. Thanks to Piotr Padlewski for the report and
    Rafael for the fix. — davide / ViewSVN

r301728 (#5591) (Apr 28, 2017 7:01:30 PM)

  1. [llvm-pdbdump] Abstract some of the YAML/Raw printing code.

    There is a lot of duplicate code for printing line info between
    YAML and the raw output printer.  This introduces a base class
    that can be shared between the two, and makes some minor
    cleanups in the process. — zturner / ViewSVN
  2. PR26771: don't forget the " 2" (returning from #included file) linemarker after including an empty file with -frewrite-includes. — rsmith / ViewSVN
  3. Remove unused, empty test directories. — rsmith / ViewSVN
  4. Add pragma to perform module import and use it in -E output.

    Many of our supported configurations support modules but do not have any
    first-class syntax to perform a module import. This leaves us with a problem:
    there is no way to represent the expansion of a #include that imports a module
    in the -E output for such languages. (We don't want to just leave it as a
    #include because that requires the consumer of the preprocessed source to have
    the same file system layout and include paths as the creator.)

    This patch adds a new pragma:

      #pragma clang module import MODULE.NAME.HERE

    that imports a module, and changes -E and -frewrite-includes to use it when
    rewriting a #include that maps to a module import. We don't make any attempt
    to use a native language syntax import if one exists, to get more consistent
    output. (If in the future, @import and #include have different semantics in
    some way, the pragma will track the #include semantics.) — rsmith / ViewSVN
  5. [ObjCARC] Do not move a release between a call and a
    retainAutoreleasedReturnValue that retains the returned value.

    This commit fixes a bug in ARC optimizer where it moves a release
    between a call and a retainAutoreleasedReturnValue, causing the returned
    object to be released before the retainAutoreleasedReturnValue can
    retain it.

    This commit accomplishes that by doing a lookahead and checking whether
    the call prevents the release from moving upwards. In the long term, we
    should treat the region between the retainAutoreleasedReturnValue and
    the call as a critical section and disallow moving anything there
    (possibly using operand bundles).

    rdar://problem/20449878 — ahatanak / ViewSVN
  6. [LoopUnswitch] Make DEBUG output more readable (part 2).

    I fixed my miscompile in r301722 and I hope I don't have to take
    a look at this code again now that Chandler has a new LoopUnswitch
    pass, but maybe this could be of use for somebody else in the
    meanwhile. — davide / ViewSVN

r301722 (#5590) (Apr 28, 2017 6:11:50 PM)

  1. [LoopUnswitch] Don't remove instructions with side effects.

    This fixes PR32818.

    Differential Revision: — davide / ViewSVN
  2. ObjCBoxedExpr can't be evaluated by the constant expression evaluator.

    A boxed expression evaluates its subexpr and then calls an objc method to transform it into another value with pointer type. The objc method can never be constexpr and therefore this expression can never be evaluated. Fixes a miscompile boxing expressions with side-effects.

    Also make ObjCBoxedExpr handling a normal part of the expression evaluator instead of being the only case besides full-expression where we check for integer overflow. — nicholas / ViewSVN
  3. [llvm-readobj] Fix incorrect printing of CV column info. — zturner / ViewSVN
  4. Fuzzer: Mark test/cxxstring.test UNSUPPORTED: windows

    This has been mysteriously failing since r301593, which cleaned up the
    types of things like size_t and SIZE_MAX for freestanding targets.  Reid
    and Kostya suggested marking it as UNSUPPORTED on windows, given that no
    one has been able to reproduce locally. — Duncan P. N. Exon Smith / ViewSVN
  5. [llvm-readobj] Use LLVMDebugInfoCodeView to parse line tables.

    The llvm-readobj parsing code currently exists in our CodeView
    library, so we use that to parse instead of re-writing the logic
    in the tool. — zturner / ViewSVN
  6. Win snapshot: r301646. — hans / ViewSVN
  7. [Support] Provide unsafe random access for VarStreamArray. — zturner / ViewSVN
  8. Replace PrettyPrinter class in MapFile.cpp with a few non-member functions.

    Since the output format has been simplified, the class to print
    out a map file doesn't seem to be needed anymore. We can replace
    it with a few non-member functions. — ruiu / ViewSVN

r301714 (#5589) (Apr 28, 2017 5:21:34 PM)

  1. [InstCombine] add tests to show potentially bogus application of DeMorgan (NFC) — spatel / ViewSVN
  2. Remove set but unused variable in BitcodeReader.cpp. NFC. — hans / ViewSVN
  3. Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"

    This broke the Clang build. (Clang-side patch missing?)

    Original commit message:

    > [IR] Make add/remove Attributes use AttrBuilder instead of
    > AttributeList
    > This change cleans up call sites and avoids creating temporary
    > AttributeList objects.
    > NFC — hans / ViewSVN
  4. InferAddressSpaces: Search constant expressions for addrspacecasts

    These are pretty common when using local memory, and the 64-bit generic
    addressing is much more expensive to compute. — arsenm / ViewSVN
  5. Eliminate .debug_gnu_pub{names,types} if -gdb-index is given.

    This patch is to ignore .debug_gnu_pub{names,types} sections if the
    -gdb-index option was given.

    Differential Revision: — ruiu / ViewSVN
  6. Revert r301678: Remove LinkerScript::flush.

    This reverts commit r301678 since that change significantly slowed
    down the linker. Before this patch, LLD could link clang in 8 seconds,
    but with this patch it took 40 seconds. — ruiu / ViewSVN
  7. Added new slave for builder clang-lld-x86_64-2stage. — gkistanova / ViewSVN
  8. Adapt to LLVM API change (DINamespace no longer takes line/file info).

    rdar://problem/17484998 — Adrian Prantl / ViewSVN
  9. Remove line and file from DINamespace.

    Fixes the issue highlighted in

    The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
    prevent LLVM from uniquing types that are in the same namespace. They
    also don't carry any meaningful information.

    Differential Revision: — Adrian Prantl / ViewSVN
  10. InferAddressSpaces: Avoid looking up deleted values

    While looking at pure addressing expressions, it's possible
    for the value to appear later in Postorder.

    I haven't been able to come up with a testcase where this
    exhibits an actual issue, but if you insert a dump before
    the value map lookup, a few testcases crash. — arsenm / ViewSVN
  11. InferAddressSpaces: Infer from just addrspacecasts

    Eliminates some more cases where some subset of the addressing
    computation remains flat. Some cases with addrspacecasts
    in nested constant expressions are still left behind however. — arsenm / ViewSVN
  12. [SCEV] Use early exit in createAddRecFromPHI. NFC. — Michael Zolotukhin / ViewSVN
  13. LoopRotate: Fix use after scope bug — dannyb / ViewSVN
  14. [ODRHash] Add testcase with different paramter names.  NFC — rtrieu / ViewSVN
  15. [RDF] Correctly calculate lane masks for defs — kparzysz / ViewSVN
  16. Properly handle PHIs with subregisters in UnreachableBlockElim

    When a PHI operand has a subregister, create a COPY instead of simply
    replacing the PHI output with the input it.

    Differential Revision: — kparzysz / ViewSVN
  17. [Hexagon] Do not move a block if it is on a fall-through path — kparzysz / ViewSVN
  18. [IR] Make add/remove Attributes use AttrBuilder instead of AttributeList

    This change cleans up call sites and avoids creating temporary
    AttributeList objects.

    NFC — rnk / ViewSVN
  19. [ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would make more sense to thing of 0 as 0 rather than the minimum unsigned value. NFC — ctopper / ViewSVN
  20. [APInt] Add an isNullValue method to check for all bits being zero. Use it in a couple internal methods where it makes more sense than isMinValue or !getBoolValue. NFC

    I used Null rather than Zero to match the getNullValue method name.

    There are some other places outside APInt where isNullValue would be more readable than isMinValue even though they do the same thing. I'll update those in future patches. — ctopper / ViewSVN
  21. [ConstantRange] Use const references to prevent a couple APInt copies. NFC — ctopper / ViewSVN

r301693 (#5588) (Apr 28, 2017 4:29:22 PM)

  1. Flush output in log()

    This change was motivated by output from lld-link.exe and link.exe
    getting intermixed. There's already a flush() call in message(), so
    there's precedence. — hans / ViewSVN
  2. [LoopUnswitch] Make DEBUG output more readable.

    While debugging a miscompile I realized loopunswitch doesn't
    put newlines when printing the instruction being replacement.
    Ending up with a single line with many instruction replaced isn't
    the best for readability and/or mental sanity. — davide / ViewSVN
  3. Rename one of the variables to avoid confusion. — rafael / ViewSVN
  4. [WebAssembly] Add size of section header to data relocation offsets.

    Also, add test for data relocations and fix addend to
    be signed.

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN

r301689 (#5587) (Apr 28, 2017 3:29:27 PM)

  1. [tests] Ensure all test cases use named variables

    This makes it easier to read and possibly even modify the test cases, as there
    is no need to keep the variable increment in steps of one. More importantly, by
    using explicit variable names we do not need to rely on the implicit numbering
    of statements when dumping the scop information.

    This makes it easier to read and possibly even modify the test cases.
    Furthermore, by using explicit variables we do not need to rely on the implicit
    numbering of statements when dumping the scop information. In a future commit,
    this implicit numbering will likely not be used any more to refer to LLVM-IR
    values as it is very expensive to construct. — grosser / ViewSVN
  2. [ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute

    Patch by Tom Stellard — arsenm / ViewSVN
  3. [WebAssembly] Write initial memory in pages not bytes

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN
  4. Public headers need to be public. — penryu / ViewSVN
  5. TableGen: Add IntrHasSideEffects property for intrinsics

    The IntrNoMem, IntrReadMem, IntrWriteMem, and IntrArgMemOnly intrinsic
    properties differ from their corresponding LLVM IR attributes by specifying
    that the intrinsic, in addition to its memory properties, has no other side

    The IntrHasSideEffects flag used in combination with one of the memory flags
    listed above, makes it possible to define an intrinsic such that its
    properties at the CodeGen layer match its properties at the IR layer.

    Patch by Tom Stellard — arsenm / ViewSVN
  6. Enable -fno-split-dwarf-inlining even when -gsplit-dwarf isn't specified.

    Since -gsplit-dwarf is specified on a backend compile (in ThinLTO
    parlance) it isn't passed during the frontend compile (because no ELF
    object/dwo file is produced then), yet the -fno-split-dwarf-inlining
    value needs to be encoded in the LLVM DebugInfo metadata to have

    So let it be specified & it'll be silently ignored if -gsplit-dwarf
    isn't used in the end, otherwise it'll be used on a per-cu basis
    depending on where it's specified in the frontend compile actions. — dblaikie / ViewSVN
  7. Change the format of the map file.

    Previously, we printed out input sections and input files in
    separate columns as shown below.

      Address          Size             Align Out     In      File    Symbol
      0000000000201000 0000000000000015     4 .text
      0000000000201000 000000000000000e     4         .text
      0000000000201000 000000000000000e     4                 foo.o
      0000000000201000 0000000000000000     0                         _start
      0000000000201005 0000000000000000     0                         f(int)
      000000000020100e 0000000000000000     0                         local
      0000000000201010 0000000000000002     4                 bar.o
      0000000000201010 0000000000000000     0                         foo
      0000000000201011 0000000000000000     0                         bar

    This format doesn't make much sense because for each input section,
    there's always exactly one input file. This patch changes the format
    to this.

      Address          Size             Align Out     In      Symbol
      0000000000201000 0000000000000015     4 .text
      0000000000201000 000000000000000e     4         foo.o:(.text)
      0000000000201000 0000000000000000     0                 _start
      0000000000201005 0000000000000000     0                 f(int)
      000000000020100e 0000000000000000     0                 local
      0000000000201010 0000000000000002     4         bar.o:(.text)
      0000000000201010 0000000000000000     0                 foo
      0000000000201011 0000000000000000     0                 bar

    Differential Revision: — ruiu / ViewSVN
  8. Make getParamAlignment use argument numbers

    The method is called "get *Param* Alignment", and is only used for
    return values exactly once, so it should take argument indices, not
    attribute indices.

    Avoids confusing code like:
      IsSwiftError = CS->paramHasAttr(ArgIdx, Attribute::SwiftError);
      Alignment  = CS->getParamAlignment(ArgIdx + 1);

    Add getRetAlignment to handle the one case in Value.cpp that wants the
    return value alignment.

    This is a potentially breaking change for out-of-tree backends that do
    their own call lowering. — rnk / ViewSVN
  9. GlobalISel: Followup for r301679 — matze / ViewSVN
  10. Add speculatable function attribute

    This attribute tells the optimizer that the function may be speculated.

    Patch by Tom Stellard — arsenm / ViewSVN
  11. TargetLowering: Add finalizeLowering() function; NFC

    Adds a new method finalizeLowering to TargetLoweringBase. This is in
    preparation for an upcoming commit.

    This function is meant for target specific adjustments to
    MachineFrameInfo or register reservations.

    Move the freezeRegisters() and the hasCopyImplyingStackAdjustment()
    handling into the new function to prove the concept. As an added bonus
    GlobalISel no longer missed the hasCopyImplyingStackAdjustment()
    handling with this.

    Differential Revision: — matze / ViewSVN
  12. Remove LinkerScript::flush.

    This patch replaces flush with a last ditch attempt at synchronizing
    the section list with the linker script "AST".

    The synchronization is a bit of a hack and should in time be avoided
    by creating the AST earlier so that modifications can be made directly
    to it instead of modifying the section list and synchronizing it back.

    This is the main step for fixing With this in place I
    think the only missing thing would be to have processCommands assign
    section indexes as dummy offsets so that the sort in
    OutputSection::finalize works.

    With this LinkerScript::assignAddresses becomes much simpler, which
    should help with the thunk work. — rafael / ViewSVN

r301677 (#5586) (Apr 28, 2017 2:36:32 PM)

  1. AMDGPU: Add new amdgcn.init.exec intrinsics

    v2: More tests, bug fixes, cosmetic changes.

    Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye

    Differential Revision: — mareko / ViewSVN
  2. limit to 2 parallel links when using thinlto

    When using ThinLTO, the linker performs its own parallelism. This
    change limits the number of parallel link jobs that Ninja will issue
    to keep the total number of threads reasonable when linking with

    Reviewers: hans, ruiu

    Subscribers: mgorny, mehdi_amini, Prazek

    Differential Revision: — inglorion / ViewSVN
  3. Added support for the 'clean' property. — gkistanova / ViewSVN
  4. Use toString(Inputfile*) to format a file object. — ruiu / ViewSVN
  5. Kill off the old SimplifyInstruction API by converting remaining users. — dannyb / ViewSVN
  6. [IPO/MergeFunctions] This function is used only under DEBUG(). — davide / ViewSVN

r301671 (#5585) (Apr 28, 2017 1:39:17 PM)

  1. [RS4GC] Simplify attribute handling code NFC

    Avoids use of AttributeList::getNumSlots, making it easier to change the
    underlying implementation. — rnk / ViewSVN
  2. [Codegen] Disable Polly's codegen verification by default

    As has been reported in the previous commit, codegen verification can result in
    quadratic compile time increases for large functions with many scops. This is
    certainly not something we would like to have in the Polly default
    configuration. Hence, we disable codegen verification by default -- also to see
    if this resolves some of the compilation timeouts we currently see on the AOSP
    buildbots. We still leave this feature in Polly as it has shown _very_ useful
    for debugging. In fact, we may want to have a discussion if we can bring this
    feature back in a way that does not impact compilation time so much.

    Thanks to Eli Friedman <> for reporting this issue and
    for providing the test case in the previous commit (where I forgot to
    acknowledge him). — grosser / ViewSVN
  3. [CodeGen] Skip verify if -polly-codegen-verify is set to false

    Before this change, we always tried to verify the function and printed
    verification errors, but just did not abort in case -polly-codegen-verify=false
    was set and verification failed. As verification can become very cosly -- for
    large functions with many scops we may verify the very same function very often
    -- this can affect compile time very negatively. Hence, we respect the
    -polly-codegen-verify flag with this check, ensuring that no verification is run
    if -polly-codegen-verify=false.

    This reduces code generation time from 26 seconds to 4 seconds on the test
    case below with -polly-codegen-verify=false:

      struct X { int x; };
      void a();
      #define SIG (int x, X **y, X **z)
      typedef void (*fn)SIG;
      #define FN { for (int i = 0; i < x; ++i) { (*y)[i].x += (*z)[i].x; } a(); }
      #define FN5 FN FN FN FN FN
      #define FN25 FN5 FN5 FN5 FN5
      #define FN125 FN25 FN25 FN25 FN25 FN25
      #define FN250 FN125 FN125
      #define FN1250 FN250 FN250 FN250 FN250 FN250
      void x SIG { FN1250 } — grosser / ViewSVN

r301668 (#5584) (Apr 28, 2017 12:41:45 PM)

  1. Remove trailing whitespace from the -Map output.

    If a string is shorter than 7 characters, we used to print out
    trailing whitespace characters. — ruiu / ViewSVN
  2. [CodeGen][ObjC] Don't retain captured Objective-C pointers at block
    creation that are const-qualified.

    When a block captures an ObjC object pointer, clang retains the pointer
    to prevent prematurely destroying the object the pointer points to
    before the block is called or copied.

    When the captured object pointer is const-qualified, we can avoid
    emitting the retain/release pair since the pointer variable cannot be
    modified in the scope in which the block literal is introduced.

    For example:

    void test(const id x) {
        callee(^{ (void)x; });

    This patch implements that optimization.


    Differential Revision: — ahatanak / ViewSVN
  3. Use Argument::hasAttribute and AttributeList::ReturnIndex more

    This eliminates many extra 'Idx' induction variables in loops over
    arguments in CodeGen/ and Target/. It also reduces the number of places
    where we assume that ReturnIndex is 0 and that we should add one to
    argument numbers to get the corresponding attribute list index.

    NFC — rnk / ViewSVN
  4. Cleanup: Use DIExpression::prepend in buildDbgValueForSpill(). (NFC) — Adrian Prantl / ViewSVN
  5. Add remaining SBTrace headers to LLDB framework — penryu / ViewSVN

r301663 (#5583) (Apr 28, 2017 11:51:08 AM)

  1. [IR] Delete unused Argument::removeAttr overload

    It doesn't make sense to remove an AttributeList from an argument. — rnk / ViewSVN
  2. Clean up DIExpression::prependDIExpr a little. (NFC) — Adrian Prantl / ViewSVN
  3. Remove a redundant local variable. — ruiu / ViewSVN
  4. Bitcode: Do not remove empty summary entries when reading a per-module summary.

    This became no longer necessary after D19462 landed, and will be incompatible
    with an upcoming change to the summary data structures that changes how we
    represent references. — pcc / ViewSVN
  5. Speed up the -Map option.

    We found that some part of code for the -Map option takes O(m*n)
    where m is the number of input sections in some file and n is
    the number of symbols in the same file. If you do LTO, we usually
    have only a few object files as inputs for the -Map option
    feature, so this performance characteristic was worse than I

    This patch rewrites the -Map option feature to speed it up.
    I eliminated the O(m*n) bottleneck and also used multi-threading.

    As a result, clang link time with the -Map option improved from
    18.7 seconds to 11.2 seconds. Without -Map, it takes 7.7 seconds,
    so the -Map option is now about 3x faster than before for this
    test case (from 11.0 seconds to 3.5 seconds.) The generated output
    file size was 223 MiB, and the file contains 1.2M lines.

    Differential Revision: — ruiu / ViewSVN
  6. IR: fix some doxygen grammar (NFC)

    Fix a bit of the doxygen grammar that was off that I noticed while
    looking at this file for another issue. — Saleem Abdulrasool / ViewSVN
  7. COFF: actually synthesize CONST imports properly

    CONSTANT imports expect both the `_imp_` prefixed and non-prefixed
    symbols should be added to the symbol table.  This allows for linking
    symbols like _NSConcreteGlobalBlock in WinObjC.  The previous change
    would generate the import library properly by handling the option but
    would not consume the generated entry properly. — Saleem Abdulrasool / ViewSVN
  8. [APInt] Add clearSignBit method. Use it and setSignBit in a few places. NFCI — ctopper / ViewSVN
  9. [LazyValueInfo] Fix typo in comment. NFC — ctopper / ViewSVN
  10. [ValueTracking] Use APInt::isSubsetOf and APInt::intersects. NFC — ctopper / ViewSVN
  11. [bpf] add bigendian support to disassembler

    . swap 4-bit register encoding, 16-bit offset and 32-bit imm to support big endian archs
    . add a test

    Reported-by: David S. Miller <>
    Signed-off-by: Alexei Starovoitov <> — ast / ViewSVN
  12. [DOXYGEN] Minor improvements in doxygen comments.

    - I removed doxygen comments for the intrinsics that "alias" the other existing documented intrinsics and that only sligtly differ in spelling (single underscores vs. double underscores).
    #define _tzcnt_u16(a)     (__tzcnt_u16((a)))

    It will be very hard to keep the documentation for these "aliases" in sync with the documentation for the intrinsics they alias to. Out of sync documentation will be more confusing than no documentation.

    I got an OK from Eric Christopher to commit doxygen comments without prior code
    review upstream. — kromanova / ViewSVN

r301651 (#5582) (Apr 28, 2017 10:31:03 AM)

  1. [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

    When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call.


    std::vector<std::pair<int, int>> v;
    v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2);

    make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions.

    Reviewers: Prazek, aaron.ballman, hokein, alexfh

    Reviewed By: Prazek, alexfh

    Subscribers: JDevlieghere, JonasToth, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — kuhar / ViewSVN
  2. CMake: ignore git stderr when trying to sort out revision. NFC. — Tim Northover / ViewSVN
  3. [InlineCost] Improve the cost heuristic for Switch

    The motivation example is like below which has 13 cases but only 2 distinct targets

    lor.lhs.false2:                                   ; preds = %if.then
      switch i32 %Status, label %if.then27 [
        i32 -7012, label %if.end35
        i32 -10008, label %if.end35
        i32 -10016, label %if.end35
        i32 15000, label %if.end35
        i32 14013, label %if.end35
        i32 10114, label %if.end35
        i32 10107, label %if.end35
        i32 10105, label %if.end35
        i32 10013, label %if.end35
        i32 10011, label %if.end35
        i32 7008, label %if.end35
        i32 7007, label %if.end35
        i32 5002, label %if.end35
    which is compiled into a balanced binary tree like this on AArch64 (similar on X86)

    .LBB853_9:                              // %lor.lhs.false2
            mov     w8, #10012
            cmp             w19, w8
    // BB#10:                               // %lor.lhs.false2
            mov     w8, #5001
            cmp             w19, w8
    // BB#11:                               // %lor.lhs.false2
            mov     w8, #-10016
            cmp             w19, w8
            b.eq    .LBB853_23
    // BB#12:                               // %lor.lhs.false2
            mov     w8, #-10008
            cmp             w19, w8
            b.eq    .LBB853_23
    // BB#13:                               // %lor.lhs.false2
            mov     w8, #-7012
            cmp             w19, w8
            b.eq    .LBB853_23
            b       .LBB853_3
    .LBB853_14:                             // %lor.lhs.false2
            mov     w8, #14012
            cmp             w19, w8
    // BB#15:                               // %lor.lhs.false2
            mov     w8, #-10105
            add             w8, w19, w8
            cmp             w8, #9          // =9
            b.hi    .LBB853_17
    // BB#16:                               // %lor.lhs.false2
            orr     w9, wzr, #0x1
            lsl     w8, w9, w8
            mov     w9, #517
            and             w8, w8, w9
            cbnz    w8, .LBB853_23
    .LBB853_17:                             // %lor.lhs.false2
            mov     w8, #10013
            cmp             w19, w8
            b.eq    .LBB853_23
            b       .LBB853_3
    .LBB853_18:                             // %lor.lhs.false2
            mov     w8, #-7007
            add             w8, w19, w8
            cmp             w8, #2          // =2
            b.lo    .LBB853_23
    // BB#19:                               // %lor.lhs.false2
            mov     w8, #5002
            cmp             w19, w8
            b.eq    .LBB853_23
    // BB#20:                               // %lor.lhs.false2
            mov     w8, #10011
            cmp             w19, w8
            b.eq    .LBB853_23
            b       .LBB853_3
    .LBB853_21:                             // %lor.lhs.false2
            mov     w8, #14013
            cmp             w19, w8
            b.eq    .LBB853_23
    // BB#22:                               // %lor.lhs.false2
            mov     w8, #15000
            cmp             w19, w8
    However, the inline cost model estimates the cost to be linear with the number
    of distinct targets and the cost of the above switch is just 2 InstrCosts.
    The function containing this switch is then inlined about 900 times.

    This change use the general way of switch lowering for the inline heuristic. It
    etimate the number of case clusters with the suitability check for a jump table
    or bit test. Considering the binary search tree built for the clusters, this
    change modifies the model to be linear with the size of the balanced binary
    tree. The model is off by default for now :

    This change was originally proposed by Haicheng in D29870.

    Reviewers: hans, bmakam, chandlerc, eraman, haicheng, mcrosier

    Reviewed By: hans

    Subscribers: joerg, aemerson, llvm-commits, rengolin

    Differential Revision: — junbuml / ViewSVN
  4. [libclang] Expose some target information via the C API.

    This allows users to query the target triple and target pointer width, which
    would make me able to fix and
    other related bugs in an elegant way (without having to manually parse the
    target triple in the command line arguments).

    Differential Revision: — emilio / ViewSVN

r301647 (#5581) (Apr 28, 2017 9:09:48 AM)

  1. Use the -Wunknown-warning-option group for the "unknown warning group"
    diagnostic in #pragma diagnostic

    This matches the warning group that's specified for the unknown warning options
    that are passed-in as command line arguments.

    rdar://29526025 — arphaman / ViewSVN
  2. Move variable local to where ita used. NFCI. — rksimon / ViewSVN

r301645 (#5580) (Apr 28, 2017 8:17:12 AM)

  1. Memory intrinsic value profile optimization: Avoid divide by 0

    Skip memops if the total value profiled count is 0, we can't correctly
    scale up the counts and there is no point anyway.

    Reviewers: davidxl

    Subscribers: llvm-commits

    Differential Revision: — tejohnson / ViewSVN
  2. [DAGCombiner] Add ComputeNumSignBits vector demanded elements support to ASHR and INSERT_VECTOR_ELT (reapplied)

    Reapplied r299221 after fix for nondeterminism in ThinLTO builder (rL301599), with extra check for implicit truncation of inserted element. — rksimon / ViewSVN

r301643 (#5579) (Apr 28, 2017 7:24:28 AM)

  1. [Sema] Avoid an invalid redefinition error that was presented for
    of a function whose previous definition was typo-corrected


    Differential Revision: — arphaman / ViewSVN

r301642 (#5578) (Apr 28, 2017 6:26:53 AM)

  1. Remove lock from ConstString::GetLength

    Summary: ConstStrings are immutable, so there is no need to grab even a reader lock in order to read the length field.

    Reviewers: #lldb, labath

    Reviewed By: labath

    Subscribers: zturner, labath, lldb-commits

    Differential Revision:
    Patch by Scott Smith <> — labath / ViewSVN
  2. [X86][SSE] Added new tests from D32416 to show codegen delta — rksimon / ViewSVN

r301640 (#5577) (Apr 28, 2017 5:36:47 AM)

  1. [Polly] [PPCGCodeGeneration] Add managed memory support to GPU code

    This needs changes to GPURuntime to expose synchronization between host
    and device.

    1. Needs better function naming, I want a better name than

    2. DeviceAllocations is used by both the managed memory and the
    non-managed memory path. This exploits the fact that the two code paths
    are never run together. I'm not sure if this is the best design decision

    Reviewed by: PhilippSchaad

    Tags: #polly

    Differential Revision: — bollu / ViewSVN
  2. [X86][SSE] Renames all ones test to better match type.

    Added 8f32/4f64 optsize tests discussed on D32416 — rksimon / ViewSVN

r301638 (#5576) (Apr 28, 2017 4:46:34 AM)

  1. [X86][SSE] Add codegen test for _mm_set_pd1 (PR32827) — rksimon / ViewSVN
  2. [X86][SSE] Add _mm_set_pd1 (PR32827)

    Matches _mm_set_ps1 implementation — rksimon / ViewSVN
  3. Resurrect pselect MainLoop implementation

    It turns out that even though ppoll is available on all the android
    devices we support, it does not seem to be working properly on all of
    them -- MainLoop just does a busy loop with ppoll returning EINTR and
    not making any progress.

    This brings back the pselect implementation and makes it available on
    android. I could not do any cmake checks for this as the ppoll symbol is
    actually avaiable -- it just does not work.

    Reviewers: beanz, eugene

    Subscribers: srhines, lldb-commits

    Differential Revision: — labath / ViewSVN

r301635 (#5575) (Apr 28, 2017 3:55:19 AM)

  1. [index] Handle vector types in USR generator

    rdar://25339187 — arphaman / ViewSVN
  2. [EuroLLVM] Add slides for one more LT

    On behalf of Johannes Doerfert <> (Fri Apr 28 11:40:34 2017 +0200) — streit / ViewSVN
  3. [ARM] GlobalISel: fixup r301632

    Actually remove ARMInstructionSelector.h... Forgot to stage the removal
    in the previous commit. — rovka / ViewSVN
  4. [ARM] GlobalISel: Get rid of ARMInstructionSelector.h. NFC.

    Declare the ARMInstructionSelector in an anonymous namespace, to make it
    more in line with the other targets which were migrated to this in
    r299637 in order to avoid TableGen'erated headers being included in
    non-GlobalISel builds. — rovka / ViewSVN

r301631 (#5574) (Apr 28, 2017 3:03:47 AM)

  1. [DWARF] - Fix mistype in dump output of pub* tables. NFC.

    There was a garbage character in output introduced by myself in
    r290040 "[DWARF] - Introduce DWARFDebugPubTable class for dumping pub* sections." — grimar / ViewSVN
  2. [DebugInfo][X86] Improve X86 Optimize LEAs handling of debug values.

    This is a follow up to the fix in r298360 to improve the handling of debug
    values when redundant LEAs are removed. The fix in r298360 effectively
    discarded the debug values. This patch now attempts to preserve the debug
    values by using the DWARF DW_OP_stack_value operation via prependDIExpr.

    Moved functions appendOffset and prependDIExpr from Local.cpp to
    DebugInfoMetadata.cpp and made them available as static member functions of

    Differential Revision: — anng / ViewSVN

r301629 (#5573) (Apr 28, 2017 2:06:34 AM)

  1. [WebAssembly] Update calls to computeKnownBits after the changes from r301620.

    I didn't realize WebAssembly wasn't a default build target so I missed that changes were needed. — ctopper / ViewSVN
  2. [X86][NFC] Refactor RepMovsRepeats in preparation for D32481.

    Differential Revision: — courbet / ViewSVN
  3. [ARM] GlobalISel: Tighten test. NFC

    Explicitly check types and load sizes in the IRTranslator test. — rovka / ViewSVN

r301626 (#5572) (Apr 28, 2017 1:14:17 AM)

  1. [ValueTracking] Convert computeKnownBitsFromRangeMetadata to use KnownBits struct. — ctopper / ViewSVN
  2. [EarlyCSE] Mark the condition of assume intrinsic as true

    EarlyCSE should not just ignore assumes. It should use the fact that its condition is true for all dominated instructions.

    Reviewers: sanjoy, reames, apilipenko, anna, skatkov

    Reviewed By: reames, sanjoy

    Subscribers: llvm-commits

    Differential Revision: — mkazantsev / ViewSVN
  3. Update to isl-0.18-592-gb50ad59

    This is just a general maintenance update. — grosser / ViewSVN
  4. [EarlyCSE] Remove guards with conditions known to be true

    If a condition is calculated only once, and there are multiple guards on this condition, we should be able
    to remove all guards dominated by the first of them. This patch allows EarlyCSE to try to find the condition
    of a guard among the known values, and if it is true, remove the guard. Otherwise we keep the guard and
    mark its condition as 'true' for future consideration.

    Reviewers: sanjoy, reames, apilipenko, skatkov, anna, dberlin

    Reviewed By: reames, sanjoy

    Subscribers: llvm-commits

    Differential Revision: — mkazantsev / ViewSVN

r301622 (#5571) (Apr 28, 2017 12:16:36 AM)

  1. Fix to use "%env" to make it work in iOS simulator. — kuba.brecka / ViewSVN
  2. Fix the testcase to use %env to make it work on iOS simulator. — kuba.brecka / ViewSVN
  3. [SelectionDAG] Use KnownBits struct in DAG's computeKnownBits and simplifyDemandedBits

    This patch replaces the separate APInts for KnownZero/KnownOne with a single KnownBits struct. This is similar to what was done to ValueTracking's version recently.

    This is largely a mechanical transformation from KnownZero to Known.Zero.

    Differential Revision: — ctopper / ViewSVN

r301619 (#5570) (Apr 27, 2017 11:24:10 PM)

  1. clang/test/ARCMT/remap-applying.c: Use %/s on the command line of echo(1). — chapuni / ViewSVN
  2. [SelectionDAG] Use various APInt methods to reduce temporary APInt creation

    This patch uses various APInt methods to reduce the number of temporary APInts. These were all found while working through converting SelectionDAG's computeKnownBits to also use the KnownBits struct recently added to the ValueTracking version. — ctopper / ViewSVN
  3. [asan] Add a compilation wrapper that codesigns shared libraries to support iOS simulator testing

    Tests that run on the iOS simulator require the dlopen'd dylibs are codesigned. This patch adds the "" wrapper that codesigns any produces dylib.

    Differential Revision: — kuba.brecka / ViewSVN
  4. Remove unnecessary semicolon

    This shows up as a -Wpendatic error on GCC. — sanjoy / ViewSVN
  5. [StackMaps] Increase the size of the "location size" field

    In some cases LLVM (especially the SLP vectorizer) will create vectors
    that are 256 bytes (or larger).  Given that this is intentional[0] is
    likely to get more common, this patch updates the StackMap binary
    format to deal with the spill locations for said vectors.

    This change also bumps the stack map version from 2 to 3.


    Reviewers: reames, kavon, skatkov, javed.absar

    Subscribers: mcrosier, nemanjai, llvm-commits

    Differential Revision: — sanjoy / ViewSVN

r301614 (#5569) (Apr 27, 2017 10:29:33 PM)

  1. COFF Import: expose both symbols

    COFF Import libraries which use the obsolete CONSTANT export are
    supposed to get two symbols, one with the `_imp_` prefix and one
    without.  Ensure that we expose both for iteration.  This is necessary
    to fix the librarian with COFF CONSTANT exports. — Saleem Abdulrasool / ViewSVN
  2. clang/test/Index/index-module.m: Relax expressions to satisfy DOSish path separator \\, since r301597. — chapuni / ViewSVN

r301612 (#5568) (Apr 27, 2017 9:38:57 PM)

  1. [APInt] Use inplace shift methods where possible. NFCI — ctopper / ViewSVN

r301611 (#5567) (Apr 27, 2017 8:17:53 PM)

  1. Turn on LLDB tests on lldb-amd64-ninja-netbsd7

    Change runTest to True. — kamil / ViewSVN
  2. Move functionality for handling module maps as inputs from the -emit-module
    action to the general FrontendAction infrastructure.

    This permits applying -E, -ast-dump, -fsyntax-only, and so on to a module map
    compilation. (The -E form is not currently especially useful yet as there's no
    good way to take the output and use it to actually build a module.)

    In order to support this, -cc1 now accepts -x <lang>-module-map in all cases
    where it accepts -x <lang> for a language we can parse (not ir/ast). And for
    uniformity, we also accept -x <lang>-header for all such languages (we used
    to reject for cuda and renderscript), and -x <lang>-cpp-output for all such
    languages (we used to reject for c, cl, and renderscript).

    (None of these new alternatives are accepted by the driver yet, so no
    user-visible changes.) — rsmith / ViewSVN

r301609 (#5566) (Apr 27, 2017 7:24:50 PM)

  1. Provide a mechanism to do some pre-loading of symbols up front.

    Loading a shared library can require a large amount of work; rather than do that serially for each library,
    this patch will allow parallelization of the symbols and debug info name indexes.

    From — jingham / ViewSVN
  2. Add a newline to suppress compiler warnings. — jingham / ViewSVN
  3. [llvm-pdbdump] Allow printing only a portion of a stream.

    When dumping raw data from a stream, you might know the offset
    of a certain record you're interested in, as well as how long
    that record is.  Previously, you had to dump the entire stream
    and wade through the bytes to find the interesting record.

    This patch allows you to specify an offset and length on the
    command line, and it will only dump the requested range. — zturner / ViewSVN
  4. [WebAssembly] Add some tests for wasm MC layer

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN
  5. Merging r297098:

    r297098 | brad | 2017-03-06 18:48:31 -0500 (Mon, 06 Mar 2017) | 2 lines

    Set the Int64Type / IntMaxType types correctly for OpenBSD/mips64
    ------------------------------------------------------------------------ — brad / ViewSVN

r301604 (#5565) (Apr 27, 2017 6:31:56 PM)

  1. [ASTImporter] Move structural equivalence context to its own file. NFCI

    Create a header and impl file for the structural equivalence context.
    This is to allow other users outside clang importer. NFCI

    Differential Revision:

    rdar://problem/30167717 — Bruno Lopes / ViewSVN
  2. Resurrect the standalone build of LLDB

    Switch includes "llvm/Config/config.h" to "llvm/Config/llvm-config.h".

    Tested on NetBSD 7.99.70 amd64 — kamil / ViewSVN
  3. [ARCMigrate] When applying changes from remap files, disable the 'adjustRemovals' functionality of EditedSource

    'adjustRemovals' is used to avoid situation when removing a range inadvertently causes 2 separate identifiers to get joined into one.
    But it is not useful when the edits are character precise, as is the case with the remap files. — akirtzidis / ViewSVN
  4. Use a consistent style. NFC — George Burgess IV / ViewSVN

r301600 (#5564) (Apr 27, 2017 5:39:37 PM)

  1. integrate SBTrace changes into Xcode project — penryu / ViewSVN
  2. [SROA] Fix nondeterminism exposed by Simon's r299221.

    Use a SmallSetSetVector instead of a SmallPtrSet as iterating
    over the latter is not stable ('<' relies on addresses). — davide / ViewSVN

r301598 (#5563) (Apr 27, 2017 4:49:34 PM)

  1. COFF ICF: Merge only functions. Do not merge read-only data.

    This seems to be the behavior of the MSVC linker. Previously, this
    incompatibility caused nasty issues in chromium build a few times.

    Differential Revision: — ruiu / ViewSVN
  2. [Modules] Improve diagnostics for incomplete umbrella

    One of the -Wincomplete-umbrella warnings diagnoses when a header is present in
    the directory but it's not present in the umbrella header. Currently, this
    warning only happens on top level modules; any submodule using an umbrella
    header does not get this warning. Fix that by also considering the submodules.

    Differential Revision:

    rdar://problem/22623686 — Bruno Lopes / ViewSVN
  3. [Modules] Refactor logic for incomplete umbrella warnings. NFC — Bruno Lopes / ViewSVN
  4. Fix a few pedantic warnings.

    Reviewers: zturner, hansw, hans

    Reviewed By: hans

    Subscribers: hans, llvm-commits

    Differential Revision: — marsupial / ViewSVN

r301594 (#5562) (Apr 27, 2017 3:59:33 PM)

  1. [InstCombine] fix matcher to bind to specific operand (PR32830)

    Matching any random value would be very wrong: — spatel / ViewSVN
  2. Headers: Make the type of SIZE_MAX the same as size_t

    size_t is usually defined as unsigned long, but on 64-bit platforms,
    stdint.h currently defines SIZE_MAX using "ull" (unsigned long long).
    Although this is the same width, it doesn't necessarily have the same
    alignment or calling convention.  It also triggers printf warnings when
    using the format flag "%zu" to print SIZE_MAX.

    This changes SIZE_MAX to reuse the compiler-provided __SIZE_MAX__, and
    provides similar fixes for the other integers:

      - INTPTR_MIN
      - INTPTR_MAX
      - INTMAX_MIN
      - INTMAX_MAX
      - INTMAX_C()
      - UINTMAX_C()

    ... and fixes the typedefs for intptr_t and uintptr_t to use
    __INTPTR_TYPE__ and __UINTPTR_TYPE__ instead of int32_t, effectively
    reverting r89224, r89226, and r89237 (r89221 already having been
    effectively reverted).

    We can probably also kill __INTPTR_WIDTH__, __INTMAX_WIDTH__, and
    __UINTMAX_WIDTH__ in a follow-up, but I was hesitant to delete all the
    per-target CHECK lines in this commit since those might serve their own

    rdar://problem/11811377 — Duncan P. N. Exon Smith / ViewSVN
  3. Preprocessor: Suppress -Wnonportable-include-path for header maps

    If a file search involves a header map, suppress
    -Wnonportable-include-path.  It's firing lots of false positives for
    framework authors internally, and it's not trivial to fix.

    Consider a framework called "Foo" with a main (installed) framework header
    "Foo/Foo.h".  It's atypical for "Foo.h" to actually live inside a
    directory called "Foo" in the source repository.  Instead, the
    build system generates a header map while building the framework.
    If Foo.h lives at the top-level of the source repository (common), and
    the git repo is called ssh://some.url/foo.git, then the header map will
    have something like:

        Foo/Foo.h -> /Users/myname/code/foo/Foo.h

    where "/Users/myname/code/foo" is the clone of ssh://some.url/foo.git.

    After #import <Foo/Foo.h>, the current implementation of
    -Wnonportable-include-path will falsely assume that Foo.h was found in a
    nonportable way, because of the name of the git clone (.../foo/Foo.h).
    However, that directory name was not involved in the header search at

    This commit adds an extra parameter to Preprocessor::LookupFile and
    HeaderSearch::LookupFile to track if the search used a header map,
    making it easy to suppress the warning.  Longer term, once we find a way
    to avoid the false positive, we should turn the warning back on.

    rdar://problem/28863903 — Duncan P. N. Exon Smith / ViewSVN

r301591 (#5561) (Apr 27, 2017 3:09:37 PM)

  1. Specify something that's true in practice — sanjoy / ViewSVN
  2. Add references to past LLVM in HPC workshops

    They'll be another one this year. More information coming... — hfinkel / ViewSVN
  3. [ubsan] Make the cast overflow message less redundant — Vedant Kumar / ViewSVN
  4. [asan] Fix dead stripping of globals on Linux (compiler-rt).

    Third attempt. See the description of the corresponding commit in
    LLVM for more details. — eugenis / ViewSVN
  5. [asan] Fix dead stripping of globals on Linux.

    Use a combination of !associated, comdat, @llvm.compiler.used and
    custom sections to allow dead stripping of globals and their asan
    metadata. Sometimes.

    Currently this works on LLD, which supports SHF_LINK_ORDER with
    sh_link pointing to the associated section.

    This also works on BFD, which seems to treat comdats as
    all-or-nothing with respect to linker GC. There is a weird quirk
    where the "first" global in each link is never GC-ed because of the
    section symbols.

    At this moment it does not work on Gold (as in the globals are never

    This is a second re-land of r298158. This time, this feature is
    limited to -fdata-sections builds. — eugenis / ViewSVN
  6. [asan] Put ctor/dtor in comdat.

    When possible, put ASan ctor/dtor in comdat.

    The only reason not to is global registration, which can be
    TU-specific. This is not the case when there are no instrumented
    globals. This is also limited to ELF targets, because MachO does
    not have comdat, and COFF linkers may GC comdat constructors.

    The benefit of this is a lot less __asan_init() calls: one per DSO
    instead of one per TU. It's also necessary for the upcoming
    gc-sections-for-globals change on Linux, where multiple references to
    section start symbols trigger quadratic behaviour in gold linker.

    This is a second re-land of r298756. This time with a flag to disable
    the whole thing to avoid a bug in the gold linker: — eugenis / ViewSVN
  7. libclang: remove unused variable. — Tim Northover / ViewSVN
  8. [scudo] Move thread local variables into their own files

    This change introduces scudo_tls.h & scudo_tls_linux.cpp, where we move the
    thread local variables used by the allocator, namely the cache, quarantine
    cache & prng. `ScudoThreadContext` will hold those. This patch doesn't
    introduce any new platform support yet, this will be the object of a later
    patch. This also changes the PRNG so that the structure can be POD.

    Reviewers: kcc, dvyukov, alekseyshl

    Reviewed By: dvyukov, alekseyshl

    Subscribers: llvm-commits, mgorny

    Differential Revision: — cryptoad / ViewSVN
  9. [X86][SSE] Add tests for broadcast from larger vector loads — rksimon / ViewSVN

r301582 (#5560) (Apr 27, 2017 2:19:43 PM)

  1. [ScopInfo] Consider only write-free dereferencable loads as invariant

    When we introduced in r297375 support for hoisting loads that are known
    to be dereferencable without any conditional guard, we forgot to keep the check
    to verify that no other write into the very same location exists. This
    change ensures now that dereferencable loads are allowed to access everything,
    but can only be hoisted in case no conflicting write exists.

    This resolves

    Reported-by: Huihui Zhang <> — grosser / ViewSVN
  2. Fixing Windows bot

    URL: — cbieneman / ViewSVN

r301580 (#5559) (Apr 27, 2017 1:29:06 PM)

  1. NFC. Add comment about debugserver usage

    This just adds a comment to SocketAddress about it being used by debugserver and the implications of that.

    If we need to make changes to this class that make it unsuitable for debugserver we can re-implement the minimal abstractions we need from this file in debugserver. I would prefer not to do that because code duplication is bad. Nuff said. — cbieneman / ViewSVN
  2. Fix GreenDragon bots

    We don't actually need to include Compiler.h here because it is only used on Windows and Windows/PosixAPI.h includes it. — cbieneman / ViewSVN
  3. [llvm-readobj] Dump COFF Resources section.

    This patch dumps the raw bytes of the .rsrc sections that
    are present in COFF object and executable files.  Subsequent
    patches will parse this information and dump in a more human
    readable format.

    Differential Revision:
    Patch By: Eric Beckmann — zturner / ViewSVN
  4. [OpenMP] libomptarget: test correction for use with OpenMP 4.5

    Differential Revision:

    Thanks to Sergey Dmitriev for submitting the patch. — grokos / ViewSVN

r301576 (#5558) (Apr 27, 2017 12:38:31 PM)

  1. [PM/LoopUnswitch] Introduce a new, simpler loop unswitch pass.

    Currently, this pass only focuses on *trivial* loop unswitching. At that
    reduced problem it remains significantly better than the current loop
    - Old pass is worse than cubic complexity. New pass is (I think) linear.
    - New pass is much simpler in its design by focusing on full unswitching. (See
      below for details on this).
    - New pass doesn't carry state for thresholds between pass iterations.
    - New pass doesn't carry state for correctness (both miscompile and
      infloop) between pass iterations.
    - New pass produces substantially better code after unswitching.
    - New pass can handle more trivial unswitch cases.
    - New pass doesn't recompute the dominator tree for the entire function
      and instead incrementally updates it.

    I've ported all of the trivial unswitching test cases from the old pass
    to the new one to make sure that major functionality isn't lost in the
    process. For several of the test cases I've worked to improve the
    precision and rigor of the CHECKs, but for many I've just updated them
    to handle the new IR produced.

    My initial motivation was the fact that the old pass carried state in
    very unreliable ways between pass iterations, and these mechansims were
    incompatible with the new pass manager. However, I discovered many more
    improvements to make along the way.

    This pass makes two very significant assumptions that enable most of these

    1) Focus on *full* unswitching -- that is, completely removing whatever
       control flow construct is being unswitched from the loop. In the case
       of trivial unswitching, this means removing the trivial (exiting)
       edge. In non-trivial unswitching, this means removing the branch or
       switch itself. This is in opposition to *partial* unswitching where
       some part of the unswitched control flow remains in the loop. Partial
       unswitching only really applies to switches and to folded branches.
       These are very similar to full unrolling and partial unrolling. The
       full form is an effective canonicalization, the partial form needs
       a complex cost model, cannot be iterated, isn't canonicalizing, and
       should be a separate pass that runs very late (much like unrolling).

    2) Leverage LLVM's Loop machinery to the fullest. The original unswitch
       dates from a time when a great deal of LLVM's loop infrastructure was
       missing, ineffective, and/or unreliable. As a consequence, a lot of
       complexity was added which we no longer need.

    With these two overarching principles, I think we can build a fast and
    effective unswitcher that fits in well in the new PM and in the
    canonicalization pipeline. Some of the remaining functionality around
    partial unswitching may not be relevant today (not many test cases or
    benchmarks I can find) but if they are I'd like to add support for them
    as a separate layer that runs very late in the pipeline.

    Purely to make reviewing and introducing this code more manageable, I've
    split this into first a trivial-unswitch-only pass and in the next patch
    I'll add support for full non-trivial unswitching against a *fixed*
    threshold, exactly like full unrolling. I even plan to re-use the
    unrolling thresholds, as these are incredibly similar cost tradeoffs:
    we're cloning a loop body in order to end up with simplified control
    flow. We should only do that when the total growth is reasonably small.

    One of the biggest changes with this pass compared to the previous one
    is that previously, each individual trivial exiting edge from a switch
    was unswitched separately as a branch. Now, we unswitch the entire
    switch at once, with cases going to the various destinations. This lets
    us unswitch multiple exiting edges in a single operation and also avoids
    numerous extremely bad behaviors, where we would introduce 1000s of
    branches to test for thousands of possible values, all of which would
    take the exact same exit path bypassing the loop. Now we will use
    a switch with 1000s of cases that can be efficiently lowered into
    a jumptable. This avoids relying on somehow forming a switch out of the
    branches or getting horrible code if that fails for any reason.

    Another significant change is that this pass actively updates the CFG
    based on unswitching. For trivial unswitching, this is actually very
    easy because of the definition of loop simplified form. Doing this makes
    the code coming out of loop unswitch dramatically more friendly. We
    still should run loop-simplifycfg (at the least) after this to clean up,
    but it will have to do a lot less work.

    Finally, this pass makes much fewer attempts to simplify instructions
    based on the unswitch. Something like loop-instsimplify, instcombine, or
    GVN can be used to do increasingly powerful simplifications based on the
    now dominating predicate. The old simplifications are things that
    something like loop-instsimplify should get today or a very, very basic
    loop-instcombine could get. Keeping that logic separate is a big
    simplifying technique.

    Most of the code in this pass that isn't in the old one has to do with
    achieving specific goals:
    - Updating the dominator tree as we go
    - Unswitching all cases in a switch in a single step.

    I think it is still shorter than just the trivial unswitching code in
    the old pass despite having this functionality.

    Differential Revision: — chandlerc / ViewSVN
  2. [GlobalOpt] Correctly update metadata when localizing a global.

    Just calling dropAllReferences leaves pointers to the ConstantExpr
    behind, so we would eventually crash with a null pointer dereference.

    Differential Revision: — efriedma / ViewSVN
  3. Memory intrinsic value profile optimization: Improve debug output (NFC)

    Misc improvements to debug output. Fix a couple typos and also dump the
    value profile before we make any profitability checks.

    Reviewers: davidxl

    Subscribers: llvm-commits

    Differential Revision: — tejohnson / ViewSVN
  4. Added an Importer test for in-class member initializers. — Sean Callanan / ViewSVN
  5. Limit disabling of warnings emitted from r301571 by checking __GNUC__. — marsupial / ViewSVN

r301571 (#5557) (Apr 27, 2017 11:48:09 AM)

  1. Fix warnings from test added in r301562 on Windows (when built without exceptions). — marsupial / ViewSVN
  2. [Profile] Add off-by-default -Wprofile-instr-missing warning

    Clang warns that a profile is out-of-date if it can't find a profile
    record for any function in a TU. This warning became noisy after llvm
    started allowing dead-stripping of instrumented functions.

    To fix this, this patch changes the existing profile out-of-date warning
    (-Wprofile-instr-out-of-date) so that it only complains about mismatched
    data. Further, it introduces a new, off-by-default warning about missing
    function data (-Wprofile-instr-missing).

    Differential Revision: — Vedant Kumar / ViewSVN
  3. Sync with changes from r300825 in clang.

    Generate the better include paths. Instead of #include <llvm_header.h> doxygen
    produces #include "llvm/Folder/llvm_header.h"

    Patch by Yuka Takahashi (D32342)! — vvassilev / ViewSVN
  4. [libclang] Enhance clang_Cursor_isDynamicCall and clang_Cursor_getReceiverType to handle ObjC property references

    Also enhance clang_Cursor_getReceiverType to handle C++ method calls. — akirtzidis / ViewSVN
  5. clang-cl: Alias /d1reportAllClassLayout to -fdump-record-layouts (PR32826) — hans / ViewSVN
  6. Use a pointer type for target frame indices during statepoint lowering

    The type of the target frame index is intptr, not the type of the value we're
    going to store into it.  Without this change we crash in the attached test case
    when trying to type-legalize a TargetFrameIndex.

    Patchpoint lowering types the target frame index as intptr as well.

    Reviewers: reames, bogner, arsenm

    Subscribers: arsenm, mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN

r301565 (#5556) (Apr 27, 2017 10:58:19 AM)

  1. cmake: Touch $GIT_DIR/logs/HEAD if it does not already exist.

    Apparently some git tools (such as "repo") may not create this file.
    Patch by Quentin Neill. — pcc / ViewSVN
  2. Fix -Wpedantic about extra semicolons in CGStmtOpenMP.cpp — hans / ViewSVN
  3. Remove leaking UnknownPragmaHandlers right after we are done with them.

    The UnknownPragmaHandlers added by DoPrintPreprocessedInput conflict with the
    real PragmaHandlers from clang::Parser because they try to handle the same
    #pragma directives. This makes it impossible to use a Preprocessor (that was
    previously passed to DoPrintPreprocessedInput), as an Preprocessor for a
    clang::Parser instance which is what we currently do in cling.

    This patch removes the added UnknownPragmaHandler to avoid conflicts these
    conflicts and leave the PragmaHandlers of the Preprocessors in a the same state
    as before calling DoPrintPreprocessedInput.

    Patch by Raphael Isemann (D32486)! — vvassilev / ViewSVN
  4. Refactor DynamicLibrary so searching for a symbol will have a defined order and
    libraries are properly unloaded when llvm_shutdown is called.

    This was mostly affecting usage of the JIT, where storing the library handles in
    a set made iteration unordered/undefined. This lead to disagreement between the
    JIT and native code as to what the address and implementation of particularly on
    Windows with stdlib functions:

    JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
    JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
    Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

    Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
    not giving priority to the process' symbols as it did on Unix.

    Reviewers: chapuni, v.g.vassilev, lhames

    Reviewed By: lhames

    Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

    Differential Revision: — marsupial / ViewSVN
  5. [PartialInlining]: Improve partial inlining to handle complex conditions

    Differential Revision: — davidxl / ViewSVN

r301560 (#5555) (Apr 27, 2017 10:08:35 AM)

  1. TSan: update line number after XFAIL on iOS. — Tim Northover / ViewSVN
  2. Update GDB remote command regex for IPv6

    This updates the regular expression used to match host/port pairs for the gdb-remote command to also match IPv6 addresses.

    The IPv6 address matcher is very generic and does not really check for structural validity of the address. It turns out that IPv6 addresses are very complicated. — cbieneman / ViewSVN
  3. [CMake] Use object library to build the two flavours of Polly.

    Polly comes in two library flavors: One loadable module to use the
    LLVM framework -load mechanism, and another one that host applications
    can link to. These have very different requirements for Polly's
    own dependencies.

    The loadable module assumes that all its LLVM dependencies are already
    available in the address space of the host application, and is not allowed
    to bring in its own copy of any LLVM library (including the NVPTX
    backend in case of Polly-ACC).

    The non-module library is intended to be linked to using
    target_link_libraries. CMake would then resolve all of its dependencies,
    including NVPTX and ensure that only a single instance of each library
    will be used.

    Differential Revision: — meinersbur / ViewSVN
  4. [CodeView] Isolate Debug Info Fragments into standalone classes.

    Previously parsing of these were all grouped together into a
    single master class that could parse any type of debug info

    With writing forthcoming, the complexity of each individual
    fragment is enough to warrant them having their own classes so
    that reading and writing of each fragment type can be grouped
    together, but isolated from the code for reading and writing
    other fragment types.

    In doing so, I found a place where parsing code was duplicated
    for the FileChecksums fragment, across llvm-readobj and the
    CodeView library, and one of the implementations had a bug.
    Now that the codepaths are merged, the bug is resolved.

    Differential Revision: — zturner / ViewSVN
  5. [Support] Make BinaryStreamArray extractors stateless.

    Instead, we now pass a context memeber through the extraction
    process. — zturner / ViewSVN
  6. Rename some PDB classes.

    We have a lot of very similarly named classes related to
    dealing with module debug info.  This patch has NFC, it just
    renames some classes to be more descriptive (albeit slightly
    more to type).  The mapping from old to new class names is as

       Old          |        New
    ModInfo         | DbiModuleDescriptor
    ModuleSubstream | ModuleDebugFragment
    ModStream       | ModuleDebugStream

    With the corresponding Builder classes renamed accordingly.

    Differential Revision: — zturner / ViewSVN
  7. [x86] add minimal tests for potential size-changing vsel transforms; NFC — spatel / ViewSVN
  8. [CMake] Abstract Config.h generation for Xcode

    This patch abstracts the generation of Config.h and creates a dummy project entry point to allow generation of LLDB's Config header without performing a full CMake configuration.

    This will enable the Xcode project to generate LLDB's Config header. — cbieneman / ViewSVN
  9. [Polly][Cmake] Add missing include paths to exported cmake config — pfaffe / ViewSVN
  10. [AMDGPU] DPP: add support for GFX9

    Reviewers: artem.tamazov

    Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

    Differential Revision: — skolton / ViewSVN
  11. Merging r296645: (PR32253)

    Included an updated testcase

    [Hexagon] Fix lowering of formal arguments of type i1

    On Hexagon, values of type i1 are passed in registers of type i32,
    even though i1 is not a legal value for these registers. This is a
    special case and needs special handling to maintain consistency of
    the lowering information.

    This fixes PR32089.
    ------------------------------------------------------------------------ — kparzysz / ViewSVN

r301549 (#5554) (Apr 27, 2017 9:18:46 AM)

  1. [OPENMP] Add a check for iterator not reached the end of stack, NFC.

    Add an extra check for the iterator during checks of the data-sharing
    attributes. — abataev / ViewSVN
  2. [index] Mark the ObjC implicit accessor method definitions as 'dynamic' as well — akirtzidis / ViewSVN
  3. [OPENMP] Improve performance of the hasDSA() function, NFC.

    Remove some unneccesary code from the function after the fix for ASAN
    buildbots. — abataev / ViewSVN
  4. Fix typo and place comment close to its target

    Patch by Wei-Ren Chen.

    Differential Revision: — kparzysz / ViewSVN
  5. Fixing a malformed RST table to get the documentation bot back to green. — aaronballman / ViewSVN

r301544 (#5553) (Apr 27, 2017 8:28:40 AM)

  1. Fixed assert message to correctly refer to MRMSrcReg4VOp3Frm/MRMSrcMeg4VOp3Frm. — rksimon / ViewSVN
  2. Also match the output on 32 bit systems. — rafael / ViewSVN

r301542 (#5552) (Apr 27, 2017 7:38:22 AM)

  1. [libclang] Pass in the -fallow-editor-placeholders option

    This will suppress any live diagnostics caused by editor placeholders in Xcode.

    rdar://31833579 — arphaman / ViewSVN
  2. Add missing FileCheck, update CHECK lines and avoid subshell. — rafael / ViewSVN
  3. [mips][microMIPS] Adding code size reduction pass for MicroMIPS
    Author: milena.vujosevic.janicic
    Reviewers: sdardis
    The code implements size reduction pass for MicroMIPS.
    Load and store instructions are examined and transformed, if possible.
    lw32 instruction is transformed into 16-bit instruction lwsp
    sw32 instruction is transformed into 16-bit instruction swsp
    Arithmetic instrcutions are examined and transformed, if possible.
    addu32 instruction is transformed into 16-bit instruction addu16
    subu32 instruction is transformed into 16-bit instruction subu16
    Differential Revision: — zjovanovic / ViewSVN
  4. clang/test/Modules/malformed-overload.m: Make sure module cache is clean. — chapuni / ViewSVN
  5. clang-format: [JS] parse async function declarations.

    Previously, clang-format would accidentally parse an async function
    declaration as a function expression, and thus not insert an unwrapped
    line for async functions, causing subsequent functions to run into the

        async function f() {
        } function g() { ...

    With this change, async functions get parsed as top level function
    declarations and get their own unwrapped line context.

    Reviewers: djasper

    Subscribers: klimek, cfe-commits

    Differential Revision: — mprobst / ViewSVN

r301537 (#5551) (Apr 27, 2017 6:47:50 AM)

  1. [LLDB][MIPS] Forgot to add check in commit rl301530
    Reviewers: ki.stfu, labath
    Subscribers: jaydeep, bhushan, lldb-commits, slthakur — nitesh.jain / ViewSVN
  2. Fix asan failures on OpenMP. — hokein / ViewSVN
  3. [X86] Support of no_caller_saved_registers attribute

    Implements the Clang part for no_caller_saved_registers attribute as appears here:;a=commit;h=5ed3cc7b66af4758f7849ed6f65f4365be8223be.

    Differential Revision: — orenb / ViewSVN

r301534 (#5550) (Apr 27, 2017 5:57:43 AM)

  1. TCPSocket: add back support for "*" address

    before r301492, we could specify "*:1234" as an address to lldb-server
    and it would interpret that as "any". I am not sure that's a good idea,
    but we have usages of that in the test suite, and without this the
    remote test suite fails.

    I'm adding that back, as it does not seem it was an intended side-effect
    of that change, but I am open to removing it in the future, after
    discussion and test suite fixup. — labath / ViewSVN

r301533 (#5549) (Apr 27, 2017 5:07:41 AM)

  1. [SystemZ]  Remove incorrect assert in SystemZTTIImpl

    In getCmpSelInstrCost(), CondTy may actually be scalar while ValTy is a
    vector when LoopVectorizer is the caller. Therefore the assert that CondTy
    must be a vector type if ValTy is was wrong and is now removed.

    Review: Ulrich Weigand — jonpa / ViewSVN
  2. [ObjC] Disallow vector parameters and return values in Objective-C methods
    for iOS < 9 and OS X < 10.11 X86 targets

    This commit adds a new error that disallows methods that have parameters/return
    values with a vector type for some older X86 targets. This diagnostic is
    needed because objc_msgSend doesn't support SIMD vector registers/return values
    on X86 in iOS < 9 and OS X < 10.11. Note that we don't necessarily know if the
    vector argument/return value will use a SIMD register, so instead we chose to
    be conservative and prohibit all vector types.


    Differential Revision: — arphaman / ViewSVN

r301531 (#5548) (Apr 27, 2017 4:18:00 AM)

  1. [ARM] GlobalISel: Fix extended stack operands

    Fix a crash when trying to extend a value passed as a sign- or
    zero-extended stack parameter. The cause of the crash was that we were
    setting the size of the loaded value to 32 bits, and then tyring to
    extend again to 32 bits.

    This patch addresses the issue by also introducing a G_TRUNC after the
    load. This will leave the unused bits to their original values set by
    the caller, while being consistent about the types. For values that are
    not extended, we just use a smaller load. — rovka / ViewSVN
  2. [LLDB][MIPS] Fix failure.

    Reviewers: ki.stfu, labath

    Subscribers: jaydeep, bhushan, lldb-commits, slthakur

    Differential Revision: — nitesh.jain / ViewSVN
  3. 2 tests that were lost in rL301390 — avt77 / ViewSVN
  4. [ELF] - Modify testcase because of llvm-dwarfdump dump format change.

    llvm-dwarfdump format changed in r301527 — grimar / ViewSVN
  5. [llvm-dwarfdump] - Change format for .gdb_index dump.

    It is useful to output size of ranges when address ranges
    section of .gdb_index is dumped.

    It helps to compare outputs produced by different linkers,
    for example. In that case address ranges can look very different,
    when they are the same at fact. Difference comes from different
    low address because of different address of .text.

    Differential revision: — grimar / ViewSVN
  6. Constify SourceManager input to MacroInfo::getDefinitionLengthSlow, NFC. — yrnkrn / ViewSVN

r301525 (#5547) (Apr 27, 2017 3:28:11 AM)

  1. Don't hard-code "modules-cache-path" in the test. — hokein / ViewSVN

r301524 (#5546) (Apr 27, 2017 2:38:30 AM)

  1. Fix build for clang r301507

    LangStandard::lang_opencl -> LangStandard::lang_opencl10 — labath / ViewSVN

r301523 (#5545) (Apr 27, 2017 1:48:46 AM)

  1. [GlobalISel][X86] handle not symmetric G_COPY

    Summary: handle not symmetric G_COPY

    Reviewers: zvi, guyblank

    Reviewed By: guyblank

    Subscribers: rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN
  2. In the expression evaluator, visit the index of an ArraySubscriptExpr even if we can't evaluate the base, if the evaluation mode tells us to continue evaluation. — nicholas / ViewSVN
  3. [CodeGen][NFC] Rename 'Src' to 'Val'.

    'Src' looks like it was borrowed from memcpy, 'Val' makes more sense for
    memset and is consistent with naming within the function.

    Differential Revision: — courbet / ViewSVN
  4. In the expression evaluator, descend into both the true and false expressions of a ConditionalOperator when the condition can't be evaluated and we're in an evaluation mode that says we should continue evaluating. — nicholas / ViewSVN

r301519 (#5544) (Apr 27, 2017 12:58:50 AM)

  1. [Polly] Do not introduce address space cast

    Do not introduce address space cast in IslNodeBuilder::preloadUnconditionally.

    Differential Revision: — ether / ViewSVN

r301518 (#5543) (Apr 27, 2017 12:08:19 AM)

  1. Use accessors for ValueHandleBase::V; NFC

    This changes code that touches ValueHandleBase::V to go through
    getValPtr and (newly added) setValPtr.  This functionality will be
    used later, but also seemed like a generally good cleanup.

    I also renamed the field to Val, but that's just to make it obvious
    that I fixed all the uses. — sanjoy / ViewSVN
  2. [Metadata] Fix typos in comments. NFC — ctopper / ViewSVN

r301516 (#5542) (Apr 26, 2017 11:18:08 PM)

  1. [InstCombine] Use APInt bit counting methods to avoid a temporary APInt. NFC — ctopper / ViewSVN
  2. Recommend users use readelf instead of objdump to dump .comment contents.

    readelf's output is much easier to read than objdump's as you can see below.

      $ readelf --string-dump .comment foo
      String dump of section '.comment':
        [     1]  GCC: (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
        [    2c]  clang version 5.0.0
        [    41]  Linker: LLD 5.0.0

      $ objdump -j .comment -s foo
      Contents of section .comment:
       0000 00474343 3a202855 62756e74 7520342e  .GCC: (Ubuntu 4.
       0010 382e342d 32756275 6e747531 7e31342e  8.4-2ubuntu1~14.
       0020 30342e33 2920342e 382e3400 636c616e  04.3) 4.8.4.clan
       0030 67207665 7273696f 6e20352e 302e3020  g version 5.0.0
       0040 004c696e 6b65723a 204c4c44 20352e30  .Linker: LLD 5.0
       0050 2e3000                               .0. — ruiu / ViewSVN

r301514 (#5541) (Apr 26, 2017 10:28:09 PM)

  1. Simplify BinaryFile::parse and add comments. — ruiu / ViewSVN
  2. Remove needless type conversions. — ruiu / ViewSVN

r301512 (#5540) (Apr 26, 2017 9:38:17 PM)

  1. Make StringSaver::save less ambiguous.

    Previously, an expression such as"foo") + "bar")
    didn't compile because there is an ambiguity as to whether the argument
    is of const Twine& or StringRef. — ruiu / ViewSVN
  2. AMDGPU: Fix assert in scheduler

    Assert is triggered if DBG_VALUE is first instruction in BB

    Differential Revision: — kzhuravl / ViewSVN

r301510 (#5539) (Apr 26, 2017 8:48:07 PM)

  1. [Support] Fix overflow in SLEB128 decoding.

    decodeULEB128 was fixed in r216268, but decodeSLEB128 always had the
    same issue, which is now exposed in r301369. — Ahmed Bougacha / ViewSVN
  2. [Support] clang-format LEB128.h. NFC. — Ahmed Bougacha / ViewSVN

r301508 (#5538) (Apr 26, 2017 7:58:03 PM)

  1. Darwin: Define __STDC_NO_THREADS__ on Darwin targets

    Darwin doesn't support C11 threads.h.  Define `__STDC_NO_THREADS__` so
    that users can check for it.

    rdar://problem/18461003 — Duncan P. N. Exon Smith / ViewSVN
  2. Improve diagnostics for bad -std= flag.

    Don't list deprecated -std= values (c++0x etc). Only produce one line of output
    per standard, even if we know it by multiple names.

    In passing, add missing -std=gnu++03 alias (supported by GCC), and add new
    spelling '-std=cl1.0' for OpenCL 1.0 for consistency with the other values,
    with the same meaning as the preexisting '-std=cl'. — rsmith / ViewSVN

r301506 (#5537) (Apr 26, 2017 7:07:58 PM)

  1. One more try at the whole compiling thing...

    Need to actually use the right type in both parts of the cast. — cbieneman / ViewSVN
  2. Disable GVN Hoist due to still more bugs being found in it. There is
    also a discussion about exactly what we should do prior to re-enabling

    The current bug is and the discussion about this
    is in the review thread for r300200. — chandlerc / ViewSVN
  3. One more attempt to fix the broken bots. — cbieneman / ViewSVN
  4. clang/Lex/PPCallbacks.h: Fix a warning in r301472. [-Wdocumentation] — chapuni / ViewSVN

r301502 (#5536) (Apr 26, 2017 6:17:25 PM)

  1. Fix Windows bots broken by r301492 — cbieneman / ViewSVN
  2. Turn DISubprogram into a variable-length node.

    DISubprogram currently has 10 pointer operands, several of which are
    often nullptr. This patch reduces the amount of memory allocated by
    DISubprogram by rearranging the operands such that containing type,
    template params, and thrown types come last, and are only allocated
    when they are non-null (or followed by non-null operands).

    This patch also eliminates the entirely unused DisplayName operand.

    This saves up to 4 pointer operands per DISubprogram. (I tried
    measuring the effect on peak memory usage on an LTO link of an X86
    llc, but the results were very noisy).

    This reapplies r301498 with an attempted workaround for g++.

    Differential Revision: — Adrian Prantl / ViewSVN
  3. Remove unnecessary and somewhat inaccurate "C89" flag from language standards. — rsmith / ViewSVN
  4. Revert "Turn DISubprogram into a variable-length node."

    This reverts commit r301498 while investigating bot breakage. — Adrian Prantl / ViewSVN
  5. Turn DISubprogram into a variable-length node.

    DISubprogram currently has 10 pointer operands, several of which are
    often nullptr. This patch reduces the amount of memory allocated by
    DISubprogram by rearranging the operands such that containing type,
    template params, and thrown types come last, and are only allocated
    when they are non-null (or followed by non-null operands).

    This patch also eliminates the entirely unused DisplayName operand.

    This saves up to 4 pointer operands per DISubprogram. (I tried
    measuring the effect on peak memory usage on an LTO link of an X86
    llc, but the results were very noisy). — Adrian Prantl / ViewSVN
  6. Don't accept -std= values that would switch us to a different source language.

    We already prohibited this in most cases (in r130710), but had some bugs in our
    enforcement of this rule. Specifically, this prevents the following

    * -x c -std=clN.M, which would previously effectively act as if -x cl were
       used, despite the input being a C source file. (-x cl -std=cNN continues
       to be disallowed.)

    * -x c++ -std=cuda, which would previously select C++98 + CUDA, despite that
       not being a C++ standard. (-x cuda -std=c++NN is still permitted, and
       selects CUDA with the given C++ standard as its base language.
       -x cuda -std=cuda is still supported with the meaning of CUDA + C++98.)

    * -x renderscript -std=c++NN, which would previously form a hybrid "C++ with
       RenderScript extensions" language. We could support such a thing, but
       shouldn't do so by accident. — rsmith / ViewSVN
  7. MachineFrameInfo.h: Remove unnecessary forward declarations; NFC — matze / ViewSVN
  8. Lanai: Remove unnecessary canRealignStack() override; NFC

    It was doing the same as the base implementation and was irritating me
    when I was searching for backends that have custom behavior for
    canRealignStack. — matze / ViewSVN
  9. MachineFrameInfo: Move implementation to an own file; NFC

    Move implementation of the MachineFrameInfo class into
    MachineFrameInfo.cpp — matze / ViewSVN

r301493 (#5535) (Apr 26, 2017 5:26:33 PM)

  1. Fix libcxx formatters for changes in r300140.

    LLVM r300140 changed the layout and field names of __compressed_pair, which
    broke LLDB's std::vector, std::map and std::unsorted_map formatters.

    This patch attempts to fix these formatters by having them interogate the
    __compressed_pair values to determine whether they're pre- or post-r300140
    variants, then access them accordingly.

    Reviewers: jingham, EricWF

    Reviewed By: jingham

    Differential Revision: — Lang Hames / ViewSVN
  2. Re-landing IPv6 support for LLDB Host

    This support was landed in r300579, and reverted in r300669 due to failures on the bots.

    The failures were caused by sockets not being properly closed, and this updated version of the patches should resolve that.

    Summary from the original change:

    This patch adds IPv6 support to LLDB/Host's TCP socket implementation. Supporting IPv6 involved a few significant changes to the implementation of the socket layers, and I have performed some significant code cleanup along the way.

    This patch changes the Socket constructors for all types of sockets to not create sockets until first use. This is required for IPv6 support because the socket type will vary based on the address you are connecting to. This also has the benefit of removing code that could have errors from the Socket subclass constructors (which seems like a win to me).

    The patch also slightly changes the API and behaviors of the Listen/Accept pattern. Previously both Listen and Accept calls took an address specified as a string. Now only listen does. This change was made because the Listen call can result in opening more than one socket. In order to support listening for both IPv4 and IPv6 connections we need to open one AF_INET socket and one AF_INET6 socket. During the listen call we construct a map of file descriptors to addrin structures which represent the allowable incoming connection address. This map removes the need for taking an address into the Accept call.

    This does have a change in functionality. Previously you could Listen for connections based on one address, and Accept connections from a different address. This is no longer supported. I could not find anywhere in LLDB where we actually used the APIs in that way. The new API does still support AnyAddr for allowing incoming connections from any address.

    The Listen implementation is implemented using kqueue on FreeBSD and Darwin, WSAPoll on Windows and poll(2) everywhere else. — cbieneman / ViewSVN
  3. Revert r301487: Replace HashString algorithm with xxHash64

    This reverts commit r301487 to make buildbots green. — ruiu / ViewSVN
  4. Remove unnecessary instantiation of StringRef.

    SoName's type has changed from StringRef to std::string, so this
    code does not make sense anymore. — ruiu / ViewSVN
  5. Add support for DW_TAG_thrown_type.

    For Swift we would like to be able to encode the error types that a
    function may throw, so the debugger can display them alongside the
    function's return value when finish-ing a function.

    DWARF defines DW_TAG_thrown_type (intended to be used for C++ throw()
    declarations) that is a perfect fit for this purpose. This patch wires
    up support for DW_TAG_thrown_type in LLVM by adding a list of thrown
    types to DISubprogram.

    To offset the cost of the extra pointer, there is a follow-up patch
    that turns DISubprogram into a variable-length node.


    Differential Revision: — Adrian Prantl / ViewSVN
  6. Removes createELFFile which takes a template class as a template parameter.

    This patch is to reduce amount of template uses. The new code is less
    exciting and boring than before, but I think it is easier to read.

    Differential Revision: — ruiu / ViewSVN
  7. Replace HashString algorithm with xxHash64

    The previous algorithm processed one character at a time, which is very
    painful on a modern CPU. Replace it with xxHash64, which both already
    exists in the codebase and is fairly fast.

    Patch from Scott Smith!

    Differential Revision: — ruiu / ViewSVN

r301486 (#5534) (Apr 26, 2017 4:35:16 PM)

  1. Fix comment. NFC — George Burgess IV / ViewSVN
  2. [MC] Fix some Clang-tidy modernize-use-using warnings; other minor fixes (NFC). — eugenezelenko / ViewSVN
  3. Create an OutputSection for each non-empty OutputSectionCommand.

    We were already pretty close, the one exception was when a name was
    reused in another SECTIONS directive:

      .text : { *(.text) }
      .data : { *(.data) }
      .data : { *(other) }

    In this case we would create a single .data and magically output
    "other" while looking at the first OutputSectionCommand.

    We now create two .data sections. This matches what gold does. If we
    really want to create a single one, we should change the parser so that
    the above is parsed as if the user had written

      .text : { *(.text) }
      .data : { *(.data) *(other)}

    That is, there should be only one OutputSectionCommand for .data and
    it would have two InputSectionDescriptions.

    By itself this patch makes the code a bit more complicated, but is an
    important step in allowing assignAddresses to operate just on the
    linker script. — rafael / ViewSVN
  4. Update lldb to match clang r301442.

    This code really doesn't make any sense: there is only ever one InputKind here.
    Plus, this is an incomplete and out-of-date copy-paste of some Clang code. This
    really ought to be revisited, but this change should get the bots green again. — rsmith / ViewSVN

r301482 (#5533) (Apr 26, 2017 3:44:02 PM)

  1. [ubsan] nullability-assign: Check assignments into C++ structs

    Fix the nullability-assign check so that it can handle assignments into
    C++ structs. Previously, such assignments were not instrumented.

    Testing: check-clang, check-ubsan, enabling the existing test in ObjC++
    mode, and building some Apple frameworks with -fsanitize=nullability. — Vedant Kumar / ViewSVN
  2. [unittests/DeLICM] Add test for Written vs Written.

    The interpretation of multiple known ValInsts for the same element and
    timepoint is that these are alterntivate names for the same values,
    for instance a PHINode and the incoming value when knowning it was
    the last executed block. That means that known values do not conflict
    if there at least (but necessarily all) one common ValInst.

    This prinviple also applies to Written values. Add a test for this
    principle. — meinersbur / ViewSVN
  3. [unittests/DeLICM] Add test for Occipied vs Occupied.

    The interpretation of multiple known ValInsts for the same element and
    timepoint is that these are alterntivate names for the same values,
    for instance a PHINode and the incoming value when knowning it was
    the last executed block. That means that known values do not conflict
    if there at least (but necessarily all) one common ValInst.

    Add a case to test this principle. — meinersbur / ViewSVN
  4. Merging r292034: (PR32315)

    Tweaked to not remove the non-const variants as to not change the ABI.

    r292034 | majnemer | 2017-01-14 13:54:58 -0800 (Sat, 14 Jan 2017) | 7 lines

    Adding const overloads of operator* and operator-> for DenseSet iterators

    This fixes some problems when building ClangDiagnostics.cpp on Visual Studio 2017 RC. As far as I understand, there was a change in the implementation of the constructor for std::vector with two iterator parameters, which in our case causes an attempt to dereference const Iterator objects. Since there was no overload for a const Iterator, the compile would fail.

    Patch by Hugo Puhlmann!

    Differential Revision:
    ------------------------------------------------------------------------ — hans / ViewSVN
  5. Mark two tests (dead-strip.c, as unsupported on iOS. — kuba.brecka / ViewSVN
  6. [LibCallsShrinkWrap] Remove an unnecessary class member variable. — davide / ViewSVN
  7. Do flag compatibility check in checkOptions. NFC. — ruiu / ViewSVN
  8. Factor out code to parse -build-id. NFC. — ruiu / ViewSVN
  9. [LibCallsShrinkWrap] More descriptive assertion messages.

    Fix a typo while I'm here. — davide / ViewSVN
  10. [LibCallsShrinkWrap] Remove some temporary cl::opt(s).

    The pass has been on and working for a while. — davide / ViewSVN

r301472 (#5532) (Apr 26, 2017 2:52:04 PM)

  1. Revert "Revert "PPCallbacks::MacroUndefined, change signature and add test.""

    This reverts commit r301469. It isn't needed with r301470, which fixes
    the API break introduced in the original commit. — Vedant Kumar / ViewSVN
  2. [LibCallsShrinkWrap] Teach the pass how to preserve the dominator. — davide / ViewSVN
  3. Fix API breaks — dblaikie / ViewSVN
  4. Revert "PPCallbacks::MacroUndefined, change signature and add test."

    This reverts commit r301449. It breaks the build with:

      MacroPPCallbacks.h:114:50: error: non-virtual member function marked 'override' hides virtual member function — Vedant Kumar / ViewSVN
  5. Fix API breaks — dblaikie / ViewSVN
  6. Kill the old Simplify* APIs, leave SimplifyInstruction for the moment — dannyb / ViewSVN
  7. NewGVN: Use new SimplifyQuery based API — dannyb / ViewSVN
  8. PHITransAddr: Use new SimplifyQuery based API. — dannyb / ViewSVN
  9. InstCombine: Use the new SimplifyQuery versions of Simplify*. Use AssumptionCache, DominatorTree, TargetLibraryInfo everywhere. — dannyb / ViewSVN
  10. Merging r299574:

    r299574 | nico | 2017-04-05 14:10:42 -0400 (Wed, 05 Apr 2017) | 17 lines

    clang-format: Support formatting utf-8 character literals in C++11+ mode.

    clang-format <<END
    auto c1 = u8'a';
    auto c2 = u'a';

      auto c1 = u8 'a';
      auto c2 = u'a';

      auto c1 = u8'a';
      auto c2 = u'a';

    Patch from Denis Gladkikh <>!

    ------------------------------------------------------------------------ — tstellar / ViewSVN
  11. [asan] Allow propagating env variables when testing on iOS Simulator

    This patch adds "%env" as a way to express that the environment variable should be set on the target device/simulator. This fixes some test failures when testing on iOS/Simulator.

    Differential Revision: — kuba.brecka / ViewSVN
  12. Fixed a crash when dealing with an empty method name in the ObjC runtime.
    I've filed a bug covering better unit testing of our runtime metadata reader, which will allow this to be testable..

    <rdar://problem/31793264> — Sean Callanan / ViewSVN
  13. [DeLICM] Use Known information when comparing Occupied and Written.

    Do not conflict if a write writes the same value as already known.

    This change only affects unit tests, but no functional changes are
    expected on LLVM-IR, as no Known information is yet extracted and
    consequently this functionality is only triggered through unit tests.

    Differential Revision: — meinersbur / ViewSVN
  14. XFAIL the TSan XPC tests on iOS.  XPC isn't available on iOS. — kuba.brecka / ViewSVN
  15. Fix the ASan testcase on iOS to allow both SIGSEGV and SIGBUS. — kuba.brecka / ViewSVN
  16. [DAGCombiner] add (sext i1 X), 1 --> zext (not i1 X)

    Besides better codegen, the motivation is to be able to canonicalize this pattern
    in IR (currently we don't) knowing that the backend is prepared for that.

    This may also allow removing code for special constant cases in
    DAGCombiner::foldSelectOfConstants() that was added in D30180.

    Differential Revision: — spatel / ViewSVN
  17. Mark the asan-sigbus.cpp ASan testcase as unsupported on iOS. We don't handle propagating crashes from/to iOS well. — kuba.brecka / ViewSVN
  18. Add a missing "%run" expansion to test case to support testing on iOS simulator. — kuba.brecka / ViewSVN
  19. Fix comments again.

    I thought I fixed the page size, but there were still errors.
    This patch also contains fixes for grammatical errors.
    Thanks pcc for proofreading! — ruiu / ViewSVN
  20. [Modules] Fix a crash-on-invalid with overloaded functions

    Do not add an overload if the function doesn't have a prototype; this
    can happen if, for instance, a misplaced/malformed call site is
    considered like a declaration for recovery purposes.

    rdar://problem/31306325 — Bruno Lopes / ViewSVN
  21. Merging r294786:

    r294786 | yaxunl | 2017-02-10 16:46:07 -0500 (Fri, 10 Feb 2017) | 24 lines

    Fix invalid addrspacecast due to combining alloca with global var

    For function-scope variables with large initialisation list, FE usually
    generates a global variable to hold the initializer, then generates
    memcpy intrinsic to initialize the alloca. InstCombiner::visitAllocaInst
    identifies such allocas which are accessed only by reading and replaces
    them with the global variable. This is done by casting the global variable
    to the type of the alloca and replacing all references.

    However, when the global variable is in a different address space which
    is disjoint with addr space 0 (e.g. for IR generated from OpenCL,
    global variable cannot be in private addr space i.e. addr space 0), casting
    the global variable to addr space 0 results in invalid IR for certain
    targets (e.g. amdgpu).

    To fix this issue, when the global variable is not in addr space 0,
    instead of casting it to addr space 0, this patch chases down the uses
    of alloca until reaching the load instructions, then replaces load from
    alloca with load from the global variable. If during the chasing
    bitcast and GEP are encountered, new bitcast and GEP based on the global
    variable are generated and used in the load instructions.

    Differential Revision:

    ------------------------------------------------------------------------ — tstellar / ViewSVN
  22. Fix the typo in strtok.c testcase: There was a missing space in %run expansion. — kuba.brecka / ViewSVN
  23. Fix comment. — ruiu / ViewSVN
  24. PPCallbacks::MacroUndefined, change signature and add test.

    The PPCallbacks::MacroUndefined callback is currently insufficient for clients that need to track the MacroDirectives.
    This patch adds an additional argument to PPCallbacks::MacroUndefined that is the undef MacroDirective.

    Reviewers: bruno, manmanren

    Reviewed By: bruno

    Subscribers: nemanjai, cfe-commits

    Differential Revision: — marsupial / ViewSVN
  25. Follow-up for r301443: The python scrips need to be executable. — kuba.brecka / ViewSVN

r301447 (#5531) (Apr 26, 2017 1:56:07 PM)

  1. Merge r298569: Force @{init,fini}_array if section name starts with ".{init,fini}_array.".

    Related bug: — ruiu / ViewSVN
  2. Merge r298568: Print out "suppoted targets" — ruiu / ViewSVN
  3. Merge r298570: Fix Windows buildbots — ruiu / ViewSVN
  4. Merge r298532: Add "(compatible with GNU linkers)" to the -version output.

    Cherrypick request: — ruiu / ViewSVN
  5. [asan] Add support for running lit tests in the iOS Simulator

    This patch adds a basic support for running the ASan lit test suite against an iOS Simulator. This is done by generating more configurations into subdirectories such as IOSSimI386Config and IOSSimX86_64Config. These test suites are not added into "check-all" or into "check-asan", they have to be run manually.

    Differential Revision: — kuba.brecka / ViewSVN
  6. Refactor frontend InputKind to prepare for treating module maps as a distinct kind of input.

    No functionality change intended. — rsmith / ViewSVN

r301441 (#5530) (Apr 26, 2017 1:05:37 PM)

  1. Use llvm::ArrayRef rather than std::vector/std::initializer lists for some
    ValueObject methods.

    Using ArrayRef allows us to remove some overloads, work with more array-like
    types, and avoid some std::vector temporaries. — Lang Hames / ViewSVN
  2. [clang-tidy] Support detecting for-range loop in inefficient-vector-operation check.

    Also add an option "VectorLikeClasses" allowing user specify customized

    Reviewers: alexfh, aaron.ballman

    Reviewed By: alexfh

    Subscribers: Eugene.Zelenko, cfe-commits

    Differential Revision: — hokein / ViewSVN

r301439 (#5529) (Apr 26, 2017 12:07:39 PM)

  1. [AMDGPU][MC] Added arg checks for vmcnt, expcnt, lgkmcnt helpers

    Summary of changes:
    - corrected vmcnt, expcnt, lgkmcnt helpers to checks their argument for truncation;
    - added saturated versions of these helpers.

    See bug 32711 for details:

    Reviewers: artem.tamazov, vpykhtin

    Differential Revision: — dpreobra / ViewSVN
  2. LTO: Mark undefined module asm symbols as used.

    Marking them as used causes them to be considered visible outside of LTO. This
    prevents the symbols from being internalized or discarded, either by GlobalDCE
    or by summary-based dead stripping in ThinLTO.

    This change makes it unnecessary to add these symbols to llvm.compiler.used
    in the backend, as the symbols are kept alive by virtue of being external,
    so remove the backend code that handles that.

    Fixes PR32798.

    Differential Revision: — pcc / ViewSVN
  3. Merging r300429:

    r300429 | d0k | 2017-04-16 16:13:08 -0400 (Sun, 16 Apr 2017) | 7 lines

    [X86] Remove special handling for 16 bit for A asm constraints.

    Our 16 bit support is assembler-only + the terrible hack that is
    .code16gcc. Simply using 32 bit registers does the right thing for the

    Fixes PR32681.
    ------------------------------------------------------------------------ — tstellar / ViewSVN
  4. Merging r300404:

    r300404 | dim | 2017-04-15 18:15:01 -0400 (Sat, 15 Apr 2017) | 22 lines

    Use correct registers for "A" inline asm constraint

    In PR32594, inline assembly using the 'A' constraint on x86_64 causes
    llvm to crash with a "Cannot select" stack trace.  This is because
    `X86TargetLowering::getRegForInlineAsmConstraint` hardcodes that 'A'
    means the EAX and EDX registers.

    However, on x86_64 it means the RAX and RDX registers, and on 16-bit x86
    (ia16?) it means the old AX and DX registers.

    Add new register classes in `` to support these cases,
    and amend the logic in `getRegForInlineAsmConstraint` to cope with
    different subtargets.  Also add a test case, derived from PR32594.

    Reviewers: craig.topper, qcolombet, RKSimon, ab

    Reviewed By: ab

    Subscribers: ab, emaste, royger, llvm-commits

    Differential Revision:
    ------------------------------------------------------------------------ — tstellar / ViewSVN
  5. CorrelatedValuePropagation: Rename a variable for consistency — dannyb / ViewSVN
  6. [lsan] When necessary, define LSan suppression for tls_get_addr.

    Generalize already defined LSan suppression for the leak on
    tls_get_addr, some envs do not have the entire call stack symbolized,
    so we have to be less specific.

    Reviewers: eugenis

    Subscribers: llvm-commits

    Differential Revision: — alekseyshl / ViewSVN

r301433 (#5528) (Apr 26, 2017 11:08:54 AM)

  1. Update to isl-0.18-423-g30331fe

    This is just a general maintenance update. — grosser / ViewSVN
  2. [ValueTracking] Introduce a KnownBits struct to wrap the two APInts for computeKnownBits

    This patch introduces a new KnownBits struct that wraps the two APInt used by computeKnownBits. This allows us to treat them as more of a unit.

    Initially I've just altered the signatures of computeKnownBits and InstCombine's simplifyDemandedBits to pass a KnownBits reference instead of two separate APInt references. I'll do similar to the SelectionDAG version of computeKnownBits/simplifyDemandedBits as a separate patch.

    I've added a constructor that allows initializing both APInts to the same bit width with a starting value of 0. This reduces the repeated pattern of initializing both APInts. Once place default constructed the APInts so I added a default constructor for those cases.

    Going forward I would like to add more methods that will work on the pairs. For example trunc, zext, and sext occur on both APInts together in several places. We should probably add a clear method that can be used to clear both pieces. Maybe a method to check for conflicting information. A method to return (Zero|One) so we don't write it out everywhere. Maybe a method for (Zero|One).isAllOnesValue() to determine if all bits are known. I'm sure there are many other methods we can come up with.

    Differential Revision: — ctopper / ViewSVN
  3. [clang-tidy] Update IdentifierNamingCheck to remove extra leading/trailing underscores

    The goal of this change is to fix the following suboptimal replacements currently suggested by clang-tidy:
    // with MemberPrefix == "_"
    int __foo;  // accepted without complaint
    // with MemberPrefix == "m_"
    int _foo;

    I fixed this by
    - updating `matchesStyle()` to reject names which have a leading underscore after a prefix has already been stripped, or a trailing underscore if a suffix has already been stripped;
    - updating `fixupWithStyle()` to strip leading & trailing underscores before adding the user-defined prefix and suffix.

    The replacements are now:
    // MemberPrefix == "_"
    int __foo;
    // MemberPrefix == "m_"
    int _foo;

    Future improvements might elect to add .clang-tidy flags to improve what is being stripped. For instance, stripping `m_` could allow `m_foo` to be automatically replaced with `_foo`.

    Reviewers: alexfh

    Reviewed By: alexfh

    Subscribers: cfe-commits

    Patch by Jacob Bandes-Storch!

    Differential Revision: — alexfh / ViewSVN
  4. Revert "Update to LLVM's use of WeakTrackingVH; NFC"

    This reverts commit r301427. — sanjoy / ViewSVN
  5. Reverts commit r301424, r301425 and r301426

    Commits were:

    "Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts"
    "Add a new WeakVH value handle; NFC"
    "Rename WeakVH to WeakTrackingVH; NFC"

    The changes assumed pointers are 8 byte aligned on all architectures. — sanjoy / ViewSVN
  6. [LV] Handle external uses of floating-point induction variables

    Differential Revision: — mssimpso / ViewSVN
  7. Update to LLVM's use of WeakTrackingVH; NFC

    Summary: Depends on D32266

    Reviewers: davide, dblaikie

    Subscribers: mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  8. Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts

    In cases where an instruction (a call site, say) is RAUW'ed with some
    other value (this is possible via the `returned` attribute, amongst
    other things), we want the slot in UnknownInsts to point to the
    original Instruction we wanted to track, not the value it got replaced

    Fixes PR32587.

    Reviewers: davide

    Subscribers: mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  9. Add a new WeakVH value handle; NFC

    WeakVH nulls itself out if the value it was tracking gets deleted, but
    it does not track RAUW.

    Reviewers: dblaikie, davide

    Subscribers: mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  10. Rename WeakVH to WeakTrackingVH; NFC

    I plan to use WeakVH to mean "nulls itself out on deletion, but does
    not track RAUW" in a subsequent commit.

    Reviewers: dblaikie, davide

    Reviewed By: davide

    Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle

    Differential Revision: — sanjoy / ViewSVN
  11. Make LLD work even if the current directory is not writable. — ruiu / ViewSVN
  12. Move code to emit error messages from Filesystem.cpp to Driver.cpp.

    isFileWritable() checked if a file is writable and then emitted
    an error message if it is not writable. So it did more than the
    name says. This patch moves error() calls to Driver. — ruiu / ViewSVN
  13. [globalisel][tablegen] Fix vector element size

    Summary: Fix vector element size.

    Reviewers: dsanders

    Reviewed By: dsanders

    Subscribers: rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN

r301420 (#5527) (Apr 26, 2017 9:45:08 AM)

  1. [Sema] Avoid using a null type pointer (fixes PR32750)

    isMicrosoftMissingTypename() uses a Type pointer without first checking
    that it's non-null. PR32750 reports a case where the pointer is in fact
    null. This patch adds in a defensive check and a regression test.

    Differential Revision: — Vedant Kumar / ViewSVN
  2. [sampleprof] Drop test dependency on the string hash func (NFC)

    The SampleProfWriter emits function information in an order determined
    by the string hash function. The situation is a bit brittle, because
    changing the hash function can break the tests.

    Instead of sorting the function samples to get a relaible ordering (that
    might be too expensive), make the tests not depend on a particular
    ordering of function samples.

    Differential Revision: — Vedant Kumar / ViewSVN
  3. [AMDGPU][MC] Added check for truncation of SOPK imm operand

    See bug 30827:

    Reviewers: artem.tamazov, vpykhtin

    Differential Revision: — dpreobra / ViewSVN
  4. [OPENMP] Fix failing test. — abataev / ViewSVN

r301416 (#5526) (Apr 26, 2017 8:47:05 AM)

  1. [OPENMP] Fix handling of OpenMP code during template instantiation.

    If some function template is instantiated during handling of OpenMP
    code, currently it may cause crash of compiler because of trying of
    capturing variables in non-capturing function scopes. Patch fixes this
    bug. — abataev / ViewSVN
  2. Use CHECK-NEXT in a test.

    This will simplify a future patch. — rafael / ViewSVN
  3. [ELF] - Remove dead TLS relocations relative code for MIPS and ARM

    This code was not used because of
    handleARMTlsRelocation and handleMipsTlsRelocation methods that are called
    for these platforms instead of regular TLS code.

    Differential revision: — grimar / ViewSVN
  4. [AVR] Remove an unused local variable — dylanmckay / ViewSVN
  5. [x86] change tests to use sext, not zext; NFC

    These are intended to exercise D31944, so we need sexts. — spatel / ViewSVN
  6. Fix unused-variable warning caused by r301407. — hokein / ViewSVN
  7. [OPENMP] Move handling of threadprivate vars from the stack, NFC.

    Threadprivate variables do no need to be handled in the Stack of all
    directives, moving it out for better performance and memory. — abataev / ViewSVN
  8. -Wunguarded-availability should support if (@available) checks in top-level
    blocks and lambdas

    Prior to this commit Clang emitted the old "partial availability" warning for
    expressions that referred to declarations that were not yet introduced in
    blocks and lambdas that were not in a function/method. This commit ensures that
    top-level blocks and lambdas use the new unguarded availability checks.

    rdar://31835952 — arphaman / ViewSVN

r301408 (#5525) (Apr 26, 2017 7:56:48 AM)

  1. [TargetLowering] fix isConstTrueVal to account for build vector truncation

    Build vectors have magical truncation powers, so we have things like this:

    v4i1 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>
    v4i16 = BUILD_VECTOR Constant:i32<1>, Constant:i32<1>, Constant:i32<1>, Constant:i32<1>

    If we don't truncate the splat node returned by getConstantSplatNode(), then we won't find
    truth when ZeroOrNegativeOneBooleanContent is the rule.

    Differential Revision: — spatel / ViewSVN
  2. Convert LoopRotation to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available. — dannyb / ViewSVN
  3. Convert SimplifyInstructions to use the SimplifyQuery version of SimplifyInstruction — dannyb / ViewSVN
  4. Convert CVP to use SimplifyQuery version of SimplifyInstruction. Add AssumptionCache, DominatorTree, TLI if available. — dannyb / ViewSVN
  5. Fix signed multiplication with overflow fallback.

    For targets that don't have ISD::MULHS or ISD::SMUL_LOHI for the type
    and the double width type is illegal, then the two operands are
    sign extended to twice their size then multiplied to check for overflow.
    The extended upper halves were mismatched causing an incorrect result.
    This fixes the mismatch.

    A test was added for ARM V6-M where the bug was detected.

    Patch by James Duley.

    Differential Revision: — rsingh / ViewSVN
  6. [DAG] add FIXME comments for splat detection; NFC — spatel / ViewSVN

r301402 (#5524) (Apr 26, 2017 7:06:25 AM)

  1. -Wdocumentation should not check the @returns command for Objective-C
    function/block pointer properties

    The commit r300981 allowed @param/@return commands for function/block
    pointer property declarations. This meant that -Wdocumentation started warning
    about @return that was used to document properties whose function/block type
    returned void. However, prior to that commit, we allowed @return for all
    property declarations, because it can be used to document the value that's
    returned by the property getter. This commit restores the previous behaviour:
    now the @return command can be used to document all properties without warnings.

    rdar://24978538 — arphaman / ViewSVN
  2. [X86] Added pointer math zext test case (PR22970) — rksimon / ViewSVN
  3. [AST] Look through attribute type locs when searching for function type

    Prior to this commit -Wdocumentation crashed when checking the @returns command
    for declarations whose function/block pointer type included an attribute like

    rdar://31818195 — arphaman / ViewSVN
  4. clang-format: [JS/Java] ignore Objective-C constructs in JS & Java.

    Java and JavaScript support annotations and decorators, respectively, that use a leading "@" token. clang-format currently detects this as an Objective-C construct and applies special formatting, for example no whitespace around "=" operators. This change disables the distinction for Java and JavaScript, which leads to normal formatting of single line annotated and initialized properties.

        class X {
          @foo() bar=false;

        class X {
          @foo() bar = false;

    Reviewers: djasper, bkramer

    Subscribers: klimek, cfe-commits

    Differential Revision: — mprobst / ViewSVN
  5. formatting — mprobst / ViewSVN
  6. clang-format: [JS] prevent wraps before class members.

    Summary: In JavaScript/TypeScript, class member definitions that use modifiers can be subject to Automatic Semicolon Insertion (ASI). For example, "class X { get \n foo }" defines a property called "get" and a property called "foo", both with no type annotation. This change prevents wrapping after the modifier keywords (visibility modifiers, static, get and set) to prevent accidental ASI.

    Reviewers: djasper, bkramer

    Subscribers: klimek, cfe-commits

    Differential Revision: — mprobst / ViewSVN

r301396 (#5523) (Apr 26, 2017 6:15:39 AM)

  1. [X86][SSE] Add test case for repeated vector insertions of the same element (PR15298) — rksimon / ViewSVN
  2. Simplify the CFG after loop pass cleanup.

    Otherwise we might end up with some empty basic blocks or
    single-entry-single-exit basic blocks.

    This fixes PR32085

    Reviewers: chandlerc, danielcdh

    Subscribers: mehdi_amini, RKSimon, llvm-commits

    Differential Revision: — filcab / ViewSVN
  3. [mips] Fix test mips64fpldst.ll with machine verifier enabled

    Removed micro mips register classes for gp initialization because gp initialization uses pure mips64 instruction. Even when compiling for micro mips, gp initialization can be done with pure mips64 instructions.

    Reviewed by Simon Dardis
    Differential: D32286 — slthakur / ViewSVN

r301393 (#5522) (Apr 26, 2017 5:24:47 AM)

  1. [X86] Add missing mayLoad/mayStore attributes to some X86 instructions (Continue)

    Complete the patch committed in rL300190.

    Differential Revision: — aymanmus / ViewSVN
  2. [mips] Rework a portion of MipsCC interface. (NFC)

    r299766 contained a "conditional move or jump depends on uninitialized value"
    fault, identified by valgrind. This occurred as MipsFastISel::finishCall(..)
    used CCState over MipsCCState. The latter is required for the TableGen'd calling
    convention logic due to reliance on pre-analyzing type information to lower call
    results/returns of vectors correctly.

    This change modifies the MipsCC AnalyzeCallResult to be useful with both the
    SelectionDAG and FastISel lowering logic.

    Reviewers: slthakur

    Differential Revision: — sdardis / ViewSVN

r301391 (#5521) (Apr 26, 2017 4:34:21 AM)

  1. [ELF] - Implemented --defsym option.

    gnu ld description of option is:

    Create a global symbol in the output file, containing the absolute address given
    by expression. You may use this option as many times as necessary to define multiple
    symbols in the command line. A limited form of arithmetic is supported for the
    expression in this context: you may give a hexadecimal constant or the name of an
    existing symbol, or use "+" and "-" to add or subtract hexadecimal constants or
    symbols. If you need more elaborate expressions, consider using the linker command
    language from a script. Note: there should be no white space between symbol,
    the equals sign ("="), and expression.

    In compare with D32082, this patch does not support math expressions and absolute
    symbols. It implemented via code similar to --wrap. That covers 1 of 3 possible
    --defsym cases.

    Differential revision: — grimar / ViewSVN

r301390 (#5520) (Apr 26, 2017 3:43:44 AM)

  1. PR31007 and PR27884 will be closed: a possibility to compile constants like 0bH is now supported in MS asm. — avt77 / ViewSVN

r301389 (#5519) (Apr 26, 2017 2:52:50 AM)

  1. Initial implementation of SB APIs for Tracing support.

    This patch introduces new SB APIs for tracing support
    inside LLDB. The idea is to gather trace data from
    LLDB and provide it through this APIs to external
    tools integrating with LLDB. These tools will be
    responsible for interpreting and presenting the
    trace data to their users.

    The patch implements the following new SB APIs ->
    -> StartTrace - starts tracing with given parameters
    -> StopTrace - stops tracing.
    -> GetTraceData - read the trace data .
    -> GetMetaData - read the meta data assosciated with the trace.
    -> GetTraceConfig - read the trace configuration

    Tracing is associated with a user_id that is returned
    by the StartTrace API and this id needs to be used
    for accessing the trace data and also Stopping
    the trace. The user_id itself may map to tracing
    the complete process or just an individual thread.
    The APIs require an additional thread parameter
    when the user of these APIs wishes to perform
    thread specific manipulations on the tracing instances.
    The patch also includes the corresponding
    python wrappers for the C++ based APIs.

    Reviewers: k8stone, lldb-commits, clayborg

    Reviewed By: clayborg

    Subscribers: jingham, mgorny

    Differential Revision: — ravitheja / ViewSVN

r301388 (#5518) (Apr 26, 2017 2:02:03 AM)

  1. Document how to capture linux perf profiles.

    Differential Revision: — kbeyls / ViewSVN
  2. [test] Build sanitizer/xray tests only if COMPILER_RT_BUILD_* is on

    Cover the sanitizer tests with COMPILER_RT_BUILD_SANITIZERS
    conditional, and add COMPILER_RT_BUILD_XRAY conditional to the xray
    tests. This makes it possible to do a pure-builtins build with tests

    Differential Revision: — mgorny / ViewSVN
  3. [X86][SSE2] Fix asm string for movq (Move Quadword) instruction.

    Replace "mov{d|q}" with "movq".

    Differential Revision: — aymanmus / ViewSVN

r301385 (#5517) (Apr 26, 2017 12:39:37 AM)

  1. [InstCombine] Add test cases for opportunities to improve knownbits handling for cttz and ctlz intrinsics. — ctopper / ViewSVN
  2. [analyzer] Teach the MallocChecker about Glib API for two arguments

    Reviewers: zaks.anna, NoQ, danielmarjamaki

    Reviewed By: zaks.anna, NoQ, danielmarjamaki

    Subscribers: cfe-commits, kalev, pwithnall

    Differential Revision: — xiangzhai / ViewSVN
  3. Remove tailing whitespaces. — hliao / ViewSVN

r301382 (#5516) (Apr 25, 2017 11:15:13 PM)

  1. [Modules][ObjC] Check definition from canonical decl on designated initializers

    Use definition from canonical decl when checking for designated
    initializers. This is necessary since deserialization of a interface
    might reuse the definition from the canonical one (see r281119).

    rdar://problem/29360655 — Bruno Lopes / ViewSVN

r301381 (#5515) (Apr 25, 2017 10:19:58 PM)

  1. InstructionSimplify: Use braced initializer list for SimplifyQuery creation — dannyb / ViewSVN
  2. InstructionSimplify: Have SimplifyFPBinOp pass FastMathFlags by value, like we do everywhere else — dannyb / ViewSVN
  3. InstructionSimplify: End our long national nightmare of ever-growing Simplify* arguments.

    Expose the internal query structure, start using it.

    Note: This is the most minimal change possible i could create.  I have
    trivial followups, like fixing the one use of const FastMathFlags &,
    the renaming of CtxI to be consistent, etc.

    This should be NFC.

    Reviewers: majnemer, davide

    Subscribers: llvm-commits

    Differential Revision: — dannyb / ViewSVN

r301378 (#5514) (Apr 25, 2017 9:29:40 PM)

  1. [XRay][tools] Remove wayward semicolon (NFC)

    Follow-up to D29320. — dberris / ViewSVN

r301377 (#5513) (Apr 25, 2017 8:31:14 PM)

  1. [ubsan] Skip alignment checks on allocas with known alignment

    It's possible to determine the alignment of an alloca at compile-time.
    Use this information to skip emitting some runtime alignment checks.

    Testing: check-clang, check-ubsan.

    This significantly reduces the amount of alignment checks we emit when
    compiling X86ISelLowering.cpp. Here are the numbers from patched/unpatched
    clangs based on r301361.

      | Setup          | # of alignment checks |
      | unpatched, -O0 |                 47195 |
      | patched, -O0   |                 30876 | (-34.6%)
      ------------------------------------------ — Vedant Kumar / ViewSVN

r301376 (#5512) (Apr 25, 2017 7:41:00 PM)

  1. [XRay][tools] Fixup definition for stat division.

    Copy-pasta error.

    Follow-up to D29320. — dberris / ViewSVN
  2. [AMDGPU] Garbage collect dead code. NFCI. — davide / ViewSVN
  3. [asan] Unconditionally enable GC of globals on COFF.

    This change restores pre-r301225 behavior, where linker GC compatible global
    instrumentation was used on COFF targets disregarding -f(no-)data-sections and/or
    /Gw flags.

    This instrumentation puts each global in a COMDAT with an ASan descriptor for that global.
    It effectively enables -fdata-sections, but limits it to ASan-instrumented globals. — eugenis / ViewSVN
  4. [Support] Avoid UB in sys::fs::perms::operator~. NFC.

    This was exposed in r297945 and r301220: the intermediate complement
    is a 32-bit value, and casting it to 'perms' invokes UB. — Ahmed Bougacha / ViewSVN

r301372 (#5511) (Apr 25, 2017 6:50:59 PM)

  1. [MSP430] Fix PR32769: Select8 and Select16 need to have SR in Uses.

    If Select pseudo instruction doesn't have use SR, then
    CMP instructions are being marked as dead and later can be
    removed by MachineCSE pass. This leads to incorrect code

    Differential Revision: — dambrouski / ViewSVN

r301371 (#5510) (Apr 25, 2017 6:00:22 PM)

  1. [gcov] Sort file info before printing it

    The order in which GCOV file info is printed depends on the string hash
    function. This makes some GCOV tests brittle, because the tests must be
    updated whenever the hash function changes.

    Sort the filenames before printing out the file info to solve the
    problem. This should be relatively cheap.

    Differential Revision: — Vedant Kumar / ViewSVN
  2. revert debugging — sbc / ViewSVN
  3. [WebAssembly] Allow for signed relocation addends

    Addends are used as offsets to addresses of globals
    and can be both positive and negative.  This change
    prints libObject in line with the spec and the MC

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN
  4. [AVR] Do not kill the dest register for a pseudo instruction

    It caused the register to later be dead, which would trigger a verifier
    error. — dylanmckay / ViewSVN
  5. AMDGPU: Shift down reserved SP register like scratch wave offset — arsenm / ViewSVN
  6. [DAG] fix formatting of isConstantSplat(); NFC — spatel / ViewSVN

r301365 (#5509) (Apr 25, 2017 5:09:06 PM)

  1. [clang-tidy] check if clang-apply-replacements succeeds

    When running with -fix it tries to apply found replacements at the end.
    If there are errors running clang-apply-replacements, the script currently crashes or displays no error at all.

    This patch checks for errors running clang-apply-replacements the same way clang-tidy binary is handled.

    Another option would be probably checking for clang-apply-replacements (when -fix is passed) even before running clang-tidy.

    Reviewers: Prazek, alexfh, bkramer, mfherbst

    Reviewed By: Prazek, alexfh

    Subscribers: kimgr, cfe-commits

    Tags: #clang-tools-extra

    Differential Revision: — kuhar / ViewSVN

r301364 (#5508) (Apr 25, 2017 4:17:56 PM)

  1. [Hexagon] Handle -O4 when checking optimization level — kparzysz / ViewSVN
  2. AMDGPU: Clean up VOP3NoMods pattern

    There is no need to copy the operands or inspect the sources.
    Also remove some unnecessary clamp/omod usage. — arsenm / ViewSVN

r301362 (#5507) (Apr 25, 2017 3:26:15 PM)

  1. [x86] add more tests for potential change in bool math folding; NFC

    Also, use AVX2 to show a potential difference for 256-bit vectors. — spatel / ViewSVN
  2. [Hexagon] Set -ffp-contract=fast at -O3 unless explicitly specified — kparzysz / ViewSVN
  3. AMDGPU: Fix ValueKind code object metadata for images

    Differential Revision: — kzhuravl / ViewSVN
  4. [x86] regenerate checks; NFC — spatel / ViewSVN
  5. [llvm-pdbdump] Allow sorting / filtering by immediate padding — zturner / ViewSVN
  6. [llvm-pdbdump] Dump File / Line Info to YAML.

    We were already parsing and dumping this to the human readable
    format, but not to the YAML format.  This does so, in preparation
    for reading it in and reconstructing the line information from
    YAML. — zturner / ViewSVN
  7. [StringExtras] Add a fromHex to complement toHex.

    We already have a function toHex that will convert a string like
    "\xFF\xFF" to the string "FFFF", but we do not have one that goes
    the other way - i.e. to convert a textual string representing a
    sequence of hexadecimal characters into the corresponding actual
    bytes.  This patch adds such a function. — zturner / ViewSVN

r301355 (#5506) (Apr 25, 2017 2:29:00 PM)

  1. CMakeLists: Abort when llvm-size/llvm-profdata are not found

    - Also add a new TEST_SUITE_COLLECT_CODE_SIZE option (default On) so
      user can opt out of the data collection with llvm-size. — matze / ViewSVN

    COLLECT_COMPILE_TIME is more in line with COLLECT_STATS and the upcoming
    COLLECT_CODE_SIZE. — matze / ViewSVN
  3. Attempt to fix a Windows bot.

    Looks like `echo "{_start;};"` on lld-x86_64-win7 bot echoes `_start;;`
    for some reason. I cannot reproduce the issue locally. I suspect that
    it might be interpreting {<word>} in a special way. This patch is to
    attempt to fix it by appending space characters. — ruiu / ViewSVN
  4. SimplifyLibCalls: Fix crash on memset(notmalloc())

    rdar://31520787 — matze / ViewSVN
  5. Fix an assertion when skipping stack values in DWARF2 mode.
    The fix consists of resetting LocationKind when addMachineRegExpression fails.

    rdar://problem/31803010 — Adrian Prantl / ViewSVN

r301350 (#5505) (Apr 25, 2017 1:32:27 PM)

  1. [builtins] Implement emulated TLS on Windows.

    LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows.

    Reviewers: chh, howard.hinnant

    Reviewed By: chh

    Subscribers: mgorny, llvm-commits

    Differential Revision: — marsupial / ViewSVN
  2. Fix Hwloc API Incompatibility

    Older Hwloc libraries (< 1.10.0) don't offer the HWLOC_OBJ_NUMANODE nor
    HWLOC_OBJ_PACKAGE types. Instead they are named HWLOC_OBJ_NODE and
    HWLOC_OBJ_SOCKET instead. This patch just defines the newer names based on
    the older names when using an older Hwloc.

    Differential Revision: — jlpeyton / ViewSVN

r301348 (#5504) (Apr 25, 2017 12:41:34 PM)

  1. Minor fix for distribute_parallel_for_num_threads_codegen on AARCH64 — cbertol / ViewSVN
  2. [llvm-objdump] Don't attempt to print lines beyond the end of file

    This may trigger a segfault in llvm-objdump when the line number stored
    in debug infromation points beyond the end of file; lines in LineBuffer
    are stored in std::vector which is allocated in chunks, so even if the
    debug info points beyond the end of the file, this doesn't necessarily
    trigger the segfault unless the line number points beyond the allocated

    Differential Revision: — phosek / ViewSVN
  3. [Hexagon] Only increment debug counters if debug option is present — kparzysz / ViewSVN
  4. [LV] Make LIT test insensitive to basic block numbering

    This patch is part of D28975's breakdown.

    induction.ll encodes the specific (and rather arbitrary) numbers given to
    predicated basic blocks by the unique naming mechanism, which makes it
    sensitive to changes in LV's instruction generation order. This patch replaces
    those specific numbers with a numeric pattern.

    Differential Revision: — gilr / ViewSVN
  5. [PGO/tests] Update comment to reflect reality. — davide / ViewSVN
  6. Skip bitcasts while looking for GEP in LoadStoreVectorizer

    Differential Revisison: — rampitec / ViewSVN
  7. [X86][AVX2] Add shuffle test for PR27320 showing current codegen. — rksimon / ViewSVN
  8. [InstCombine] Remove redundant code from SimplifyUsingDistributiveLaws

    The code I've removed here exists in ExpandBinOp in InstSimplify which we call into before SimplifyUsingDistributiveLaws. The code in InstSimplify looks to have been copied from here.

    I verified this code doesn't fire on any lit tests. Not that that proves its definitely dead.

    Differential Revision: — ctopper / ViewSVN
  9. Recommit of
    [OpenMP] Initial implementation of code generation for pragma 'distribute parallel for' on host

    This patch makes the following additions:

    It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation.
    It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses.
    It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code. — cbertol / ViewSVN
  10. [PGO] Update test now that we don't call IndirectCallPromotion. — davide / ViewSVN
  11. [APInt] Use isSubsetOf, intersects, and bit counting methods to reduce temporary APInts

    This patch uses various APInt methods to reduce temporary APInt creation.

    This should be all of the unrelated cleanups that got buried in D32376(creating a KnownBits struct) as well as some pointed out by Simon during the review of that. Plus a few improvements to use counting instead of masking.

    I've left out any places where we do something like (KnownZero & KnownOne) != 0 as I plan to add a helper method to KnownBits to ask that question and didn't want to thrash that code an additional time.

    Differential Revision: — ctopper / ViewSVN

r301337 (#5503) (Apr 25, 2017 11:51:16 AM)

  1. [InstCombine] Fix CHECK-LABEL in two tests. — ctopper / ViewSVN
  2. Make it explicit that -export-dynamic overrides -dynamic-list and -export-dynamic-symbol.

    No functionality change. — ruiu / ViewSVN
  3. [lsan] When necessary, define LSan suppression for pthread_exit.

    Generalize already defined LSan suppression for the leak on
    pthread_exit, some envs do not have the entire call stack symbolized,
    so we have to be less specific.

    Reviewers: eugenis

    Subscribers: llvm-commits

    Differential Revision: — alekseyshl / ViewSVN
  4. [X86][SSE] Add tests for PR14657 showing current codegen. — rksimon / ViewSVN
  5. Print complete DIExpressions in the assembler output DEBUG_VALUE comments.

    The previous code was complex, incorrect, and couldn't print everything. — Adrian Prantl / ViewSVN
  6. Add a test for ICF and REL relocations. — ruiu / ViewSVN
  7. [WebAssembly] Fix relocation count in wasm binaries with call_indirect

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN
  8. [WebAssembly] Read global index in init expression as LEB

    Subscribers: jfb, dschuff

    Differential Revision: — sbc / ViewSVN
  9. [InstSimplify] Handle (~A & ~B) | (~A ^ B) -> ~A ^ B

    The code Sanjay Patel moved over from InstCombine doesn't work properly if the 'and' has both inputs as nots because we used a commuted op matcher on the 'and' first. But this will bind to the first 'not' on 'and' when there could be two 'not's. InstCombine could rely on DeMorgan to ensure the 'and' wouldn't have two 'not's eventually, but InstSimplify can't rely on that.

    This patch matches the xor first then checks for the ands and allows a not of either operand of the xor.

    Differential Revision: — ctopper / ViewSVN
  10. [libclang] Check for a record declaration before a template specialization

    Fixes PR32539.

    Patch by Emilio Cobos Álvarez!

    Differential Revision: — arphaman / ViewSVN
  11. [PM] Run IndirectCallPromotion only when PGO is enabled.

    Differential Revision: — davide / ViewSVN

r301326 (#5502) (Apr 25, 2017 11:00:55 AM)

  1. [InstCombine] Remove superfluous curly braces around a single line if body. NFC — ctopper / ViewSVN
  2. [ValueTracking] Use APInt::operator|=(uint64_t) instead of creating a temporary APInt. NFC — ctopper / ViewSVN
  3. [ValueTracking] Use APInt instead of auto. NFC

    This is a pre-commit for a patch I'm working on to turn KnownZero/One into a struct. Once I do that the type here will be less obvious. — ctopper / ViewSVN
  4. [ValueTracking] Use BitWidth local variable instead of re-reading it from KnownZero. NFC

    This is a pre-commit for a patch that I'm working on to merge KnownZero/KnownOne into a KnownBits struct which would have had to touch this line. — ctopper / ViewSVN
  5. [SelectionDAG] Added getBuildVector(ArrayRef<SDUse>) helper. — rksimon / ViewSVN
  6. [OpenMP] Optimized default kernel launch parameters in CUDA plugin

    Differential Revision: — grokos / ViewSVN

r301320 (#5501) (Apr 25, 2017 10:10:23 AM)

  1. [DAGCombiner] Refactor to make it easy to add support for vectors in a future patch. NFCI. — rksimon / ViewSVN
  2. [ELF] Improve error message for incompatible section flags

    Previously we were not printing out the flags of the incompatible
    section which made it difficult to determine what the problem was.

    The error message format has been change to the following:

      error: incompatible section flags for .bar
      >>> /foo/bar/incompatible-section-flags.s.tmp.o:(.bar): 0x403
      >>> output section .bar: 0x3

    Patch by Alexander Richardson.

    Differential Revision: — ruiu / ViewSVN
  3. [OpenMP] Add missing parenthesis which triggers a compile error

    Differential Revision: — grokos / ViewSVN
  4. Resubmit r301309: [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.

    This patch reapplies r301309 with the fix to the MIR test to fix the assertion
    triggered by r301309. Had trimmed a little bit too much from the MIR! — anng / ViewSVN

r301316 (#5500) (Apr 25, 2017 9:19:47 AM)

  1. [InstCombine] Add missing commute handling to (A | B) & (B ^ (~A)) -> (A & B)

    The matching here wasn't able to handle all the possible commutes. It always assumed the not would be on the left of the xor, but that's not guaranteed.

    Differential Revision: — ctopper / ViewSVN
  2. [index] Index type source info for class specializations

    rdar://31758344 — arphaman / ViewSVN
  3. [SelectionDAG] Use getBuildVector helper where possible. NFCI — rksimon / ViewSVN
  4. [AVR] Support the LDWRdPtr instruction with the same Src+Dst register — dylanmckay / ViewSVN

r301312 (#5499) (Apr 25, 2017 8:29:08 AM)

  1. Revert "[DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler."

    This reverts commit r301309 which is causing buildbot assertion failures. — anng / ViewSVN
  2. Bring back the ability opt out of padding zero-byte functions by not providing a nop instruction.

    Summary: No test case since I'm not aware of an in-tree target that needs this.

    Reviewers: hans

    Subscribers: llvm-commits

    Differential Revision: — dsanders / ViewSVN
  3. [index] Record the 'SpecializationOf' relation for function specializations

    rdar://31603531 — arphaman / ViewSVN
  4. [DebugInfo][X86] Fix handling of DBG_VALUE's in post-RA scheduler.

    This patch fixes a bug with the updating of DBG_VALUE's in
    BreakAntiDependencies. Previously, it would only attempt to update the first
    DBG_VALUE following the instruction whose register is being changed,
    potentially leaving DBG_VALUE's referring to the wrong register. Now the code
    will update all DBG_VALUE's that immediately follow the instruction.

    This issue was detected as a result of an optimized codegen difference with
    "-g" where an X86 byte/word fixup was not performed due to a DBG_VALUE
    referencing the wrong register.

    Differential Revision: — anng / ViewSVN
  5. [SelectionDAG] Pull out repeated getValueType calls. NFCI.

    Noticed in D32391. — rksimon / ViewSVN
  6. [Compiler-rt][MIPS] Fix assert introduce with commit rl301171. — nitesh.jain / ViewSVN

r301306 (#5498) (Apr 25, 2017 7:06:24 AM)

  1. Remove the home-grown android toolchain file and all references to it

    The toolchain file has been deprecated in favor of the "official"
    toolchain file present in the Android NDK. Also update the web
    build instructions to reflect this.

    Reviewers: eugene

    Subscribers: srhines, mgorny, dgross, tberghammer, lldb-commits

    Differential Revision: — labath / ViewSVN
  2. [DAGCombiner] Add vector support for (srl (trunc (srl x, c1)), c2) combine. — rksimon / ViewSVN
  3. [SimplifyLibCalls] Fix infinite loop with fast-math optimization.

    One of the fast-math optimizations is to replace calls to standard double
    functions with their float equivalents, e.g. exp -> expf. However, this can
    cause infinite loops for the following:

      float expf(float val) { return (float) exp((double) val); }

    A similar inline declaration exists in the MinGW-w64 math.h header file which
    when compiled with -O2/3 and fast-math generates infinite loops.

    So this fix checks that the calling function to the standard double function
    that is being replaced does not match the float equivalent.

    Differential Revision: — anng / ViewSVN

r301303 (#5497) (Apr 25, 2017 6:12:18 AM)

  1. [SelectionDAG] Recognise splat vector isKnownToBeAPowerOfTwo one/sign bit shift cases. — rksimon / ViewSVN

r301302 (#5496) (Apr 25, 2017 5:21:33 AM)

  1. Fix fuzzer.c test on platforms where CLANG_DEFAULT_CXX_STDLIB is libc++ — ismail / ViewSVN
  2. [DeLICM] Use Known information when comparing Existing.Occupied and Proposed.Occupied.

    Do not conflict if the value of Existing and Proposed are the same.

    This change only affects unit tests, but no functional changes are
    expected on LLVM-IR, as no Known information is yet extracted and
    consequently this functionality is only triggered through unit tests.

    Differential Revision: — meinersbur / ViewSVN

r301300 (#5495) (Apr 25, 2017 4:29:48 AM)

  1. [DAGCombiner] Use SDValue::getConstantOperandVal helper where possible. NFCI. — rksimon / ViewSVN

r301299 (#5494) (Apr 25, 2017 2:11:52 AM)

  1. [PPCGCodeGeneration] Update PPCG Code Generation for OpenCL compatibility

    Added a small change to the way pointer arguments are set in the kernel
    code generation. The way the pointer is retrieved now, specifically requests
    global address space to be annotated. This is necessary, if the IR should be
    run through NVPTX to generate OpenCL compatible PTX.

    The changes do not affect the PTX Strings generated for the CUDA target
    (nvptx64-nvidia-cuda), but are necessary for OpenCL (nvptx64-nvidia-nvcl).

    Additionally, the data layout has been updated to what the NVPTX Backend requests/recommends.

    Contributed-by: Philipp Schaad

    Reviewers: Meinersbur, grosser, bollu

    Reviewed By: grosser, bollu

    Subscribers: jlebar, pollydev, llvm-commits, nemanjai, yaxunl, Anastasia

    Tags: #polly

    Differential Revision: — bollu / ViewSVN

r301298 (#5493) (Apr 25, 2017 1:19:05 AM)

  1. [IVUsers] Don't bail out of normalizing non-affine add recs

    In a previous change I changed SCEV's normalization / denormalization
    to work with non-affine add recs.  So the bailout in IVUsers can be

    Reviewers: atrick, efriedma

    Reviewed By: atrick

    Subscribers: davide, mcrosier, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  2. [InstCombine] Add test cases for missing commute handling in ((A ^ C) ^ B) & (B ^ A) -> (B ^ A) & ~C — ctopper / ViewSVN

r301296 (#5492) (Apr 25, 2017 12:28:35 AM)

  1. [InstCombine] Add test cases showing failures to handle commuted patterns after tricking the operand complexity sorting. — ctopper / ViewSVN
  2. [LLDB][MIPS] Fix typo in

    Subscribers: jaydeep, bhushan, lldb-commits, slthakur — nitesh.jain / ViewSVN
  3. [InstCombine] Use commutable matchers to reduce some code. NFC — ctopper / ViewSVN
  4. [LV] Remove redundant basic block split

    This patch is part of D28975's breakdown.

    Genreating the control-flow to guard predicated instructions modified to
    only use SplitBlockAndInsertIfThen() for producing the if-then construct.

    Differential Revision: — gilr / ViewSVN

r301292 (#5491) (Apr 24, 2017 11:37:56 PM)

  1. Update doc of the variadic version of getOrInsertFunction

    It no longer needs a null terminator. — serge_sans_paille / ViewSVN

r301291 (#5490) (Apr 24, 2017 10:46:57 PM)

  1. [CodeExtractor]: Fixup use refs of the old phi.

    Differential Revision: — davidxl / ViewSVN
  2. Define __tls_get_addr as a hidden symbol even for ARM or MIPS.

    addIgnored defines a given symbol even if there is no existing
    symbol with the same name. So, even if libc provides __tls_get_addr,
    we should still be able to call addIgnored.

    Differential Revision: — ruiu / ViewSVN

r301289 (#5489) (Apr 24, 2017 9:56:11 PM)

  1. [ObjCARC] Do not sink an objc_retain past a clang.arc.use.

    We need to do this to prevent a miscompile which sinks an objc_retain
    past an objc_release that releases the object objc_retain retains. This
    happens because the top-down and bottom-up traversals each determines
    the insert point for retain or release individually without knowing
    where the other instruction is moved.

    For example, when the following IR is fed to the ARC optimizer, the
    top-down traversal decides to insert objc_retain right before
    objc_release and the bottom-up traversal decides to insert objc_release
    right after clang.arc.use.

    (IR before ARC optimizer)
    %11 = call i8* @objc_retain(i8* %10)
    call void (...) @clang.arc.use(%0* %5)
    call void @llvm.dbg.value(...)
    call void @objc_release(i8* %6)

    This reverses the order of objc_release and objc_retain, which causes
    the object to be destructed prematurely.

    (IR after ARC optimizer)
    call void (...) @clang.arc.use(%0* %5)
    call void @objc_release(i8* %6)
    call void @llvm.dbg.value(...)
    %11 = call i8* @objc_retain(i8* %10)

    rdar://problem/30530580 — ahatanak / ViewSVN
  2. [SimplifyLibCalls] Remove a cl::opt that's been `true` for a long time. — davide / ViewSVN
  3. Add comments about Widnows .reloc section. — ruiu / ViewSVN
  4. Do not create temporary files in the main source tree. — ruiu / ViewSVN

r301285 (#5488) (Apr 24, 2017 9:04:57 PM)

  1. Placate MSVC's narrowing conversion unhappiness. — rsmith / ViewSVN
  2. [unittests] Derive Occupied from Unused when given.

    When both, OccupiedAndKnown and Unused are given, use the former only
    for the Known values. The relation Unused \union Occupied must always

    This allows us to specify Known independently of Occupied. It is needed
    for an artificial test case in — meinersbur / ViewSVN
  3. [unittests] Add postcondition to completeLifetime. — meinersbur / ViewSVN

r301282 (#5487) (Apr 24, 2017 7:35:21 PM)

  1. Export __progname even if a -dynamic-list is given.

    BSD's __progname symbol is defined in crt1.o and linked against main
    executables. The libc expects that main executables export __progname
    symbol via .dynsym sections. In order to handle this case, we scan
    undefined symbols in DSOs and exported them by setting Sym->ExportDynamic
    to true.

    But it turned out that setting that variable is not enough to make sure
    that symbols are exported in all use cases. If a -dynamic-list option is
    given, all symbols not explicitly mentioned in a version script are
    hidden by default. That hides __progname symbol. This patch fixes the issue.

    Fixes — ruiu / ViewSVN
  2. Teach SCEV normalization to de/normalize non-affine add recs

    Before this change, SCEV Normalization would incorrectly normalize
    non-affine add recurrences.  To work around this there was (still is)
    a check in place to make sure we only tried to normalize affine add

    We recently found a bug in aforementioned check to bail out of
    normalizing non-affine add recurrences.  However, instead of fixing
    the bailout, I have decided to teach SCEV normalization to work
    correctly with non-affine add recurrences, making the bailout
    unnecessary (I'll remove it in a subsequent change).

    I've also added some unit tests (which would have failed before this

    Reviewers: atrick, sunfish, efriedma

    Reviewed By: atrick

    Subscribers: mcrosier, mzolotukhin, llvm-commits

    Differential Revision: — sanjoy / ViewSVN

r301280 (#5486) (Apr 24, 2017 6:14:21 PM)

  1. Name the C++ source files for two tests correctly. — Sean Callanan / ViewSVN
  2. Replace a binary .so with a text .s.

    Since LLD is now able to take version scripts, we no longer
    have to keep a pre-generated binary file for a test. — ruiu / ViewSVN
  3. Remove a useless temporary variable. — ruiu / ViewSVN
  4. Fixed two bad Makefiles that might be breaking Linux. — Sean Callanan / ViewSVN
  5. InferAddressSpaces: Use reference arguments instead of pointers — arsenm / ViewSVN

r301275 (#5485) (Apr 24, 2017 5:20:46 PM)

  1. [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). — eugenezelenko / ViewSVN
  2. Revert r301089 "[builtins] Implement emulated TLS on Windows."

    This broke the self-host build on Windows (PR32777).

    Original commit message:

    > [builtins] Implement emulated TLS on Windows.
    > Summary:
    > LLVM JIT needs to be able to use emulated TLS on all platforms, and this provides a reference one can compile to enable emutls for Linux/Mac/Windows.
    > Reviewers: chh, howard.hinnant
    > Reviewed By: chh
    > Subscribers: mgorny, llvm-commits
    > Differential Revision: — hans / ViewSVN
  3. [Expression parser] Return both types and variables

    Many times a user wants to access a type when there's a variable of
    the same name, or a variable when there's a type of the same name.
    Depending on the precise context, currently the expression parser
    can fail to resolve one or the other.

    This is because ClangExpressionDeclMap has logic to limit the
    amount of information it searches, and that logic sometimes cuts
    down the search prematurely. This patch removes some of those early

    In that sense, this patch trades performance (early exit is faster)
    for correctness.

    I've also included two new test cases showing examples of this
    behavior – as well as modifying an existing test case that gets it
    wrong. — Sean Callanan / ViewSVN
  4. [asan] Fix Windows global dead stripping tests

    Pass /Gw to clang-cl which is equivalent to -fdata-sections. This is now
    necessary. — rnk / ViewSVN
  5. [modules ts] Diagnose 'export' declarations outside of a module interface. — rsmith / ViewSVN
  6. InferAddressSpaces: Remove redundant assert

    This is just asserting all the operations are handled in the
    switch, which the unreachable already handles. — arsenm / ViewSVN
  7. [ARM, x86] add more vector tests for bool math; NFC

    I'm proposing a fold for increment-of-sexted-bool in: we need to know what happens in more cases like these. — spatel / ViewSVN

r301268 (#5484) (Apr 24, 2017 4:29:30 PM)

  1. [git-llvm] Remove CR from middle of svn propget output — rnk / ViewSVN
  2. Make getSlotAttributes return an AttributeSet instead of a wrapper list

    Remove the temporary, poorly named getSlotSet method which did the same
    thing. Also remove getSlotNode, which is a hold-over from when we were
    dealing with AttributeSetNode* instead of AttributeSet. — rnk / ViewSVN
  3. [Polly] [DependenceInfo] change WAR generation, Read will not block Read

    Earlier, the call to buildFlow was:
        WAR = buildFlow(Write, Read, MustWrite, Schedule).

    This meant that Read could block another Read, since must-sources can
    block each other.

    Fixed the call to buildFlow to correctly compute Read. The resulting
    code needs to do some ISL juggling to get the output we want.

    Bug report:

    Reviewers: Meinersbur

    Tags: #polly

    Differential Revision: — bollu / ViewSVN
  4. Mark a test as requiring a shell. — rafael / ViewSVN
  5. Handle _LINK_ env string as command line parameters.

    "_LINK_" environment varaible should be appended to the command line.

    Fixes — ruiu / ViewSVN
  6. [DWARF] Fix lookup in the abstract origins of inlined blocks/functions

    LLDB uses clang::DeclContexts for lookups, and variables get put into
    the DeclContext for their abstract origin. (The abstract origin is a
    DWARF pointer that indicates the unique definition of inlined code.)
    When the expression parser is looking for variables, it locates the
    DeclContext for the current context. This needs to be done carefully,
    though, e.g.:

    __attribute__ ((always_inline)) void f(int a) {
        int b = a * 2;

    void g() {
    Here, if we're stopped in the inlined copy of f, we have to find the
    DeclContext corresponding to the definition of f – its abstract
    origin. Clang doesn't allow multiple functions with the same name and
    arguments to exist. It also means that any variables we see must be
    placed in the appropriate DeclContext.

    [Bug 1]: When stopped in an inline block, the function
    GetDeclContextDIEContainingDIE for that block doesn't properly
    construct a DeclContext for the abstract origin for inlined
    subroutines. That means we get duplicated function DeclContexts, but
    function arguments only get put in the abstract origin's DeclContext,
    and as a result when we try to look for them in nested contexts they
    aren't found.

    [Bug 2]: When stopped in an inline block, the DWARF (for space
    reasons) doesn't explicitly point to the abstract origin for that
    block. This means that the function GetClangDeclContextForDIE returns
    a different DeclContext for each place the block is inlined. However,
    any variables defined in the block have abstract origins, so they
    will only get placed in the DeclContext for their abstract origin.

    In this fix, I've introduced a test covering both of these issues,
    and fixed them.

    Bug 1 could be resolved simply by making sure we look up the abstract
    origin for inlined functions when looking up their DeclContexts on
    behalf of nested blocks.

    For Bug 2, I've implemented an algorithm that makes the DeclContext
    for a block be the containing DeclContext for the closest entity we
    would find during lookup that has an abstract origin pointer. That
    means that in the following situation:

    { // block 1
      int a;
      { // block 2
        int b;
    if we looked up the DeclContext for block 2, we'd find the block
    containing the abstract origin of b, and lookup would proceed
    correctly because we'd see b and a. However, in the situation

    { // block 1
      int a;
      { // block 2
    since there isn't anything to look up in block 2, we can't determine
    its abstract origin (and there is no such pointer in the DWARF for
    blocks). However, we can walk up the parent chain and find a, and its
    abstract origin lives in the abstract origin of block 1. So we simply
    say that the DeclContext for block 2 is the same as the DeclContext
    for block 1, which contains a. Lookups will return the same results.

    Thanks to Jim Ingham for review and suggestions.

    Differential revision: — Sean Callanan / ViewSVN
  7. [git-llvm] Make `push` work on CRLF files with svn:eol-style=native

    `git apply` on Windows doesn't work for files that SVN checks out as
    CRLF. There is no way to force SVN to check everything out with Unix
    line endings on Windows. Files with svn:eol-style=native will always
    come out with CRLF, breaking `git apply`, which wants Unix line endings.
    My workaround is to list all files with this property set in the change,
    and run `dos2unix` on them. SVN doesn't commit a massive line ending
    change because the svn:eol-style property indicates that these are text

    Tested on r301245.

    Reviewers: zturner, jlebar

    Subscribers: llvm-commits

    Differential Revision: — rnk / ViewSVN
  8. [Modules] Fix test to wipe out the cache before using it

    This should appease bots:

    rdar://problem/31796737 — Bruno Lopes / ViewSVN

r301260 (#5483) (Apr 24, 2017 3:37:36 PM)

  1. [InstSimplify] use ConstantRange to simplify more and-of-icmps

    We can simplify (and (icmp X, C1), (icmp X, C2)) to one of the icmps in many cases.
    I had to check some of these with Alive to prove to myself it's right, but everything
    seems to check out. Eg, the code in instcombine was completely ignoring predicates with
    mismatched signedness.

    Handling or-of-icmps would be a follow-up step.

    Differential Revision: — spatel / ViewSVN
  2. Remove DefaultSoName.

    We can just use the existing SoName member variable. It now initially
    contains what was in DefaultSoName and is modified if the .so has an
    actual soname. — rafael / ViewSVN
  3. [DAGCombiner] Use APInt::intersects to avoid tmp variable. NFCI. — rksimon / ViewSVN
  4. [cfi] Fix wrong CMake condition for WIN32. — eugenis / ViewSVN
  5. [asan] Remove asanwrapper from Android test harness.

    It is only necessary for pre-L and creates problems on newer builds. — eugenis / ViewSVN
  6. Set unique builddir of lldb-amd64-ninja-netbsd8 through

    Old builddir: build
    New builddir: netbsd8 — kamil / ViewSVN
  7. AMDGPU: Slightly simplify prolog reserved register handling

    Rely on MachineRegisterInfo's knowledge of used physical

    Move flat_scratch initialization earlier, so the uses are visible
    when making these decisions.

    This will make it easier to add another reserved register
    at the end for the stack pointer rather than handling another
    special case. — arsenm / ViewSVN
  8. Cosmetic change. — gkistanova / ViewSVN
  9. ProfileData: clean up some stale declarations (NFC)

    These were removed in SVN r300381.  Remove the declarations. — Saleem Abdulrasool / ViewSVN
  10. [analyzer] Improve subscripting null arrays for catching null dereferences.

    Array-to-pointer cast now works correctly when the pointer to the array
    is concrete, eg. null, which allows further symbolic calculations involving
    such values.

    Inlined defensive checks are now detected correctly when the resulting null
    symbol is being array-subscripted before dereference.

    Differential Revision: — dergachev / ViewSVN
  11. Remove a dead field. NFC.

    Suggested by Adam Folwarczny! — Vedant Kumar / ViewSVN
  12. [Coverage] Avoid null deref in skipRegionMappingForDecl (fixes PR32761)

    Patch by Adam Folwarczny!

    Differential Revision: — Vedant Kumar / ViewSVN
  13. Small addition on how to add a builder. — gkistanova / ViewSVN
  14. [AMDGPU][mc][tests][NFC] Bulk ISA tests: update for Gfx7/Gfx8, add for Gfx9. — artem.tamazov / ViewSVN
  15. Specify a target explicitly in libfuzzer driver flag test — George Karpenkov / ViewSVN
  16. [Bitcode] Refactor attribute group writing to avoid getSlotAttributes

    That API creates a temporary AttributeList to carry an index and a
    single AttributeSet. We need to carry the index in addition to the set,
    because that is how attribute groups are currently encoded.


    Reviewers: pcc

    Subscribers: llvm-commits

    Differential Revision: — rnk / ViewSVN
  17. Update profile during memory instrinsic optimization

    Ensure that the new merge BB (which contains the rest of the original BB
    after the mem op being optimized) gets a profile frequency, in case
    there are additional mem ops later in the BB. Otherwise they get skipped
    as the merge BB looks cold.

    Reviewers: davidxl, xur

    Subscribers: llvm-commits

    Differential Revision: — tejohnson / ViewSVN
  18. [asan] Use posix strerror_r interceptor on android.

    This fixes a regression in r297315. — eugenis / ViewSVN
  19. Revert "StructurizeCFG: Directly invert cmp instructions"

    This reverts commit r300732. This breaks a few tests.
    I think the problem is related to adding more uses of
    the condition that don't yet exist at this point. — arsenm / ViewSVN

r301241 (#5482) (Apr 24, 2017 2:14:06 PM)

  1. [LoopUnroll] Remove spurious newline.

    Eli pointed out in the review, but I didn't squash the two commits
    correctly. Pointy-hat to me. — davide / ViewSVN
  2. Revert "Refactor DynamicLibrary so searching for a symbol will have a defined order"
    The i686-mingw32-RA-on-linux bot is still having errors.

    This reverts commit r301236. — marsupial / ViewSVN
  3. [LoopUnroll] Don't try to unroll non canonical loops.

    The current Loop Unroll implementation works with loops having a
    single latch that contains a conditional branch to a block outside
    the loop (the other successor is, by defition of latch, the header).
    If this precondition doesn't hold, avoid unrolling the loop as
    the code is not ready to handle such circumstances.

    Differential Revision: — davide / ViewSVN
  4. [LIR] Obey non-integral pointer semantics

    Summary: See

    Reviewers: haicheng

    Reviewed By: haicheng

    Subscribers: mcrosier, mzolotukhin, llvm-commits

    Differential Revision: — sanjoy / ViewSVN
  5. Avoid unnecessary copies in some for loops

    Use constant references rather than `const auto` which will cause the
    copy constructor.  These particular cases cause issues for the swift
    compiler. — Saleem Abdulrasool / ViewSVN
  6. Refactor DynamicLibrary so searching for a symbol will have a defined order and
    libraries are properly unloaded when llvm_shutdown is called.

    This was mostly affecting usage of the JIT, where storing the library handles in
    a set made iteration unordered/undefined. This lead to disagreement between the
    JIT and native code as to what the address and implementation of particularly on
    Windows with stdlib functions:

    JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s
    JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv
    Native: getenv("TEST") -> NULL // called ucrt.dll, getenv

    Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows
    not giving priority to the process' symbols as it did on Unix.

    Reviewers: chapuni, v.g.vassilev, lhames

    Reviewed By: lhames

    Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits

    Differential Revision: — marsupial / ViewSVN
  7. [cfi] Disable ThinLTO + CFI tests on Windows.

    PR32770. — eugenis / ViewSVN
  8. Move value type list from TargetRegisterClass to TargetRegisterInfo

    Differential Revision: — kparzysz / ViewSVN
  9. Revert r301223 — cbertol / ViewSVN
  10. Revert r301231: Accidentally committed stale files

    I forgot to commit local changes before commit. — kparzysz / ViewSVN
  11. Move value type list from TargetRegisterClass to TargetRegisterInfo

    Differential Revision: — kparzysz / ViewSVN
  12. AMDGPU: Select scratch mubuf offsets when pointer is a constant

    In call sequence setups, there may not be a frame index base
    and the pointer is a constant offset from the frame
    pointer / scratch wave offset register. — arsenm / ViewSVN
  13. AMDGPU: Set StackGrowsUp in MCAsmInfo

    Not sure what this does though. — arsenm / ViewSVN
  14. [AMDGPU] Merge M0 initializations

    Merges equivalent initializations of M0 and hoists them into a common
    dominator block. Technically the same code can be used with any
    register, physical or virtual.

    Differential Revision: — rampitec / ViewSVN
  15. Handle in BasicAA

    Summary: returns pointer that mustalias
    pointer it takes. It can't be marked with `returned` attribute,
    because it would be remove easily. The other reason is that
    only Alias Analysis can know about this, because if any other
    pass would know it, then the result would be replaced with it's
    argument, which would be invalid.

    We can think about returned pointer as something that mustalias, but
    it doesn't have to be bitwise the same as the argument.

    Reviewers: dberlin, chandlerc, hfinkel, sanjoy

    Subscribers: reames, nlewycky, rsmith, anna, amharc

    Differential Revision: — prazek / ViewSVN
  16. [asan] Let the frontend disable gc-sections optimization for asan globals.

    Also extend -asan-globals-live-support flag to all binary formats. — eugenis / ViewSVN
  17. [asan] Disable ASan global-GC depending on the target and compiler flags. — eugenis / ViewSVN
  18. [analyzer] Improve suppression for inlined defensive checks before operator &.

    Null dereferences are suppressed if the lvalue was constrained to 0 for the
    first time inside a sub-function that was inlined during analysis, because
    such constraint is a valid defensive check that does not, by itself,
    indicate that null pointer case is anyhow special for the caller.

    If further operations on the lvalue are performed, the symbolic lvalue is
    collapsed to concrete null pointer, and we need to track where does the null
    pointer come from.

    Improve such tracking for lvalue operations involving operator &.


    Differential Revision: — dergachev / ViewSVN
  19. [OpenMP] Initial implementation of code generation for pragma 'distribute parallel for' on host

    This patch makes the following additions:

    1. It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation.
    2. It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses.

    It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code.

    Looking forward to comments. — cbertol / ViewSVN

r301222 (#5481) (Apr 24, 2017 1:16:35 PM)

  1. [SimplifyCFG] Fix for non-determinism in codegen

    Summary: This patch fixes issues in codegen uncovered due to

    Reviewers: majnemer, chenli, davide

    Reviewed By: davide

    Subscribers: davide, arsenm, llvm-commits

    Differential Revision: — mgrang / ViewSVN
  2. Move size and alignment information of regclass to TargetRegisterInfo

    1. RegisterClass::getSize() is split into two functions:
       - TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const;
       - TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const;
    2. RegisterClass::getAlignment() is replaced by:
       - TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const;

    This will allow making those values depend on subtarget features in the

    Differential Revision: — kparzysz / ViewSVN
  3. Don't test setting sticky bits on files for modern BSDs

    Summary: In rL297945, jhenderson added methods for setting permissions
    to sys::fs, but some of the unittests that attempt to set sticky bits
    (01000) on files fail on modern BSDs, such as FreeBSD, NetBSD and
    OpenBSD.  This is because those systems do not allow regular users to
    set sticky bits on files, only on directories.  Fix it by disabling
    these particular tests on modern BSDs.

    Reviewers: emaste, brad, jhenderson

    Reviewed By: jhenderson

    Subscribers: joerg, krytarowski, llvm-commits

    Differential Revision: — dim / ViewSVN
  4. Don't emit CFI instructions at the end of a function

    When functions are terminated by unreachable instructions, the last
    instruction might trigger a CFI instruction to be generated. However,
    emitting it would be be illegal since the function (and thus the FDE
    the CFI is in) has already ended with the previous instruction.

    Darwin's dwarfdump --verify --eh-frame complains about this and the
    specification supports this.
    Relevant bits from the DWARF 5 standard (6.4 Call Frame Information):

    "[The] address_range [field in an FDE]: The number of bytes of
    program instructions described by this entry."

    "Row creation instructions: [...]
    The new location value is always greater than the current one."
    The first quotation implies that a CFI cannot describe a target
    address outside of the enclosing FDE's range.


    Differential Revision: — Adrian Prantl / ViewSVN
  5. Pragma: Fix DebugOverflowStack() resulting in endless loop.

    Drive-by fix (noticed while working on
    DebugOverflowStack() is supposed to provoke a stack overflow, however
    LLVM was smart enough to use the red-zone and fold the load into a tail
    jump on x86_64 optimizing this to an endless loop instead of a stack
    overflow. — matze / ViewSVN
  6. Updates documentation for a syntax sugar libfuzzer flag,

    as implemented in — George Karpenkov / ViewSVN
  7. Remove erroneous driver test for -fsanitize=fuzzer flag

    libfuzzer is not available on all platforms, and hence we can not always
    rely that it was compiled. — George Karpenkov / ViewSVN
  8. CodeGen: Add a hook for getFenceOperandTy

    Currently the operand type for ATOMIC_FENCE assumes value type of a pointer in address space 0.
    This is fine for most targets. However for amdgcn target, the size of pointer in address space 0
    depends on triple environment. For amdgiz environment, it is 64 bit but for other environment it is
    32 bit. On the other hand, amdgcn target expects 32 bit fence operands independent of the target
    triple environment. Therefore a hook is need in target lowering for getting the fence operand type.

    This patch has no effect on targets other than amdgcn.

    Differential Revision: — yaxunl / ViewSVN
  9. Revert "Compute safety information in a much finer granularity."

    Use-after-free in llvm::isGuaranteedToExecute. — eugenis / ViewSVN
  10. [InstSimplify] move (A & ~B) | (A ^ B) -> (A ^ B) from InstCombine

    This is a straight cut and paste, but there's a bigger problem: if this
    fold exists for simplifyOr, there should be a DeMorganized version for
    simplifyAnd. But more than that, we have a patchwork of ad hoc logic
    optimizations in InstCombine. There should be some structure to ensure
    that we're not missing sibling folds across and/or/xor. — spatel / ViewSVN
  11. Flag -fsanitize=fuzzer to enable libfuzzer

    Previously, adding libfuzzer to a project was a multi-step procedure,
    involving libfuzzer compilation, linking the library, and specifying
    coverage flags.
    With this change,libfuzzer can be enabled by adding a single
    -fsanitize=fuzzer flag instead. — George Karpenkov / ViewSVN

r301211 (#5480) (Apr 24, 2017 12:25:10 PM)

  1. X86RegisterInfo: eliminateFrameIndex: Avoid code duplication; NFC

    Re-Commit of r300922 and r300923 with less aggressive assert (see
    discussion at the end of

    X86RegisterInfo::eliminateFrameIndex() and
    X86FrameLowering::getFrameIndexReference() both had logic to compute the
    base register. This consolidates the code.

    Also use MachineInstr::isReturn instead of manually enumerating tail
    call instructions (return instructions were not included in the previous
    list because they never reference frame indexes).

    Differential Revision: — matze / ViewSVN
  2. Use DW_OP_stack_value when reconstructing variable values with arithmetic.

    When the location description of a source variable involves arithmetic
    on the value itself, it needs to be marked with DW_OP_stack_value since it
    is not describing the variable's location, but rather its value.

    This is a follow-up to r297971 and fixes the source testcase quoted in
    the comment in debuginfo-dce.ll.


    This reapplies r301093 without modifications. — Adrian Prantl / ViewSVN
  3. Add a testcase for DIExpression(DW_OP_stack_value)
    and relax the assertion that prohibited its emission.

    This fixes the assertion failure uncovered by r301093. — Adrian Prantl / ViewSVN
  4. AMDGPU: Add StackPtr and FramePtr registers to MFI

    These will be necessary for setting up call sequences. — arsenm / ViewSVN
  5. [ELF] Account for R_386_TLS_LDO_32 addend

    This relocation type has an implicit addend. Account for it when
    processing the relocation. Add an offset to an existing test to ensure
    it gets processed correctly.

    Fixes PR32634.

    Differential Revision: — smeenai / ViewSVN
  6. AMDGPU: Move trap lowering to DAG

    Fixes traps in any block besides the entry block,
    and fixes depending on a live-in physical register
    by using a virtual register copy.

    Also happens to stop emitting a nop in the case
    debug trap is not supported. — arsenm / ViewSVN
  7. [DomPrinter] Add a way to programmatically dump a dot representation.

    Differential Revision: — davide / ViewSVN
  8. [llvm-pdbdump] Merge functionality of graphical and text dumpers.

    The *real* difference between these two was that

    a) The "graphical" dumper could recurse, while the text one could
    b) The "text" dumper could display nested types and functions,
       while the graphical one could not.

    Merge these two so that there is only one dumper that can recurse
    arbitrarily deep and optionally display nested types or not. — zturner / ViewSVN
  9. [llvm-pdbdump] Re-write the record layout code to be more resilient.

    This reworks the way virtual bases are handled, and also the way
    padding is detected across multiple levels of aggregates, producing
    a much more accurate result. — zturner / ViewSVN
  10. [Docs] Correct the path to the script to include the clang-format directory. — ctopper / ViewSVN

r301201 (#5479) (Apr 24, 2017 11:27:27 AM)

  1. [APInt] Simplify the zext and sext methods

    This replaces a hand written copy loop with a call to memcpy for both zext and sext.

    For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits.

    Differential Revision: — ctopper / ViewSVN
  2. Testing commit credentials — George Karpenkov / ViewSVN
  3. InstCombine: Fix assert when reassociating fsub with undef

    There is logic to track the expected number of instructions
    produced. It thought in this case an instruction would
    be necessary to negate the result, but here it folded
    into a ConstantExpr fneg when the non-undef value operand
    was cancelled out by the second fsub.

    I'm not sure why we don't fold constant FP ops with undef currently,
    but I think that would also avoid this problem. — arsenm / ViewSVN
  4. [APInt] Add ashrInPlace method and rewrite ashr to make a copy and then call ashrInPlace.

    This patch adds an in place version of ashr to match lshr and shl which were recently added.

    I've tried to make this similar to the lshr code with additions to handle the sign extension. I've also tried to do this with less if checks than the current ashr code by sign extending the original result to a word boundary before doing any of the shifting. This removes a lot of the complexity of determining where to fill in sign bits after the shifting.

    Differential Revision: — ctopper / ViewSVN
  5. AMDGPU: Move v_readlane lane select from VGPR to SGPR

    Fix a compiler bug when the lane select happens to end up in a VGPR.

    Clarify the semantic of the corresponding intrinsic to be that of
    the corresponding GLSL: the lane select must be uniform across a
    wave front, otherwise results are undefined.

    Reviewers: arsenm

    Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

    Differential Revision: — nha / ViewSVN
  6. Compute safety information in a much finer granularity.

    Instead of keeping a variable indicating whether there are early exits
    in the loop.  We keep all the early exits. This improves LICM's ability to
    move instructions out of the loop based on is-guaranteed-to-execute.

    I am going to update compilation time as well soon.

    Reviewers: hfinkel, sanjoy, efriedma, mkuper

    Reviewed By: hfinkel

    Subscribers: llvm-commits, mzolotukhin

    Differential Revision: — trentxintong / ViewSVN
  7. InstCombine/AMDGPU: Fix constant folding of llvm.amdgcn.{icmp,fcmp}

    The return value of these intrinsics should always have 0 bits for
    inactive threads. This means that when all arguments are constant
    and the comparison evaluates to true, the intrinsic should return
    the current exec mask.

    Fixes some GL_ARB_shader_ballot tests.

    Reviewers: arsenm

    Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

    Differential Revision: — nha / ViewSVN
  8. [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.

    Summary: [GlobalISel][X86] Lower FormalArgument/Ret using G_MERGE_VALUES/G_UNMERGE_VALUES.

    Reviewers: zvi, t.p.northover, guyblank

    Reviewed By: t.p.northover

    Subscribers: dberris, rovka, llvm-commits, kristof.beyls

    Differential Revision: — ibreger / ViewSVN
  9. [DAGCombiner] Updated bswap byte offset variable names to be more descriptive. NFC

    As discussed on D32039, use MaskByteOffset to describe the variable and also pull out repeated getOpcode() calls. — rksimon / ViewSVN
  10. [APInt] Fix repeated word in comments. NFC — ctopper / ViewSVN
  11. AMDGPU: Fix crash when scheduling non-memory SMRD instructions

    Summary: Fixes piglit spec/arb_shader_clock/execution/*

    Reviewers: arsenm

    Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye

    Differential Revision: — nha / ViewSVN

r301190 (#5478) (Apr 24, 2017 10:36:30 AM)

  1. [tsan] Include __tsan_external_* API from a header file instead of declaring them manually. NFC.

    Differential Revision: — kuba.brecka / ViewSVN
  2. [tsan] Remove the extra word "object" from description of external races

    Differential Revision: — kuba.brecka / ViewSVN
  3. [clang-tidy] Some Cleanups for performance-faster-string-find check.

    NFC — hokein / ViewSVN
  4. [SDAG] Teach Chain Analysis about BaseIndexOffset addressing.

    While we use BaseIndexOffset in FindBetterNeighborChains to
    appropriately realize they're almost the same address and should be
    improved concurrently we do not use it in isAlias using the non-index
    understanding FindBaseOffset instead. Adding a BaseIndexOffset check
    in isAlias like should allow indexed stores to be merged.

    FindBaseOffset to be excised in subsequent patch.

    Reviewers: jyknight, aditya_nandakumar, bogner

    Subscribers: llvm-commits

    Differential Revision: — niravd / ViewSVN

r301186 (#5477) (Apr 24, 2017 9:14:53 AM)

  1. Update two android XFAILS

    - XFAIL on TestNoreturnUnwind on all architectures
    - TestStaticVariables fails with clang-3.8 as well — labath / ViewSVN
  2. Extend readability-container-size-empty to add comparisons to empty-state objects.

    Patch by Josh Zimmerman. — aaronballman / ViewSVN
  3. [sanitizer] Cache SizeClassForTransferBatch in the 32-bit local cache

    `SizeClassForTransferBatch` is expensive and is called for every `CreateBatch`
    and `DestroyBatch`. Caching it means `kNumClasses` calls in `InitCache`
    instead. This should be a performance gain if more than `kNumClasses / 2`
    batches are created and destroyed during the lifetime of the local cache.

    I have chosen to fully remove the function and putting the code in `InitCache`,
    which is a debatable choice.

    In single threaded benchmarks leveraging primary backed allocations, this turns
    out to be a sizeable gain in performances (greater than 5%). In multithreaded
    benchmarks leveraging everything, it is less significant but still an
    improvement (about 1%).

    Reviewers: kcc, dvyukov, alekseyshl

    Reviewed By: dvyukov

    Subscribers: kubamracek, llvm-commits

    Differential Revision: — cryptoad / ViewSVN
  4. [index] If the 'external_source_symbol' attribute indicates 'Swift' as the language then report it accordingly — akirtzidis / ViewSVN

r301182 (#5476) (Apr 24, 2017 8:23:07 AM)

  1. clang-format: Fix bad corner case in formatting of function types.


              LooooooooooooooooongType type)>

    clang-format generally avoids having lines like "SomeType>*(" as they
    lead to parameter lists that don't belong together to be aligned. However, in
    case it is better than the alternative, which can even be violating the column
    limit. — djasper / ViewSVN
  2. [X86][AVX] Add scheduling latency/throughput tests for missing AVX1 instructions

    Had to split btver2/znver1 checks as only btver2 suppresses zeroupper — rksimon / ViewSVN
  3. [index] The relation between the declarations in template specializations
    that 'override' declarations in the base template should be recorded

    This can be used for improved "go to definition" feature in Xcode.


    Differential Revision: — arphaman / ViewSVN

r301179 (#5475) (Apr 24, 2017 7:24:25 AM)

  1. Fix the new SocketAddressTest on Windows

    we need to call WSAStartup before we can use getaddrinfo. — labath / ViewSVN
  2. [Devirtualization] Emit loads with empty group md

    As discussed here
    having different groups doesn't solve the problem entirly.

    Reviewers: rjmccall, rsmith

    Subscribers: amharc, cfe-commits

    Differential Revision: — prazek / ViewSVN

r301177 (#5474) (Apr 24, 2017 6:31:23 AM)

  1. [SystemZ]  Update kill-flag in splitMove().

    EarlierMI needs to clear the kill flag on the first operand in case of a store.

    Review: Ulrich Weigand — jonpa / ViewSVN
  2. [DWARF] Move test to x86 directory — rengolin / ViewSVN
  3. [RegionInfo] Fix dangling references created by moving RegionInfo objects

    Summary: Region objects capture the address of the creating RegionInfo instance. Because the RegionInfo class is movable, moving a RegionInfo object creates dangling references. This patch fixes these references by walking the Regions post-move, and updating references to the new parent.

    Reviewers: Meinersbur, grosser

    Reviewed By: Meinersbur, grosser

    Subscribers: llvm-commits

    Differential Revision: — pfaffe / ViewSVN

r301174 (#5473) (Apr 24, 2017 5:38:04 AM)

  1. Add SUSE vendor

    Summary: SUSE's ARM triples end with -gnueabi even though they are hard-float. This requires special handling of SUSE ARM triples. Hence we need a way to differentiate the SUSE as vendor. This CL adds that.

    Reviewers: chandlerc, compnerd, echristo, rengolin

    Reviewed By: rengolin

    Subscribers: aemerson, rengolin, llvm-commits

    Differential Revision: — ismail / ViewSVN
  2. Revert [scudo] Enabling MIPS support for Scudo

    This patch broke the buildbot clang-cmake-mips. Investigating the issue. — slthakur / ViewSVN
  3. [LLDB][MIPS] Move it into HandleLLVMOptions.cmake.

    The revison will fixed the off_t for GNU specific 32 bit platform. This fixed the difference in definition of off_t in LLDB and LLVM

    Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste, zturner — nitesh.jain / ViewSVN
  4. [LLVM][MIPS] Fix different definition of off_t in LLDB and LLVM.

    Reviewers: beanz

    Subscribers: jaydeep, bhushan, lldb-commits, slthakur, llvm-commits, krytarowski, emaste

    Differential Revision: — nitesh.jain / ViewSVN
  5. [DWARF] - Take relocations in account when extracting ranges from .debug_ranges

    I found this when investigated "Bug 32319 - .gdb_index is broken/incomplete" for LLD.

    When we have object file with .debug_ranges section it may be filled with zeroes.
    Relocations are exist in file to relocate this zeroes into real values later, but until that
    a pair of zeroes is treated as terminator. And DWARF parser thinks there is no ranges at all
    when I am trying to collect address ranges for building .gdb_index.

    Solution implemented in this patch is to take relocations in account when parsing ranges.

    Differential revision: — grimar / ViewSVN
  6. Merging r296105, r296016 and 296111:

    r296105 | sdardis | 2017-02-24 10:50:27 +0000 (Fri, 24 Feb 2017) | 13 lines

    [mips][mc] Fix a crash when disassembling odd sized sections

    Make the MIPS disassembler consistent with the other targets in returning
    a Size of zero when the input buffer cannot contain an instruction due
    to it's size. Previously it reported the minimum instruction size when
    it failed due to the buffer not being big enough for an instruction
    causing llvm-objdump to crash when disassembling all sections.

    Reviewers: slthakur

    Differential Revision:

    r296106 | sdardis | 2017-02-24 10:51:27 +0000 (Fri, 24 Feb 2017) | 5 lines

    [mips][mc] Fix a crash when disassembling odd sized sections

    Corresponding test.

    r296111 | rovka | 2017-02-24 12:47:11 +0000 (Fri, 24 Feb 2017) | 1 line

    Fixup r296105 - only run tests on Mips
    ------------------------------------------------------------------------ — sdardis / ViewSVN
  7. Add more arguments to SocketAddress::GetAddressInfo

    the reason for this is two-fold:
    - getaddrinfo without the extra arguments will return the same
    (network-level) address multiple times, once for each supported
    transport protocol, which is not what is usually intended (it certainly
    wasn't in D31823)
    - it enables us to rewrite the getaddrinfo member function in terms of
    the static GetAddressInfo function.

    Reviewers: beanz, tberghammer

    Subscribers: lldb-commits

    Differential Revision: — labath / ViewSVN