1. Sep 11, 2017
    • Gadi Haber's avatar
      [X86][SKX][KNL] Updating several CodeGen tests to use the attr flag instead of mcpu flag · 3ddffced
      Gadi Haber authored
      NFC.
       Updated 3 Codegen regression tests to use the -mattr flag instead of the -mcpu flags as follows:
       Instead of -mcpu=skx use -mattr=+avx512f,+avx512bw,+avx512vl,+avx512dq
       Instead of -mcpu=knl use -mattr=+avx512f
      
      Reviewers: delena
      Revision: https://reviews.llvm.org/D37674
      llvm-svn: 312909
      3ddffced
    • Andre Vieira's avatar
      [ARM] Enable the use of SVC anywhere in an IT block · c429aabb
      Andre Vieira authored
      Differential Revision: https://reviews.llvm.org/D37374
      
      llvm-svn: 312908
      c429aabb
    • Michael Zuckerman's avatar
      9707ba09
    • Simon Pilgrim's avatar
      [X86][SSE] Add test showing failure to compute sign bits through PACKSS · f6fa1d03
      Simon Pilgrim authored
      Prevents combineLogicBlendIntoPBLENDV from merging to PBLENDV
      
      llvm-svn: 312906
      f6fa1d03
    • Dylan McKay's avatar
      [AVR] Enable the '__do_copy_data' function · 0fc5fe0a
      Dylan McKay authored
      Also enables '__do_clear_bss'.
      
      These functions are automaticalled called by the CRT if they are
      declared.
      
      We need these to be called otherwise RAM will start completely
      uninitialised, even though we need to copy RAM variables from progmem to
      RAM.
      
      llvm-svn: 312905
      0fc5fe0a
    • Krasimir Georgiev's avatar
      [clang-format] Fixed one-line if statement · 3b0b50ba
      Krasimir Georgiev authored
      Summary:
      **Short overview:**
      
      Fixed bug: https://bugs.llvm.org/show_bug.cgi?id=34001
      Clang-format bug resulting in a strange behavior of control statements short blocks. Different flags combinations do not guarantee expected result. Turned on option AllowShortBlocksOnASingleLine does not work as intended.
      
      **Description of the problem:**
      
      Cpp source file UnwrappedLineFormatter does not handle AllowShortBlocksOnASingleLine flag as it should. Putting a single-line control statement without any braces, clang-format works as expected (depending on AllowShortIfStatementOnASingleLine or AllowShortLoopsOnASingleLine value). Putting a single-line control statement in braces, we can observe strange and incorrect behavior.
      Our short block is intercepted by tryFitMultipleLinesInOne function. The function returns a number of lines to be merged. Unfortunately, our control statement block is not covered properly. There are several if-return statements, but none of them handles our block. A block is identified by the line first token and by left and right braces. A function block works as expected, there is such an if-return statement doing proper job. A control statement block, from the other hand, falls into strange conditional construct, which depends on BraceWrapping.AfterFunction flag (with condition that the line’s last token is left brace, what is possible in our case) or goes even further. That should definitely not happen.
      
      **Description of the patch:**
      
      By adding three different if statements, we guarantee that our short control statement block, however it looks like (different brace wrapping flags may be turned on), is handled properly and does not fall into wrong conditional construct. Depending on appropriate options we return either 0 (when something disturbs our merging attempt) or let another function (tryMergeSimpleBlock) take the responsibility of returned result (number of merged lines). Nevertheless, one more correction is required in mentioned tryMergeSimpleBlock function. The function, previously, returned either 0 or 2. The problem was that this did not handle the case when our block had the left brace in a separate line, not the header one. After change, after adding condition, we return the result compatible with block’s structure. In case of left brace in the header’s line we do everything as before the patch. In case of left brace in a separate line we do the job similar to the one we do in case of a “non-header left brace” function short block. To be precise, we try to merge the block ignoring the header line. Then, if success, we increment our returned result.
      
      **After fix:**
      
      **CONFIG:**
      ```
      AllowShortBlocksOnASingleLine: true
      AllowShortIfStatementsOnASingleLine: true
      BreakBeforeBraces: Custom
      BraceWrapping: {
      AfterClass: true, AfterControlStatement: true, AfterEnum: true, AfterFunction: true, AfterNamespace: false, AfterStruct: true, AfterUnion: true, BeforeCatch: true, BeforeElse: true
      }
      ```
      **BEFORE:**
      ```
      if (statement) doSomething();
      if (statement) { doSomething(); }
      if (statement) {
          doSomething();
      }
      if (statement)
      {
          doSomething();
      }
      if (statement)
          doSomething();
      if (statement) {
          doSomething1();
          doSomething2();
      }
      ```
      **AFTER:**
      ```
      if (statement) doSomething();
      if (statement) { doSomething(); }
      if (statement) { doSomething(); }
      if (statement) { doSomething(); }
      if (statement) doSomething();
      if (statement)
      {
        doSomething1();
        doSomething2();
      }
      ```
      
      Contributed by @PriMee!
      
      Reviewers: krasimir, djasper
      
      Reviewed By: krasimir
      
      Subscribers: cfe-commits, klimek
      
      Differential Revision: https://reviews.llvm.org/D37140
      
      llvm-svn: 312904
      3b0b50ba
    • Igor Breger's avatar
      [GlobalISel][X86] G_ANYEXT support. · 1f14364d
      Igor Breger authored
      Summary: G_ANYEXT support
      
      Reviewers: zvi, delena
      
      Reviewed By: delena
      
      Subscribers: rovka, kristof.beyls, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D37675
      
      llvm-svn: 312903
      1f14364d
    • Ilya Biryukov's avatar
      Fixed a typo in llvm-cov/deferred-region.cpp test. · d386c299
      Ilya Biryukov authored
      Input redirection was using `2&>1` instead of `2>&1`.
      
      llvm-svn: 312902
      d386c299
    • Jonas Toth's avatar
      [clang-tidy] add more aliases for the hicpp module · a7358038
      Jonas Toth authored
      This patch will introduce even more aliases for the hicpp-module to already existing
      checks and is a follow up for D30383 finishing the other sections.
      It fixes a forgotten highlight in hicpp-braces-around-statements.rst, too.
      
      llvm-svn: 312901
      a7358038
    • Tim Renouf's avatar
      AMDGPU: trivial comment change · 6cb007fc
      Tim Renouf authored
      ... to check commit access for new committer.
      
      llvm-svn: 312900
      6cb007fc
    • Roger Ferrer Ibanez's avatar
      [ARM] Use ADDCARRY / SUBCARRY · 12b20f23
      Roger Ferrer Ibanez authored
      This is a preparatory step for D34515 and also is being recommitted as its
      first version caused PR34045.
      
      This change:
       - makes nodes ISD::ADDCARRY and ISD::SUBCARRY legal for i32
       - lowering is done by first converting the boolean value into the carry flag
         using (_, C) ← (ARMISD::ADDC R, -1) and converted back to an integer value
         using (R, _) ← (ARMISD::ADDE 0, 0, C). An ARMISD::ADDE between the two
         operations does the actual addition.
       - for subtraction, given that ISD::SUBCARRY second result is actually a
         borrow, we need to invert the value of the second operand and result before
         and after using ARMISD::SUBE. We need to invert the carry result of
         ARMISD::SUBE to preserve the semantics.
       - given that the generic combiner may lower ISD::ADDCARRY and
         ISD::SUBCARRYinto ISD::UADDO and ISD::USUBO we need to update their lowering
         as well otherwise i64 operations now would require branches. This implies
         updating the corresponding test for unsigned.
       - add new combiner to remove the redundant conversions from/to carry flags
         to/from boolean values (ARMISD::ADDC (ARMISD::ADDE 0, 0, C), -1) → C
       - fixes PR34045
      
      Differential Revision: https://reviews.llvm.org/D35192
      
      llvm-svn: 312898
      12b20f23
    • Daniel Jasper's avatar
      Revert r312830: "Reinstall the patch "Use EmitPointerWithAlignment to get... · 7af729b3
      Daniel Jasper authored
      Revert r312830: "Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr"."
      
      This triggers llvm.org/PR31620 in several of our internal builds. I'll
      forward reproduction instructions to the original author.
      
      llvm-svn: 312897
      7af729b3
    • Elena Demikhovsky's avatar
      Fixed a bug in splitting Scatter operation in the Type Legalizer. · cc477bbc
      Elena Demikhovsky authored
      After the split of the Scatter operation, the order of the new instructions is well defined - Lo goes before Hi. Otherwise the semantic of Scatter (from LSB to MSB) is broken.
      I'm chaining 2 nodes to prevent reordering.
      
      Differential Revision https://reviews.llvm.org/D37670
      
      llvm-svn: 312894
      cc477bbc
    • Lang Hames's avatar
      [ORC] Kill off a dead typedef. · 70a6929f
      Lang Hames authored
      llvm-svn: 312893
      70a6929f
    • Eric Fiselier's avatar
      Fix PR34298 - Allow std::function with an incomplete return type. · 94d55511
      Eric Fiselier authored
      This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
      the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
      whenever the copy constructor or copy assignment operator
      was required. This patch further constrains that constructor to short
      circut before evaluating the troublesome SFINAE when `Tp` matches
      std::function.
      
      The original patch is from Alex Lorenz.
      
      llvm-svn: 312892
      94d55511
    • Eric Fiselier's avatar
      Revert "Fix PR34298 - Allow std::function with an incomplete return type." · 85cde7d2
      Eric Fiselier authored
      This reverts commit r312890 because the test case fails to compile for
      older versions of Clang that reject initializing a const object without
      a user defined constructor.
      
      Since this patch should go into 5.0.1, I want to keep it an atomic change,
      and will re-commit it with a fixed test case.
      
      llvm-svn: 312891
      85cde7d2
    • Eric Fiselier's avatar
      Fix PR34298 - Allow std::function with an incomplete return type. · 358ca0c0
      Eric Fiselier authored
      This patch fixes llvm.org/PR34298. Previously libc++ incorrectly evaluated
      the __invokable trait via the converting constructor `function(Tp)` [with Tp = std::function]
      whenever the copy constructor or copy assignment operator
      was required. This patch further constrains that constructor to short
      circut before evaluating the troublesome SFINAE when `Tp` matches
      std::function.
      
      The original patch is from Alex Lorenz.
      
      llvm-svn: 312890
      358ca0c0
    • Dave Lee's avatar
      Add objcImplementationDecl matcher · e6d362ce
      Dave Lee authored
      Summary:
      Add the `objcImplementationDecl` matcher. See related: D30854
      
      Tested with:
      
      ```
      ./tools/clang/unittests/ASTMatchers/ASTMatchersTests
      ```
      
      Reviewers: aaron.ballman, compnerd, alexshap
      
      Reviewed By: aaron.ballman
      
      Subscribers: klimek, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D37643
      
      llvm-svn: 312889
      e6d362ce
    • Simon Pilgrim's avatar
      Use llvm_unreachable for unknown TargetCostKind. · b1db6b7d
      Simon Pilgrim authored
      TargetTransformInfo::getInstructionCost's switch covers all TargetCostKind cases so we shouldn't return for a default case.
      
      llvm-svn: 312888
      b1db6b7d
    • Simon Pilgrim's avatar
      [X86][SSE] Tidyup + clang-format combineX86ShuffleChain call. NFCI. · 5e2ed8be
      Simon Pilgrim authored
      llvm-svn: 312887
      5e2ed8be
    • Simon Pilgrim's avatar
      [X86][SSE] Move combineTo call out of combineX86ShufflesConstants. NFCI. · ff347d3e
      Simon Pilgrim authored
      Move towards making it possible to use the shuffle combines for cases where we don't want to call DCI.CombineTo() with the result.
      
      llvm-svn: 312886
      ff347d3e
    • Sanjay Patel's avatar
      [InstSimplify] refactor udiv/urem code and add tests; NFCI · 5876189f
      Sanjay Patel authored
      This removes some duplicated code and makes it easier to support signed div/rem
      in a similar way if we want to do that. Note that the existing comments were not
      accurate - we don't need a constant divisor to simplify; icmp simplification does
      more than that. But as the added tests show, it could go even further.
      
      llvm-svn: 312885
      5876189f
  2. Sep 10, 2017