1. Mar 01, 2017
  2. Feb 28, 2017
    • Simon Dardis's avatar
      [mips] Fix 64bit slt/sltu/nor with immediates · e3cceed3
      Simon Dardis authored
      Patch By: Alexander Richardson
      
      Reviewers: atanasyan, theraven, sdardis
      
      Differential Revision: https://reviews.llvm.org/D30330
      
      llvm-svn: 296482
      e3cceed3
    • Haojian Wu's avatar
      [clang-tidy] Fix a false positive on modernize-use-nullptr check. · b780c59b
      Haojian Wu authored
      Summary:
      The false positive happens on two neighbour CXXDefaultArgExpr AST nodes.
      like below:
      
      ```
      CXXFunctionalCastExpr 0x85c9670 <col:7, col:23> 'struct ZZ' functional cast to struct ZZ <ConstructorConversion>
       `-CXXConstructExpr 0x85c9518 <col:7, col:23> 'struct ZZ' 'void (uint64, const uint64 *)'
         |-CallExpr 0x85a0a90 <col:10, col:22> 'uint64':'unsigned long long'
         | |-ImplicitCastExpr 0x85a0a78 <col:10> 'uint64 (*)(uint64)' <FunctionToPointerDecay>
         | | `-DeclRefExpr 0x85a09f0 <col:10> 'uint64 (uint64)' lvalue Function 0x85a06a0 'Hash' 'uint64 (uint64)'
         | `-CXXDefaultArgExpr 0x85a0ac8 <<invalid sloc>> 'uint64':'unsigned long long'
         `-CXXDefaultArgExpr 0x85c94f8 <<invalid sloc>> 'const uint64 *'
      ```
      
      For each particular CXXDefaultArgExpr node, we need to reset
      FirstSubExpr, otherwise FirstSubExpr will refer to an incorrect expr.
      
      Reviewers: alexfh
      
      Reviewed By: alexfh
      
      Subscribers: JDevlieghere, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D30412
      
      llvm-svn: 296479
      b780c59b
    • Daniel Sanders's avatar
      Revert r296474 - [globalisel] Change LLT constructor string into an LLT... · 983c9b98
      Daniel Sanders authored
      Revert r296474 - [globalisel] Change LLT constructor string into an LLT subclass that knows how to generate it.
      
      There's a circular dependency that's only revealed when LLVM_ENABLE_MODULES=1.
      
      llvm-svn: 296478
      983c9b98
    • Daniel Marjamaki's avatar
      20a209e4
    • Nirav Dave's avatar
      In visitSTORE, always use FindBetterChain, rather than only when UseAA is enabled. · f830dec3
      Nirav Dave authored
          Recommiting after fixup of 32-bit aliasing sign offset bug in DAGCombiner.
      
          * Simplify Consecutive Merge Store Candidate Search
      
          Now that address aliasing is much less conservative, push through
          simplified store merging search and chain alias analysis which only
          checks for parallel stores through the chain subgraph. This is cleaner
          as the separation of non-interfering loads/stores from the
          store-merging logic.
      
          When merging stores search up the chain through a single load, and
          finds all possible stores by looking down from through a load and a
          TokenFactor to all stores visited.
      
          This improves the quality of the output SelectionDAG and the output
          Codegen (save perhaps for some ARM cases where we correctly constructs
          wider loads, but then promotes them to float operations which appear
          but requires more expensive constant generation).
      
          Some minor peephole optimizations to deal with improved SubDAG shapes (listed below)
      
          Additional Minor Changes:
      
            1. Finishes removing unused AliasLoad code
      
            2. Unifies the chain aggregation in the merged stores across code
               paths
      
            3. Re-add the Store node to the worklist after calling
               SimplifyDemandedBits.
      
            4. Increase GatherAllAliasesMaxDepth from 6 to 18. That number is
               arbitrary, but seems sufficient to not cause regressions in
               tests.
      
            5. Remove Chain dependencies of Memory operations on CopyfromReg
               nodes as these are captured by data dependence
      
            6. Forward loads-store values through tokenfactors containing
                {CopyToReg,CopyFromReg} Values.
      
            7. Peephole to convert buildvector of extract_vector_elt to
               extract_subvector if possible (see
               CodeGen/AArch64/store-merge.ll)
      
            8. Store merging for the ARM target is restricted to 32-bit as
               some in some contexts invalid 64-bit operations are being
               generated. This can be removed once appropriate checks are
               added.
      
          This finishes the change Matt Arsenault started in r246307 and
          jyknight's original patch.
      
          Many tests required some changes as memory operations are now
          reorderable, improving load-store forwarding. One test in
          particular is worth noting:
      
            CodeGen/PowerPC/ppc64-align-long-double.ll - Improved load-store
            forwarding converts a load-store pair into a parallel store and
            a memory-realized bitcast of the same value. However, because we
            lose the sharing of the explicit and implicit store values we
            must create another local store. A similar transformation
            happens before SelectionDAG as well.
      
          Reviewers: arsenm, hfinkel, tstellarAMD, jyknight, nhaehnle
      
      llvm-svn: 296476
      f830dec3
    • George Rimar's avatar
      [ELF] - Do not set flags for CopyRelSection. NFC. · 9f57a4f1
      George Rimar authored
      It does not make sense. Them added either to
      Out::BssRelRo or Out::Bss, which are always RW.
      
      llvm-svn: 296475
      9f57a4f1
    • Daniel Sanders's avatar
      [globalisel] Change LLT constructor string into an LLT subclass that knows how to generate it. · a5afdefe
      Daniel Sanders authored
      Summary:
      This will allow future patches to inspect the details of the LLT. The implementation is now split between
      the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.
      
      Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.
      
      Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar
      
      Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls
      
      Differential Revision: https://reviews.llvm.org/D30046
      
      llvm-svn: 296474
      a5afdefe
    • Diana Picus's avatar
      [ARM] GlobalISel: Lower i32 and fp call parameters on the stack · 1ffca2ae
      Diana Picus authored
      Lower i32, float and double parameters that need to live on the stack. This
      boils down to creating some G_GEPs starting from the stack pointer and storing
      the values there. During the process we also keep track of the stack size and
      use the final value in the ADJCALLSTACKDOWN/UP instructions.
      
      We currently assert for smaller types, since they usually require extensions.
      They will be handled in a separate patch.
      
      llvm-svn: 296473
      1ffca2ae
    • Alexander Kornienko's avatar
      Misspelled checker description (argument comment) · 6414ab72
      Alexander Kornienko authored
      Reviewers: alexfh
      
      Reviewed By: alexfh
      
      Subscribers: Eugene.Zelenko
      
      Tags: #clang-tools-extra
      
      Patch by Peter Szecsi!
      
      Differential Revision: https://reviews.llvm.org/D24137
      
      llvm-svn: 296472
      6414ab72
    • Diana Picus's avatar
      [ARM] GlobalISel: Select 32-bit G_CONSTANT · 5a7203a0
      Diana Picus authored
      Put it into a register by means of a MOVi.
      
      llvm-svn: 296471
      5a7203a0
    • Pavel Labath's avatar
      Switch SBWatchpoint to use a weak_ptr to the underlying object · 7a1d34be
      Pavel Labath authored
      llvm-svn: 296470
      7a1d34be
    • Diana Picus's avatar
      [ARM] GlobalISel: Add mapping for G_CONSTANT · 5b851455
      Diana Picus authored
      Like G_FRAME_INDEX, G_CONSTANT has one register operand and one non-register
      operand.
      
      llvm-svn: 296469
      5b851455
    • Diana Picus's avatar
      [ARM] GlobalISel: Legalize 32-bit constants · e6beac67
      Diana Picus authored
      llvm-svn: 296468
      e6beac67
    • Martin Probst's avatar
      Blacklist arbitrary @\\w+ JSDoc tags from wrapping. · bb46a7dd
      Martin Probst authored
      Summary:
      Also limits the blacklisting to only apply when the tag is actually
      followed by a parameter in curly braces.
      
          /** @mods {long.type.must.not.wrap} */
      
      vs
      
          /** @const this is a long description that may wrap. */
      
      Reviewers: djasper
      
      Subscribers: klimek, krasimir, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D30452
      
      llvm-svn: 296467
      bb46a7dd
    • George Rimar's avatar
      [ELF] - Remove ElfSym::EhdrStart member. NFC. · 6159f129
      George Rimar authored
      We do not use it later, so don't have to store.
      
      llvm-svn: 296466
      6159f129
    • Sanne Wouda's avatar
      [Assembler] Add test for !srcloc references in assembler diags · 98f02750
      Sanne Wouda authored
      Summary:
      clang adds !srcloc metadata to inline assembly in LLVM bitcode generated
      for inline assembly in C.  The value of this !srcloc is passed to the
      diagnostics handler if the inline assembly generates a diagnostic.
      clang is able to turn this cookie back to a location in the C source
      file.
      
      To test this functionality without a dependency, make llc print the
      !srcloc metadata if it is present.  The added test uses this mechanism
      to test that the correct !srclocs are passed to the diag handler.
      
      Reviewers: rengolin, rnk, echristo, grosbach, mehdi_amini
      
      Reviewed By: mehdi_amini
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30167
      
      llvm-svn: 296465
      98f02750
    • NAKAMURA Takumi's avatar
      Reformat a blank line. · 4fb6748c
      NAKAMURA Takumi authored
      llvm-svn: 296464
      4fb6748c
    • NAKAMURA Takumi's avatar
      Revert r296442 (and r296443), "Allow externally dlopen-ed libraries to be... · 3d369cba
      NAKAMURA Takumi authored
      Revert r296442 (and r296443), "Allow externally dlopen-ed libraries to be registered as permanent libraries."
      
      It broke clang/test/Analysis/checker-plugins.c
      
      llvm-svn: 296463
      3d369cba
    • Diana Picus's avatar
      [ARM] GlobalISel: Select G_GEP · 9d070949
      Diana Picus authored
      At this point, G_GEP is just an add, so we treat it exactly like a G_ADD.
      
      llvm-svn: 296462
      9d070949
    • Haojian Wu's avatar
    • NAKAMURA Takumi's avatar
      clang/test/Format/inplace.cpp: Avoid using wildcard. · d6fc6730
      NAKAMURA Takumi authored
      MSYS' tools don't do globbing.
      
      llvm-svn: 296460
      d6fc6730
    • Oliver Stannard's avatar
      [ARM] Diagnose PC-writing instructions in IT blocks · 85d4d5b4
      Oliver Stannard authored
      In Thumb2, instructions which write to the PC are UNPREDICTABLE if they are in
      an IT block but not the last instruction in the block.
      
      Previously, we only diagnosed this for LDM instructions, this patch extends the
      diagnostic to cover all of the relevant instructions.
      
      Differential Revision: https://reviews.llvm.org/D30398
      
      llvm-svn: 296459
      85d4d5b4
    • Eric Liu's avatar
      [change-namespace] trying to fix windows buildbot failure. · 3a7e1314
      Eric Liu authored
      llvm-svn: 296458
      3a7e1314
    • George Rimar's avatar
      [ELF] - Fix confusing gc-debuginfo-tls.s testcase. NFC. · 8732e6a5
      George Rimar authored
      It checked name from one symbol and other 
      data from another before.
      
      llvm-svn: 296457
      8732e6a5
    • Tobias Grosser's avatar
      [ScopInfo] Simplify inbounds assumptions under domain constraints · d7c49753
      Tobias Grosser authored
      Without this simplification for a loop nest:
      
        void foo(long n1_a, long n1_b, long n1_c, long n1_d,
                 long p1_b, long p1_c, long p1_d,
                 float A_1[][p1_b][p1_c][p1_d]) {
          for (long i = 0; i < n1_a; i++)
            for (long j = 0; j < n1_b; j++)
              for (long k = 0; k < n1_c; k++)
                for (long l = 0; l < n1_d; l++)
                  A_1[i][j][k][l] += i + j + k + l;
       }
      
      the assumption:
      
        n1_a <= 0 or (n1_a > 0 and n1_b <= 0) or
        (n1_a > 0 and n1_b > 0 and n1_c <= 0) or
        (n1_a > 0 and n1_b > 0 and n1_c > 0 and n1_d <= 0) or
        (n1_a > 0 and n1_b > 0 and n1_c > 0 and n1_d > 0 and
         p1_b >= n1_b and p1_c >= n1_c and p1_d >= n1_d)
      
      is taken rather than the simpler assumption:
      
        p9_b >= n9_b and p9_c >= n9_c and p9_d >= n9_d.
      
      The former is less strict, as it allows arbitrary values of p1_* in case, the
      loop is not executed at all. However, in practice these precise constraints
      explode when combined across different accesses and loops. For now it seems
      to make more sense to take less precise, but more scalable constraints by
      default. In case we find a practical example where more precise constraints
      are needed, we can think about allowing such precise constraints in specific
      situations where they help.
      
      This change speeds up the new test case from taking very long (waited at least
      a minute, but it probably takes a lot more) to below a second.
      
      llvm-svn: 296456
      d7c49753
    • Diana Picus's avatar
      [ARM] GlobalISel: Add reg bank mapping for G_GEP · 566a15d7
      Diana Picus authored
      This should be the same as the mapping for G_ADD etc.
      
      llvm-svn: 296455
      566a15d7
    • Christof Douma's avatar
      [ARM] Don't pass -arm-execute-only to cc1as · 8723946e
      Christof Douma authored
      The option -mexecute-only is translated into the backend option
      -arm-execute-only. But this option only makes sense for the compiler and
      the assembler does not recognize it. This patch stops clang from passing
      this option to the assembler.
      
      Change-Id: I4f4cb1162c13cfd50a0a36702a4ecab1bc0324ba
      Review: https://reviews.llvm.org/D30414
      llvm-svn: 296454
      8723946e
    • Haojian Wu's avatar
      [clang-format] Fix test failure caused by "rm" on some buildbots. · 44038f17
      Haojian Wu authored
      The begining command "rm" will return 1 when there is not such file to
      delete.
      
      This patch is to remove it, as it's not needed for the test.
      
      llvm-svn: 296453
      44038f17
    • Diana Picus's avatar
      [ARM] GlobalISel: Legalize G_GEP with 32-bit offsets · 8598b170
      Diana Picus authored
      At the moment we're only interested in GEPs for putting call parameters on the
      stack, so we'll stick to 32-bit offsets.
      
      llvm-svn: 296452
      8598b170
    • Sean Silva's avatar
      Comment on the typical/simple case of VA calculation · 6ab3926e
      Sean Silva authored
      There are many special cases and a layer of abstraction or two in the
      way, but the VA calculation in the typical case is actually very simple
      and probably makes perfect sense even to somebody new to linkers.
      
      Also, this line brings together many components and is a good place to
      start understanding the linker (or improve one's existing
      understanding).
      
      llvm-svn: 296451
      6ab3926e
    • Artyom Skrobov's avatar
      24a593fd
    • Dean Michael Berris's avatar
      [XRay] [compiler-rt] [NFC] Annotate unused variables for the compiler. · fbe64b65
      Dean Michael Berris authored
      Summary:
      Use a common definition of a "this variable is unused" annotation for useless
      variables only present for their lambda global initializers, to silence gcc's
      warning.
      
      Reviewers: dberris
      
      Reviewed By: dberris
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D29860
      
      llvm-svn: 296449
      fbe64b65
    • Sean Silva's avatar
      Add a comment. · a9ba450c
      Sean Silva authored
      Naively it seemed at first like getVA had the responsibility of adding
      the addend, and getSymVA had the responsibility of getting the symbol
      VA.
      So it was not obvious to me at first why getVA passes Addend to
      getSymVA. In fact, it passes it as a mutable reference.
      
      It turns out that it only matters for SHF_MERGE sections, and in
      particular only for STT_SECTION symbols that are used as a hack for
      reducing the number of local symbols (e.g. to avoid a local symbol for
      each string in the string table).
      
      llvm-svn: 296448
      a9ba450c
    • Vadzim Dambrouski's avatar
      Test commit, fix typo, NFC. · cc33fc87
      Vadzim Dambrouski authored
      llvm-svn: 296447
      cc33fc87
    • Sam McCall's avatar
      [include-fixer] Add usage count to find-all-symbols. · b27dc224
      Sam McCall authored
      Summary:
      Add usage count to find-all-symbols.
      
      FindAllSymbols now finds (most!) main-file usages of the discovered symbols.
      The per-TU map output has NumUses=0 or 1 (only one use per file is counted).
      The reducer aggregates these to find the number of files that use a symbol.
      
      The NumOccurrences is now set to 1 in the mapper rather than being inferred by
      the reducer, for consistency.
      
      The idea here is to use NumUses for ranking: intuitively number of files that
      use a symbol is more meaningful than number of files that include the header.
      
      Reviewers: hokein, bkramer
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D30210
      
      llvm-svn: 296446
      b27dc224
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Switch default XRay 'patch_premain' to false · 427215ce
      Dean Michael Berris authored
      Summary:
      Currently, we assume that applications built with XRay would like to
      have the instrumentation sleds patched before main starts. This patch
      changes the default so that we do not patch the instrumentation sleds
      before main. This default is more helpful for deploying applications in
      environments where changing the current default is harder (i.e. on
      remote machines, or work-pool-like systems).
      
      This default (not to patch pre-main) makes it easier to selectively run
      applications with XRay instrumentation enabled, than with the current
      state.
      
      Reviewers: echristo, timshen
      
      Subscribers: mehdi_amini, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D30396
      
      llvm-svn: 296445
      427215ce