1. Feb 25, 2017
    • Rui Ueyama's avatar
      Mention FreeBSD ports status and wordsmithing. · bb361fcb
      Rui Ueyama authored
      Differential Revision: https://reviews.llvm.org/D30321
      
      llvm-svn: 296157
      bb361fcb
    • Rui Ueyama's avatar
      Fix errors in the benchmark result. · 0122142c
      Rui Ueyama authored
      I was mixing 1000 and 1024 when calculating file sizes in MiB or
      in GiB.
      
      llvm-svn: 296155
      0122142c
    • Davide Italiano's avatar
      [Target/MIPS] Kill dead code, no functional change intended. · 74f27b80
      Davide Italiano authored
      Hopefully placates gcc with -Werror.
      
      llvm-svn: 296153
      74f27b80
    • Michael Kuperstein's avatar
      [CGP] Split some critical edges coming out of indirect branches · 46b131e3
      Michael Kuperstein authored
      Splitting critical edges when one of the source edges is an indirectbr
      is hard in general (because it requires changing the memory the indirectbr
      reads). But if a block only has a single indirectbr predecessor (which is
      the common case), we can simulate splitting that edge by splitting
      the destination block, and retargeting the *direct* branches.
      
      This is motivated by the use of computed gotos in python 2.7: PyEval_EvalFrame()
      ends up using an indirect branch with ~100 successors, and passing a constant to
      each of those. Since MachineSink can't break indirect critical edges on demand
      (and doing this in MIR doesn't look feasible), this causes us to emit about ~100
      defs of registers containing constants, which we in the predecessor block, where
      only one of those constants is used in each successor. So, at each computed goto,
      we needlessly spill about a 100 constants to stack. The end result is that a
      clang-compiled python interpreter can be about ~2.5x slower on a simple python
      reduction loop than a gcc-compiled interpreter.
      
      Differential Revision: https://reviews.llvm.org/D29916
      
      llvm-svn: 296149
      46b131e3
    • Simon Pilgrim's avatar
      Revert: r296141 [APInt] Add APInt::extractBits() method to extract APInt subrange · cdf2bd65
      Simon Pilgrim authored
      The current pattern for extract bits in range is typically:
      
      Mask.lshr(BitOffset).trunc(SubSizeInBits);
      
      Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.
      
      This is another of the compile time issues identified in PR32037 (see also D30265).
      
      This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.
      
      Differential Revision: https://reviews.llvm.org/D30336
      
      llvm-svn: 296147
      cdf2bd65
    • Ranjeet Singh's avatar
      [libcxxabi] Fix condition typo in rL296136 · b0784392
      Ranjeet Singh authored
      Made a mistake in the condition typo because LIBCXXABI_BAREMETAL is always
      defined, I should have been checking the contents to see if it's enabled.
      
      Differential Revision: https://reviews.llvm.org/D30343
      
      llvm-svn: 296146
      b0784392
    • Matthew Simpson's avatar
      [LV] Merge floating-point and integer induction widening code · bdc9c788
      Matthew Simpson authored
      This patch merges the existing floating-point induction variable widening code
      into the integer induction variable widening code, creating a single set of
      functions for both kinds of inductions. The primary motivation for doing this
      is to enable vector phi node creation for floating-point induction variables.
      
      Differential Revision: https://reviews.llvm.org/D30211
      
      llvm-svn: 296145
      bdc9c788
    • Nemanja Ivanovic's avatar
      [PowerPC] Use subfic instruction for subtract from immediate · 195c5452
      Nemanja Ivanovic authored
      Provide a 64-bit pattern to use SUBFIC for subtracting from a 16-bit immediate.
      The corresponding pattern already exists for 32-bit integers.
      
      Committing on behalf of Hiroshi Inoue.
      
      Differential Revision: https://reviews.llvm.org/D29387
      
      llvm-svn: 296144
      195c5452
    • Nemanja Ivanovic's avatar
      [PowerPC] Use rldicr instruction for AND with an immediate if possible · 82d53ed4
      Nemanja Ivanovic authored
      Emit clrrdi (extended mnemonic for rldicr) for AND-ing with masks that
      clear bits from the right hand size.
      
      Committing on behalf of Hiroshi Inoue.
      
      Differential Revision: https://reviews.llvm.org/D29388
      
      llvm-svn: 296143
      82d53ed4
    • Simon Pilgrim's avatar
      [APInt] Add APInt::extractBits() method to extract APInt subrange · bd9fb2ae
      Simon Pilgrim authored
      The current pattern for extract bits in range is typically:
      
      Mask.lshr(BitOffset).trunc(SubSizeInBits);
      
      Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.
      
      This is another of the compile time issues identified in PR32037 (see also D30265).
      
      This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.
      
      Differential Revision: https://reviews.llvm.org/D30336
      
      llvm-svn: 296141
      bd9fb2ae
    • Alex Lorenz's avatar
      [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma · 24a1bedf
      Alex Lorenz authored
      in macro argument pre-expansion mode when skipping a function body
      
      This commit fixes a token caching problem that currently occurs when clang is
      skipping a function body (e.g. when looking for a code completion token) and at
      the same time caching the tokens for _Pragma when lexing it in macro argument
      pre-expansion mode.
      
      When _Pragma is being lexed in macro argument pre-expansion mode, it caches the
      tokens so that it can avoid interpreting the pragma immediately (as the macro
      argument may not be used in the macro body), and then either backtracks over or
      commits these tokens. The problem is that, when we're backtracking/committing in
      such a scenario, there's already a previous backtracking position stored in
      BacktrackPositions (as we're skipping the function body), and this leads to a
      situation where the cached tokens from the pragma (like '(' 'string_literal'
      and ')') will remain in the cached tokens array incorrectly even after they're
      consumed (in the case of backtracking) or just ignored (in the case when they're
      committed). Furthermore, what makes it even worse, is that because of a previous
      backtracking position, the logic that deals with when should we call
      ExitCachingLexMode in CachingLex no longer works for us in this situation, and
      more tokens in the macro argument get cached, to the point where the EOF token
      that corresponds to the macro argument EOF is cached. This problem leads to all
      sorts of issues in code completion mode, where incorrect errors get presented
      and code completion completely fails to produce completion results.
      
      rdar://28523863
      
      Differential Revision: https://reviews.llvm.org/D28772
      
      llvm-svn: 296140
      24a1bedf
    • Simon Pilgrim's avatar
      Fixed IntOperandMatcher::emitCxxPredicateExpr arguments · d030291d
      Simon Pilgrim authored
      Extra const in the StringRef argument meant that MSVC complained about it not correctly overriding from OperandPredicateMatcher::emitCxxPredicateExpr (which didn't have the const)
      
      llvm-svn: 296138
      d030291d
    • Sanjay Patel's avatar
      [DAGCombiner] add missing folds for scalar select of {-1,0,1} · 832b1622
      Sanjay Patel authored
      The motivation for filling out these select-of-constants cases goes back to D24480, 
      where we discussed removing an IR fold from add(zext) --> select. And that goes back to:
      https://reviews.llvm.org/rL75531
      https://reviews.llvm.org/rL159230
      
      The idea is that we should always canonicalize patterns like this to a select-of-constants 
      in IR because that's the smallest IR and the best for value tracking. Note that we currently 
      do the opposite in some cases (like the cases in *this* patch). Ie, the proposed folds in 
      this patch already exist in InstCombine today:
      https://github.com/llvm-mirror/llvm/blob/master/lib/Transforms/InstCombine/InstCombineSelect.cpp#L1151
      
      As this patch shows, most targets generate better machine code for simple ext/add/not ops 
      rather than a select of constants. So the follow-up steps to make this less of a patchwork 
      of special-case folds and missing IR canonicalization:
      
      1. Have DAGCombiner convert any select of constants into ext/add/not ops.
      2  Have InstCombine canonicalize in the other direction (create more selects).
      
      Differential Revision: https://reviews.llvm.org/D30180
      
      llvm-svn: 296137
      832b1622
    • Ranjeet Singh's avatar
      [libcxxabi] Disable calls to fprintf for baremetal targets. · 4987856f
      Ranjeet Singh authored
      We've been having issues with using libcxxabi and libunwind for baremetal
      targets because fprintf is dependent on io functions, this patch disables calls
      to fprintf when building for baremetal in release mode.
      
      Differential Revision: https://reviews.llvm.org/D30339
      
      llvm-svn: 296136
      4987856f
    • Ranjeet Singh's avatar
      [libunwind] Disable calls to fprintf for baremetal targets. · 744dabcd
      Ranjeet Singh authored
      We've been having issues with using libcxxabi and libunwind for baremetal
      targets because fprintf is dependent on io functions, this patch disables calls
      to fprintf when building for baremetal in release mode.
      
      Differential Revision: https://reviews.llvm.org/D30340
      
      llvm-svn: 296135
      744dabcd
    • Simon Dardis's avatar
      Recommit "[mips] Fix atomic compare and swap at O0." · ae6f2bcb
      Simon Dardis authored
      This time with the missing files.
      
      Similar to PR/25526, fast-regalloc introduces spills at the end of basic
      blocks. When this occurs in between an ll and sc, the store can cause the
      atomic sequence to fail.
      
      This patch fixes the issue by introducing more pseudos to represent atomic
      operations and moving their lowering to after the expansion of postRA
      pseudos.
      
      This resolves PR/32020.
      
      Thanks to James Cowgill for reporting the issue!
      
      Reviewers: slthakur
      
      Differential Revision: https://reviews.llvm.org/D30257
      
      llvm-svn: 296134
      ae6f2bcb
    • Simon Dardis's avatar
      Revert "[mips] Fix atomic compare and swap at O0." · 3c58c18f
      Simon Dardis authored
      This reverts r296132. I forgot to include the tests.
      
      llvm-svn: 296133
      3c58c18f
    • Simon Dardis's avatar
      [mips] Fix atomic compare and swap at O0. · cf0e06d3
      Simon Dardis authored
      Similar to PR/25526, fast-regalloc introduces spills at the end of basic
      blocks. When this occurs in between an ll and sc, the store can cause the
      atomic sequence to fail.
      
      This patch fixes the issue by introducing more pseudos to represent atomic
      operations and moving their lowering to after the expansion of postRA
      pseudos.
      
      This resolves PR/32020.
      
      Thanks to James Cowgill for reporting the issue!
      
      Reviewers: slthakur
      
      Differential Revision: https://reviews.llvm.org/D30257
      
      llvm-svn: 296132
      cf0e06d3
  2. Feb 24, 2017