1. Aug 24, 2019
  2. Aug 23, 2019
    • Erich Keane's avatar
      [NFC] Move some variable declarations into their 'if' conditions. · 23384a1c
      Erich Keane authored
      A couple of variables are being declared outside of the 'if' condition
      that is their only actual use.  Additionally, switch a few 'const TYPE
      *' to 'const auto *' for consistency.
      
      llvm-svn: 369773
      23384a1c
    • Cameron McInally's avatar
      [Reassoc] Small fix to support unary FNeg in NegateValue(...) · 688f3bc2
      Cameron McInally authored
      Differential Revision: https://reviews.llvm.org/D66612
      
      llvm-svn: 369772
      688f3bc2
    • Johannes Doerfert's avatar
      [Attributor][Fix] Deal with "growing" dereferenceability · 2f2d7c3a
      Johannes Doerfert authored
      Summary:
      If we have a negative inbounds offset dereferenceabily "grows". However,
      until we do not handle the overflow that can occur in the
      dereferenceable bytes and the problem with loops, we simply do not grow
      the state.
      
      Reviewers: sstefan1, uenoku
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66557
      
      llvm-svn: 369771
      2f2d7c3a
    • Johannes Doerfert's avatar
      [Attributor][NFCI] Avoid lookups when resolving returned values · deb9ea3a
      Johannes Doerfert authored
      If the number of potentially returned values not change since the last
      traversal we do not need to visit the returned values again. This works
      as we only add values to the returned values set now.
      
      Differential Revision: https://reviews.llvm.org/D66484
      
      llvm-svn: 369770
      deb9ea3a
    • Sanjay Patel's avatar
      [SLP] fix formatting; NFC · 91824678
      Sanjay Patel authored
      These are part of D57059, but that patch doesn't apply cleanly to trunk
      at this point, so we might as well remove some of the noise.
      
      llvm-svn: 369769
      91824678
    • Johannes Doerfert's avatar
      [Attributor] FIX: Treat new attributes as changed ones · 9543f149
      Johannes Doerfert authored
      Summary:
      When we have new attributes and we end the fixpoint iteration because
      the iteration limit is reached, we need to treat the new ones as if they
      changed in the last iteration, as they might have.
      
      This adds a test for which we should not derive anything regardless of
      the iteration limit, e.g., if we abort there should not be any
      attributes manifested in the IR.
      
      Reviewers: uenoku, sstefan1
      
      Subscribers: hiraditya, bollu, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66549
      
      llvm-svn: 369768
      9543f149
    • Johannes Doerfert's avatar
      [Attributor][NFCI] Try to avoid potential non-deterministic behavior · 695089ec
      Johannes Doerfert authored
      This commit replaces sets with set vectors in an effort to make the
      behavior of the Attributor deterministic.
      
      llvm-svn: 369767
      695089ec
    • Teresa Johnson's avatar
      [ThinLTO] Fix handling of weak interposable symbols · ea314fd4
      Teresa Johnson authored
      Summary:
      Keep aliasees alive if their alias is live, otherwise we end up with an
      alias to a declaration, which is invalid. This can happen when the
      aliasee is weak and non-prevailing.
      
      This fix exposed the fact that we were then attempting to internalize
      the weak symbol, which was not exported as it was not prevailing. We
      should not internalize interposable symbols in general, unless this is
      the prevailing copy, since it can lead to incorrect inlining and other
      optimizations. Most of the changes in this patch are due to the
      restructuring required to pass down the prevailing callback.
      
      Finally, while implementing the test cases, I found that in the case of
      a weak aliasee that is still marked not live because its alias isn't
      live, after dropping the definition we incorrectly marked the
      declaration with weak linkage when resolving prevailing symbols in the
      module. This was due to some special case handling for symbols marked
      WeakLinkage in the summary located before instead of after a subsequent
      check for the symbol being a declaration. It turns out that we don't
      actually need this special case handling any more (looking back at the
      history, when that was added the code was structured quite differently)
      - we will correctly mark with weak linkage further below when the
      definition hasn't been dropped.
      
      Fixes PR42542.
      
      Reviewers: pcc
      
      Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, dang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66264
      
      llvm-svn: 369766
      ea314fd4
    • Johannes Doerfert's avatar
      [MustExec] Add a generic "must-be-executed-context" explorer · a5b10b46
      Johannes Doerfert authored
      Given an instruction I, the MustBeExecutedContextExplorer allows to
      easily traverse instructions that are guaranteed to be executed whenever
      I is. For now, these instruction have to be statically "after" I, in
      the same or different basic blocks.
      
      This patch also adds a pass which prints the must-be-executed-context
      for each instruction in a module. It is used to test the
      MustBeExecutedContextExplorer, for now on the examples given in the
      class comment of the MustBeExecutedIterator.
      
      Differential Revision: https://reviews.llvm.org/D65186
      
      llvm-svn: 369765
      a5b10b46
    • Louis Dionne's avatar
      [libc++] Improve Python 3 compatibility for merge_archives.py · 344eee92
      Louis Dionne authored
      Popen.communicate() method in Python 2 returns a pair of strings, and in
      Python 3 it returns a pair of byte-like objects unless universal_newlines
      is set to True. This led to an error when using Python 3. With this patch,
      merge_archives.py works fine with Python 3.
      
      Thanks to Sergej Jaskiewicz for the patch.
      Differential Revision: https://reviews.llvm.org/D66649
      
      llvm-svn: 369764
      344eee92
    • Kristof Umann's avatar
      [clang-tidy] Possibility of displaying duplicate warnings · dabfea85
      Kristof Umann authored
      Summary: In case a checker is registered multiple times as an alias, the emitted warnings are uniqued by the report message. However, it is random which checker name is included in the warning. When processing the output of clang-tidy this behavior caused some problems. In this commit the uniquing key contains the checker name too.
      
      Reviewers: alexfh, xazax.hun, Szelethus, aaron.ballman, lebedev.ri, JonasToth, gribozavr
      
      Reviewed By: alexfh
      
      Subscribers: dkrupp, whisperity, rnkovacs, mgrang, cfe-commits
      
      Patch by Tibor Brunner!
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D65065
      
      llvm-svn: 369763
      dabfea85
    • Peter Smith's avatar
      [ELF] Mention contents of reproduce archive and add help description. · 7d6aa7eb
      Peter Smith authored
      Building on D60557 mention the name of the linker generated contents of
      the reproduce archive, response.txt and version.txt.
      
      Also write a shorter description in the ld.lld --help that is closer to
      the documentation.
      
      Differential Revision: https://reviews.llvm.org/D66641
      
      llvm-svn: 369762
      7d6aa7eb
    • Jordan Rupprecht's avatar
      [llvm-objcopy] Strip debug sections when running with --strip-unneeded. · 0f323439
      Jordan Rupprecht authored
      Summary:
      GNU --strip-unneeded strips debugging sections as well. Do that for llvm-objcopy as well.
      
      Additionally, add a test that verifies we keep the .gnu_debuglink section. This apparently was not always the case, and I'm not sure which commit fixed it, but there doesn't appear to be any test coverage to make sure we continue to do so.
      
      This fixes PR41043.
      
      Reviewers: jhenderson, jakehehrlich, espindola, alexshap
      
      Subscribers: emaste, arichardson, MaskRay, abrachet, seiya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66623
      
      llvm-svn: 369761
      0f323439
    • Kristof Umann's avatar
      [analyzer] Avoid unnecessary enum range check on LValueToRValue casts · 09ce8ec7
      Kristof Umann authored
      Summary: EnumCastOutOfRangeChecker should not perform enum range checks on LValueToRValue casts, since this type of cast does not actually change the underlying type.   Performing the unnecessary check actually triggered an assertion failure deeper in EnumCastOutOfRange for certain input (which is captured in the accompanying test code).
      
      Reviewers: #clang, Szelethus, gamesh411, NoQ
      
      Reviewed By: Szelethus, gamesh411, NoQ
      
      Subscribers: NoQ, gamesh411, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, bjope, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66014
      
      llvm-svn: 369760
      09ce8ec7
    • Nico Weber's avatar
      clang-format: Disable across-block include reordering. · b55dea4e
      Nico Weber authored
      Differential Revision: https://reviews.llvm.org/D66650
      
      llvm-svn: 369759
      b55dea4e
    • Nico Weber's avatar
      libcxx: Make gen_link_script.py print contents only in --dryrun mode · 01d7fe76
      Nico Weber authored
      The build should generally be quiet if there are no errors,
      and this script has been around long enough that we can remove
      the log output. If we ever need to debug something with this script,
      we can put back the logging then.
      
      Differential Revision: https://reviews.llvm.org/D66594
      
      llvm-svn: 369757
      01d7fe76
    • Simon Atanasyan's avatar
      [mips] Reduce number of instructions used for loading a global symbol's value · 5f7d6ac7
      Simon Atanasyan authored
      Now `lw/sw $reg, sym+offset` pseudo instructions for global symbol `sym`
      are lowering into the following three instructions.
      ```
      lw     $reg, %got(symbol)($gp)
      addiu  $reg, $reg, offset
      lw/sw  $reg, 0($reg)
      ```
      
      It's possible to reduce the number of instructions by taking the offset
      in account in the final `lw/sw` command. This patch implements that
      optimization.
      ```
      lw     $reg, %got(symbol)($gp)
      lw/sw  $reg, offset($reg)
      ```
      
      Differential Revision: https://reviews.llvm.org/D66553
      
      llvm-svn: 369756
      5f7d6ac7
    • Simon Atanasyan's avatar
      [mips] Do not include offset into `%got` expression for global symbols · 58492b18
      Simon Atanasyan authored
      Now pseudo instruction `la $6, symbol+8($6)` is expanding into the following
      chain of commands:
      ```
      lw    $1, %got(symbol+8)($gp)
      addiu $1, $1, 8
      addu  $6, $1, $6
      ```
      
      This is incorrect. When a linker handles the `R_MIPS_GOT16` relocation,
      it does not expect to get any addend and breaks on assertion. Otherwise
      it has to create new GOT entry for each unique "sym + offset" pair.
      Offset for a global symbol should be added to result of loading GOT
      entry by a separate `add` command.
      
      The patch fixes the problem by stripping off an offset from the expression
      passed to the `%got`. That's interesting that even current code inserts
      a separate `add` command.
      
      Differential Revision: https://reviews.llvm.org/D66552
      
      llvm-svn: 369755
      58492b18