1. Aug 20, 2017
  2. Aug 19, 2017
    • Jatin Bhateja's avatar
      Extension of shuffle vector pattern detection, updating post rebase. · 313f97dd
      Jatin Bhateja authored
      llvm-svn: 311242
      313f97dd
    • Johannes Altmanninger's avatar
      [clang-diff] Add HTML side-by-side diff output · a29d6aec
      Johannes Altmanninger authored
      Reviewers: arphaman
      
      Subscribers: mgorny
      
      Differential Revision: https://reviews.llvm.org/D36182
      
      llvm-svn: 311241
      a29d6aec
    • Johannes Altmanninger's avatar
      [clang-diff] Fix warning about useless comparison · 14be1839
      Johannes Altmanninger authored
      llvm-svn: 311240
      14be1839
    • Tobias Grosser's avatar
      [GPGPU] Collect parameter dimension used in MemoryAccesses · 43df2020
      Tobias Grosser authored
      When using -polly-ignore-integer-wrapping and -polly-acc-codegen-managed-memory
      we add parameter dimensions lazily to the domains, which results in PPCG not
      including parameter dimensions that are only used in memory accesses in the
      kernel space. To make sure these parameters are still passed to the kernel, we
      collect these parameter dimensions and align the kernel's parameter space
      before code-generating it.
      
      llvm-svn: 311239
      43df2020
    • Victor Leschuk's avatar
      revert failing test · ee7d232a
      Victor Leschuk authored
      llvm-svn: 311238
      ee7d232a
    • Johannes Altmanninger's avatar
      [clang-diff] Make printing of matches optional · 683876ca
      Johannes Altmanninger authored
      Reviewers: arphaman
      
      Subscribers: klimek
      
      Differential Revision: https://reviews.llvm.org/D36181
      
      llvm-svn: 311237
      683876ca
    • Victor Leschuk's avatar
      Add temporary test to verify that win10 builder hangs on error · ba0954c4
      Victor Leschuk authored
      llvm-svn: 311236
      ba0954c4
    • Peter Szecsi's avatar
      [CFG] Add LoopExit information to CFG · 999a25ff
      Peter Szecsi authored
      This patch introduces a new CFG element CFGLoopExit that indicate when a loop
      ends. It does not deal with returnStmts yet (left it as a TODO).
      It hidden behind a new analyzer-config flag called cfg-loopexit (false by
      default).
      Test cases added.
      
      The main purpose of this patch right know is to make loop unrolling and loop
      widening easier and more efficient. However, this information can be useful for
      future improvements in the StaticAnalyzer core too.
      
      Differential Revision: https://reviews.llvm.org/D35668
      
      llvm-svn: 311235
      999a25ff
    • Peter Szecsi's avatar
      [StaticAnalyzer] LoopUnrolling: Exclude cases where the counter is escaped before the loop · 8de103f2
      Peter Szecsi authored
      Adding escape check for the counter variable of the loop.
      It is achieved by jumping back on the ExplodedGraph to its declStmt.
      
      Differential Revision: https://reviews.llvm.org/D35657
      
      llvm-svn: 311234
      8de103f2
    • Johannes Altmanninger's avatar
      [clang-diff] Fix test · c58ac104
      Johannes Altmanninger authored
      llvm-svn: 311233
      c58ac104
    • Johannes Altmanninger's avatar
      [clang-diff] Add option to dump the AST, one node per line · a1d2b5d5
      Johannes Altmanninger authored
      Summary:
      This is done with -ast-dump; the JSON variant has been renamed to
      -ast-dump-json.
      
      Reviewers: arphaman
      
      Differential Revision: https://reviews.llvm.org/D36180
      
      llvm-svn: 311232
      a1d2b5d5
    • Tobias Grosser's avatar
      [Polly] Run early cse + memory SSA to remove redundancies in the input code · d5f1fad7
      Tobias Grosser authored
      This allows us to get rid of many identical loads as they commonly appear in
      Fortran code.
      
      llvm-svn: 311231
      d5f1fad7
    • Victor Leschuk's avatar
      Temporary mark lit :: shtest-format as unsupported on windows · 59dc64f3
      Victor Leschuk authored
      When run manually it fails, but when run under buildbot it causes hang.
      
      llvm-svn: 311230
      59dc64f3
    • Chandler Carruth's avatar
      [Inliner] Fix a nasty bug when inlining a non-recursive trace of · 4f3aa29a
      Chandler Carruth authored
      a function into itself.
      
      We tried to fix this before in r306495 but that got reverted as the
      assert was actually hit.
      
      This fixes the original bug (which we seem to have lost track of with
      the revert) by blocking a second remapping when the function being
      inlined is also the caller and the remapping could succeed but
      erroneously.
      
      The included test case would actually load from an inlined copy of the
      alloca before this change, failing to load the stored value and
      miscompiling.
      
      Many thanks to Richard Smith for diagnosing a user miscompile to this
      bug, and to Kyle for the first attempt and initial analysis and David Li
      for remembering the issue and how to fix it and suggesting the patch.
      I'm just stitching it together and landing it. =]
      
      llvm-svn: 311229
      4f3aa29a
    • Chandler Carruth's avatar
      [Inliner] Clean up a test case a bit to make it more clear what is being · 2a80fddf
      Chandler Carruth authored
      tested and why.
      
      llvm-svn: 311228
      2a80fddf
    • Chandler Carruth's avatar
      [SLP] Fix an unused variable warning in non-asserts builds. · 1f821259
      Chandler Carruth authored
      llvm-svn: 311227
      1f821259
    • Chandler Carruth's avatar
      [x86] Teach the cmov converter to aggressively convert cmovs with memory · 93a64552
      Chandler Carruth authored
      operands into control flow.
      
      We have seen periodically performance problems with cmov where one
      operand comes from memory. On modern x86 processors with strong branch
      predictors and speculative execution, this tends to be much better done
      with a branch than cmov. We routinely see cmov stalling while the load
      is completed rather than continuing, and if there are subsequent
      branches, they cannot be speculated in turn.
      
      Also, in many (even simple) cases, macro fusion causes the control flow
      version to be fewer uops.
      
      Consider the IACA output for the initial sequence of code in a very hot
      function in one of our internal benchmarks that motivates this, and notice the
      micro-op reduction provided.
      Before, SNB:
      ```
      Throughput Analysis Report
      --------------------------
      Block Throughput: 2.20 Cycles       Throughput Bottleneck: Port1
      
      | Num Of |              Ports pressure in cycles               |    |
      |  Uops  |  0  - DV  |  1  |  2  -  D  |  3  -  D  |  4  |  5  |    |
      ---------------------------------------------------------------------
      |   1    |           | 1.0 |           |           |     |     | CP | mov rcx, rdi
      |   0*   |           |     |           |           |     |     |    | xor edi, edi
      |   2^   | 0.1       | 0.6 | 0.5   0.5 | 0.5   0.5 |     | 0.4 | CP | cmp byte ptr [rsi+0xf], 0xf
      |   1    |           |     | 0.5   0.5 | 0.5   0.5 |     |     |    | mov rax, qword ptr [rsi]
      |   3    | 1.8       | 0.6 |           |           |     | 0.6 | CP | cmovbe rax, rdi
      |   2^   |           |     | 0.5   0.5 | 0.5   0.5 |     | 1.0 |    | cmp byte ptr [rcx+0xf], 0x10
      |   0F   |           |     |           |           |     |     |    | jb 0xf
      Total Num Of Uops: 9
      ```
      After, SNB:
      ```
      Throughput Analysis Report
      --------------------------
      Block Throughput: 2.00 Cycles       Throughput Bottleneck: Port5
      
      | Num Of |              Ports pressure in cycles               |    |
      |  Uops  |  0  - DV  |  1  |  2  -  D  |  3  -  D  |  4  |  5  |    |
      ---------------------------------------------------------------------
      |   1    | 0.5       | 0.5 |           |           |     |     |    | mov rax, rdi
      |   0*   |           |     |           |           |     |     |    | xor edi, edi
      |   2^   | 0.5       | 0.5 | 1.0   1.0 |           |     |     |    | cmp byte ptr [rsi+0xf], 0xf
      |   1    | 0.5       | 0.5 |           |           |     |     |    | mov ecx, 0x0
      |   1    |           |     |           |           |     | 1.0 | CP | jnbe 0x39
      |   2^   |           |     |           | 1.0   1.0 |     | 1.0 | CP | cmp byte ptr [rax+0xf], 0x10
      |   0F   |           |     |           |           |     |     |    | jnb 0x3c
      Total Num Of Uops: 7
      ```
      The difference even manifests in a throughput cycle rate difference on Haswell.
      Before, HSW:
      ```
      Throughput Analysis Report
      --------------------------
      Block Throughput: 2.00 Cycles       Throughput Bottleneck: FrontEnd
      
      | Num Of |                    Ports pressure in cycles                     |    |
      |  Uops  |  0  - DV  |  1  |  2  -  D  |  3  -  D  |  4  |  5  |  6  |  7  |    |
      ---------------------------------------------------------------------------------
      |   0*   |           |     |           |           |     |     |     |     |    | mov rcx, rdi
      |   0*   |           |     |           |           |     |     |     |     |    | xor edi, edi
      |   2^   |           |     | 0.5   0.5 | 0.5   0.5 |     | 1.0 |     |     |    | cmp byte ptr [rsi+0xf], 0xf
      |   1    |           |     | 0.5   0.5 | 0.5   0.5 |     |     |     |     |    | mov rax, qword ptr [rsi]
      |   3    | 1.0       | 1.0 |           |           |     |     | 1.0 |     |    | cmovbe rax, rdi
      |   2^   | 0.5       |     | 0.5   0.5 | 0.5   0.5 |     |     | 0.5 |     |    | cmp byte ptr [rcx+0xf], 0x10
      |   0F   |           |     |           |           |     |     |     |     |    | jb 0xf
      Total Num Of Uops: 8
      ```
      After, HSW:
      ```
      Throughput Analysis Report
      --------------------------
      Block Throughput: 1.50 Cycles       Throughput Bottleneck: FrontEnd
      
      | Num Of |                    Ports pressure in cycles                     |    |
      |  Uops  |  0  - DV  |  1  |  2  -  D  |  3  -  D  |  4  |  5  |  6  |  7  |    |
      ---------------------------------------------------------------------------------
      |   0*   |           |     |           |           |     |     |     |     |    | mov rax, rdi
      |   0*   |           |     |           |           |     |     |     |     |    | xor edi, edi
      |   2^   |           |     | 1.0   1.0 |           |     | 1.0 |     |     |    | cmp byte ptr [rsi+0xf], 0xf
      |   1    |           | 1.0 |           |           |     |     |     |     |    | mov ecx, 0x0
      |   1    |           |     |           |           |     |     | 1.0 |     |    | jnbe 0x39
      |   2^   | 1.0       |     |           | 1.0   1.0 |     |     |     |     |    | cmp byte ptr [rax+0xf], 0x10
      |   0F   |           |     |           |           |     |     |     |     |    | jnb 0x3c
      Total Num Of Uops: 6
      ```
      
      Note that this cannot be usefully restricted to inner loops. Much of the
      hot code we see hitting this is not in an inner loop or not in a loop at
      all. The optimization still remains effective and indeed critical for
      some of our code.
      
      I have run a suite of internal benchmarks with this change. I saw a few
      very significant improvements and a very few minor regressions,
      but overall this change rarely has a significant effect. However, the
      improvements were very significant, and in quite important routines
      responsible for a great deal of our C++ CPU cycles. The gains pretty
      clealy outweigh the regressions for us.
      
      I also ran the test-suite and SPEC2006. Only 11 binaries changed at all
      and none of them showed any regressions.
      
      Amjad Aboud at Intel also ran this over their benchmarks and saw no
      regressions.
      
      Differential Revision: https://reviews.llvm.org/D36858
      
      llvm-svn: 311226
      93a64552
    • Chandler Carruth's avatar
      [x86] Refactor the CMOV conversion pass to be more flexible. · e3b3547e
      Chandler Carruth authored
      The primary thing that this accomplishes is to allow future re-use of
      these routines in more contexts and clarify the behavior w.r.t. loops.
      For example, if handling outer loops is desirable, doing so in
      a inside-out order becomes straight forward because it walks the loop
      nest itself (rather than walking the function's basic blocks) and
      de-couples the CMOV rewriting from the loop structure as there isn't
      actually anything loop-specific about this transformation.
      
      This patch should be essentially a no-op. It potentially changes the
      order in which we visit the inner loops, but otherwise should merely set
      the stage for subsequent changes.
      
      Differential Revision: https://reviews.llvm.org/D36783
      
      llvm-svn: 311225
      e3b3547e
    • Faisal Vali's avatar
      [c++2a] Implement P0409R2 - Allow lambda capture [=,this] (by hamzasood) · 8194a3e9
      Faisal Vali authored
      This patch, by hamzasood, implements P0409R2, and allows [=, this] pre-C++2a as an extension (with appropriate warnings) for consistency.
      
      https://reviews.llvm.org/D36572
      
      Thanks Hamza!
      
      llvm-svn: 311224
      8194a3e9
    • Dinar Temirbulatov's avatar
      [SLPVectorizer] Tighten up VLeft, VRight declaration, remove unnecessary... · 7aff8cfa
      Dinar Temirbulatov authored
      [SLPVectorizer] Tighten up VLeft, VRight declaration, remove unnecessary testcase test/Transforms/SLPVectorizer/X86/reorder.ll, NFCI.
      
      llvm-svn: 311223
      7aff8cfa
    • Johannes Altmanninger's avatar
      Revert "Revert "[clang-diff] Move printing of matches and changes to clang-diff"" · e0fe5cd4
      Johannes Altmanninger authored
      Fix build by renaming ChangeKind -> Change
      
      This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce.
      
      llvm-svn: 311222
      e0fe5cd4
    • Dinar Temirbulatov's avatar
      [SLPVectorizer] Add opcode parameter to reorderAltShuffleOperands,... · e3ce1b45
      Dinar Temirbulatov authored
      [SLPVectorizer] Add opcode parameter to reorderAltShuffleOperands, reorderInputsAccordingToOpcode functions.
      
      Reviewers: mkuper, RKSimon, ABataev, mzolotukhin, spatel, filcab
      
      Subscribers: llvm-commits, rengolin
      
      Differential Revision: https://reviews.llvm.org/D36766
      
      llvm-svn: 311221
      e3ce1b45