1. Mar 20, 2019
    • Anastasia Stulova's avatar
      [OpenCL] Minor improvements in default header testing · cb16edeb
      Anastasia Stulova authored
      Differential Revision: https://reviews.llvm.org/D59544
      
      llvm-svn: 356479
      cb16edeb
    • Simon Atanasyan's avatar
      [MIPS][microMIPS] Enable dynamic stack realignment · db4601e6
      Simon Atanasyan authored
      Dynamic stack realignment was disabled on micromips by checking if
      target has standard encoding. We simply change the condition to skip
      Mips16 only.
      
      Patch by Mirko Brkusanin.
      
      Differential Revision: http://reviews.llvm.org/D59499
      
      llvm-svn: 356478
      db4601e6
    • Jordan Rupprecht's avatar
      [NFC] Fix unused variable in release builds · f74d45a7
      Jordan Rupprecht authored
      This was introduced in rL356468.
      
      llvm-svn: 356477
      f74d45a7
    • Justin Bogner's avatar
      [DAGCombine] Fix a miscompile when reducing BUILD_VECTORs to a shuffle · b353d688
      Justin Bogner authored
      In r311255 we added a case where we split vectors whose elements are
      all derived from the same input vector so that we could shuffle it
      more efficiently. In doing so, createBuildVecShuffle was taught to
      adjust for the fact that all indices would be based off of the first
      vector when this happens, but it's possible for the code that checked
      that to fire incorrectly if we happen to have a BUILD_VECTOR of
      extracts from subvectors and don't hit this new optimization.
      
      Instead of trying to detect if we've split the vector by checking if
      we have extracts from the same base vector, we can just pass that
      information into createBuildVecShuffle, avoiding the miscompile.
      
      Differential Revision: https://reviews.llvm.org/D59507
      
      llvm-svn: 356476
      b353d688
    • Anastasia Stulova's avatar
      [Sema] Adjust addr space of reference operand in compound assignment · 4ce581e5
      Anastasia Stulova authored
      When we create overloads for the builtin compound assignment operators
      we need to preserve address space for the reference operand taking it
      from the argument that is passed in.
      
      Differential Revision: https://reviews.llvm.org/D59367
      
      llvm-svn: 356475
      4ce581e5
    • Simon Pilgrim's avatar
      Fix unused variable warning. NFCI. · 7a8e5051
      Simon Pilgrim authored
      llvm-svn: 356474
      7a8e5051
    • Philip Reames's avatar
      [Tests] Update to newer ISA · 376c87fc
      Philip Reames authored
      There are some issues w/missed opts on older platforms, but that's not the purpose of this test.  Using a newer API points out that some TODOs are already handled, and allows addition of tests to exercise other issues (future patch.)
      
      llvm-svn: 356473
      376c87fc
    • Alexey Bataev's avatar
      [OPENMP] Codegen for local variables with the allocate pragma. · 4f680db2
      Alexey Bataev authored
      Added initial codegen for the local variables with the #pragma omp
      allocate directive. Instead of allocating the variables on the stack,
      __kmpc_alloc|__kmpc_free functions are used for memory (de-)allocation.
      
      llvm-svn: 356472
      4f680db2
    • Sanjay Patel's avatar
      [InstCombine] fold logic-of-nan-fcmps (PR41069) · 5b820323
      Sanjay Patel authored
      Combine 2 fcmps that are checking for nan-ness:
         and (fcmp ord X, 0), (and (fcmp ord Y, 0), Z) --> and (fcmp ord X, Y), Z
         or  (fcmp uno X, 0), (or  (fcmp uno Y, 0), Z) --> or  (fcmp uno X, Y), Z
      
      This is an exact match for a minimal reassociation pattern.
      If we want to handle this more generally that should go in
      the reassociate pass and allow removing this code.
      
      This should fix:
      https://bugs.llvm.org/show_bug.cgi?id=41069
      
      llvm-svn: 356471
      5b820323
    • Neil Henning's avatar
      [AMDGPU] Add convergent attribute to WWM. · 47c2bd2b
      Neil Henning authored
      Add the convergent attribute to the WWM intrinsic to stop it ever being
      sunk out of cfg.
      
      Differential Revision: https://reviews.llvm.org/D59536
      
      llvm-svn: 356470
      47c2bd2b
    • Zachary Turner's avatar
      Remove a couple of log statements. · 66158c00
      Zachary Turner authored
      These log statements have questionable value, and hinder the effort
      of separating the high and low level DWARF parsing interfaces inside
      of LLDB.  Removing them for now, and if/when we need such log statements
      again in the future, we can add them back (if possible) or introduce a
      mechanism for logging from the low-level interface in such a way that it
      isn't coupled to the high level interface.
      
      Differential Revision: https://reviews.llvm.org/D59498
      
      llvm-svn: 356469
      66158c00
    • Simon Pilgrim's avatar
      [SelectionDAG] Handle unary SelectPatternFlavor for ABS case in SelectionDAGBuilder::visitSelect · a56f2822
      Simon Pilgrim authored
      These changes are related to PR37743 and include:
      
          SelectionDAGBuilder::visitSelect handles the unary SelectPatternFlavor::SPF_ABS case to build ABS node.
      
          Delete the redundant recognizer of the integer ABS pattern from the DAGCombiner.
      
          Add promoting the integer ABS node in the LegalizeIntegerType.
      
          Expand-based legalization of integer result for the ABS nodes.
      
          Expand-based legalization of ABS vector operations.
      
          Add some integer abs testcases for different typesizes for Thumb arch
      
          Add the custom ABS expanding and change the SAD pattern recognizer for X86 arch: The i64 result of the ABS is expanded to:
              tmp = (SRA, Hi, 31)
              Lo = (UADDO tmp, Lo)
              Hi = (XOR tmp, (ADDCARRY tmp, hi, Lo:1))
              Lo = (XOR tmp, Lo)
      
          The "detectZextAbsDiff" function is changed for the recognition of pattern with the ABS node. Given a ABS node, detect the following pattern:
              (ABS (SUB (ZERO_EXTEND a), (ZERO_EXTEND b))).
      
          Change integer abs testcases for codegen with the ABS node support for AArch64.
              Indicate that the ABS is legal for the i64 type when the NEON is supported.
              Change the integer abs testcases to show changing of codegen.
      
          Add combine and legalization of ABS nodes for Thumb arch.
      
          Extend 'matchSelectPattern' to recognize the ABS patterns with ICMP_SGE condition.
      
      For discussion, see https://bugs.llvm.org/show_bug.cgi?id=37743
      
      Patch by: @ikulagin (Ivan Kulagin)
      
      Differential Revision: https://reviews.llvm.org/D49837
      
      llvm-svn: 356468
      a56f2822
    • Julian Lettner's avatar
      [TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptors · c27df852
      Julian Lettner authored
      In libdispatch, dispatch_apply is implemented in terms of
      dispatch_apply_f. Unfortunately, this means that we can't implement the
      interceptor for dispatch_apply_f by forwarding to the dispatch_apply
      interceptor.
      
      In the interceptor dispatch_apply_f, we can't use WRAP(dispatch_apply).
      WRAP(dispatch_apply) -> REAL(dispatch_apply_f). Requires duplication of
      some setup code.
      
      Reviewed By: kubamracek
      
      Differential Revision: https://reviews.llvm.org/D59526
      
      llvm-svn: 356467
      c27df852
    • Jordan Rupprecht's avatar
      [llvm-ar] Support N [count] modifier · 4a6b9f23
      Jordan Rupprecht authored
      Summary:
      GNU ar supports the 'N' count modifier for the extract (x) and delete (d) operations. When an archive contains multiple members with the same name, this can be used to extract (or delete) them individually. For example:
      
      ```
      $ llvm-ar t archive.a
      foo
      foo
      $ llvm-ar x archive.a
      -> Writes foo twice, overwriting it the second time :( :(
      $ llvm-ar xN 1 archive.a foo && mv foo foo.1
      $ llvm-ar xN 2 archive.a foo && mv foo foo.2
      -> Write foo twice, renaming it in between invocations to preserve all versions
      ```
      
      Reviewers: ruiu, MaskRay
      
      Reviewed By: ruiu, MaskRay
      
      Subscribers: jdoerfert, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59503
      
      llvm-svn: 356466
      4a6b9f23
    • Ryan Taylor's avatar
      [AMDGPU] Add buffer/load 8/16 bit overloaded intrinsics · 00e063ab
      Ryan Taylor authored
      Summary:
      Add buffer store/load 8/16 overloaded intrinsics for buffer, raw_buffer and struct_buffer
      
      Change-Id: I166a29f071b2ff4e4683fb0392564b1f223ac61d
      
      Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59265
      
      llvm-svn: 356465
      00e063ab
  2. Mar 19, 2019
    • Neil Henning's avatar
      [AMDGPU] Ban i8 min3 promotion. · e85f6bd6
      Neil Henning authored
      I found this really weird WWM-related case whereby through the WWM
      transformations our isel lowering was trying to promote 2 min's into a
      min3 for the i8 type, which our hardware doesn't support.
      
      The new min3_i8.ll test case would previously spew the error:
      
      PromoteIntegerResult #0: t69: i8 = SMIN3 t70, Constant:i8<0>, t68
      
      Before the simple fix to our isel lowering to not do it for i8 MVT's.
      
      Differential Revision: https://reviews.llvm.org/D59543
      
      llvm-svn: 356464
      e85f6bd6
    • Teresa Johnson's avatar
      [InstCombine] Add missing test for icmp transformation (NFC) · bda581b8
      Teresa Johnson authored
      This was split out of D59378. There was no testing for the EQ case in
      foldICmpWithDominatingICmp, add one here.
      
      llvm-svn: 356463
      bda581b8
    • Adrian Prantl's avatar
      Improve error handling for Clang module imports. · da8c0e4a
      Adrian Prantl authored
      rdar://problem/48883558
      
      Differential Revision: https://reviews.llvm.org/D59524
      
      llvm-svn: 356462
      da8c0e4a
    • Simon Atanasyan's avatar
      [mips] Fix crash on recursive using of .set · af40d437
      Simon Atanasyan authored
      Switch to the `MCParserUtils::parseAssignmentExpression` for parsing
      assignment expressions in the `.set` directive reduces code and allows
      to print an error message instead of crashing in case of incorrect
      recursive using of the `.set`.
      
      Fix for the bug https://bugs.llvm.org/show_bug.cgi?id=41053.
      
      Differential Revision: http://reviews.llvm.org/D59452
      
      llvm-svn: 356461
      af40d437
    • Markus Lavin's avatar
      [DebugInfo] Move test files added in r356451 · 00160e22
      Markus Lavin authored
      Moved the X86 dependant .ll tests added in r356451 from
      test/DebugInfo/Generic to test/DebugInfo/X86.
      
      llvm-svn: 356460
      00160e22
    • Pavel Labath's avatar
      Fix a "memset clearing an object of non-trivial type" warning in EmulateInstruction · 06453b06
      Pavel Labath authored
      This is a new warning which started appearing as of gcc-8. The Opcode
      class has a non-trivial constructor, so the idea of the warning is that
      code should use that to initialize the object instead of using memset
      (which can perturb class invariants set up by the constructor). In this
      case, the Opcode default constructor was already clearing the object's
      fields so we can just drop the memset call.
      
      While I'm touching the EmulateInstruction constructor, I also move the
      initialization of other members into the class declaration.
      
      llvm-svn: 356459
      06453b06
    • Aaron Ballman's avatar
      Ensure that const variables declared at namespace scope correctly have... · 165435ff
      Aaron Ballman authored
      Ensure that const variables declared at namespace scope correctly have external linkage when marked as dllexport and targeting the MSVC ABI.
      
      Patch thanks to Zahira Ammarguellat.
      
      llvm-svn: 356458
      165435ff
    • Kostya Kortchinsky's avatar
      [scudo][standalone] Add string utility functions · 7045c6f0
      Kostya Kortchinsky authored
      Summary:
      Add some string utility functions, notably to format strings, get
      lengths, convert a string to a number. Those functions will be
      used in reports and flags (coming up next). They were mostly borrowed
      from sanitizer_common.
      
      Make use of the string length function in a couple places in the
      platform code that was checked in with inlined version of it.
      
      Add some tests.
      
      Reviewers: morehouse, eugenis, vitalybuka, hctim
      
      Reviewed By: morehouse, vitalybuka
      
      Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits
      
      Tags: #llvm, #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D59262
      
      llvm-svn: 356457
      7045c6f0
    • Simon Pilgrim's avatar
      [InstSimplify] SimplifyICmpInst - icmp eq/ne %X, undef -> undef · 8ee477a2
      Simon Pilgrim authored
      As discussed on PR41125 and D59363, we have a mismatch between icmp eq/ne cases with an undef operand:
      
      When the other operand is constant we fold to undef (handled in ConstantFoldCompareInstruction)
      When the other operand is non-constant we fold to a bool constant based on isTrueWhenEqual (handled in SimplifyICmpInst).
      
      Neither is really wrong, but this patch changes the logic in SimplifyICmpInst to consistently fold to undef.
      
      The NewGVN test change is annoying (as with most heavily reduced tests) but AFAICT I have kept the purpose of the test based on rL291968.
      
      Differential Revision: https://reviews.llvm.org/D59541
      
      llvm-svn: 356456
      8ee477a2
    • Gabor Marton's avatar
      [ASTImporter] Fix redecl failures of FunctionTemplateSpec · dd59d27a
      Gabor Marton authored
      Summary:
      Redecl chains of function template specializations are not handled well
      currently. We want to handle them similarly to functions, i.e. try to
      keep the structure of the original AST as much as possible. The aim is
      to not squash a prototype with a definition, rather we create both and
      put them in a redecl chain.
      
      Reviewers: a_sidorin, shafik, a.sidorin
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58668
      
      llvm-svn: 356455
      dd59d27a
    • Petar Jovanovic's avatar
      [DebugInfoMetadata] Move main subprogram DIFlag into DISPFlags · 38a61873
      Petar Jovanovic authored
      Moving subprogram specific flags into DISPFlags makes IR code more readable.
      In addition, we provide free space in DIFlags for other
      'non-subprogram-specific' debug info flags.
      
      Patch by Djordje Todorovic.
      
      Differential Revision: https://reviews.llvm.org/D59288
      
      llvm-svn: 356454
      38a61873
    • Sanjay Patel's avatar
      [InstCombine] add FMF to tests for extra coverage; NFC · 423b9583
      Sanjay Patel authored
      ninf is probably the only relevant possible flag here
      (nnan allows simplification and nsz never makes a difference).
      
      llvm-svn: 356453
      423b9583
    • Gabor Marton's avatar
      [ASTImporter] Fix redecl failures of ClassTemplateSpec · 7f8c400d
      Gabor Marton authored
      Summary:
      Redecl chains of class template specializations are not handled well
      currently. We want to handle them similarly to functions, i.e. try to
      keep the structure of the original AST as much as possible. The aim is
      to not squash a prototype with a definition, rather we create both and
      put them in a redecl chain.
      
      Reviewers: a_sidorin, shafik, a.sidorin
      
      Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, jdoerfert, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58673
      
      llvm-svn: 356452
      7f8c400d
    • Markus Lavin's avatar
      [DebugInfo] Introduce DW_OP_LLVM_convert · b86ce219
      Markus Lavin authored
      Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
      for a convenient way to perform type conversions on the Dwarf expression
      stack. As an additional bonus it paves the way for using other Dwarf
      v5 ops that need to reference a base_type.
      
      The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
      to perform sext/zext on debug values but mainly the patch is about
      preparing terrain for adding other Dwarf v5 ops that need to reference a
      base_type.
      
      For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
      complex shift & mask pattern is generated to emulate sext/zext.
      
      This is a recommit of r356442 with trivial fixes for the failing tests.
      
      Differential Revision: https://reviews.llvm.org/D56587
      
      llvm-svn: 356451
      b86ce219
    • Anastasia Stulova's avatar
      [OpenCL] Improved testing of default header. · baa50631
      Anastasia Stulova authored
      Improved some checks and moved testing of the default header
      in C++ mode into the Headers folder.
      
      Differential Revision: https://reviews.llvm.org/D59486
      
      llvm-svn: 356450
      baa50631
    • Martin Probst's avatar
      [clang-format] [JS] handle private members. · 26a484f4
      Martin Probst authored
      Addresses PR40999 https://bugs.llvm.org/show_bug.cgi?id=40999
      
      Private fields and methods in JavaScript would get incorrectly indented
      (it sees them as preprocessor directives and hence left aligns them)
      
      In this revision `#identifier` tokens `tok::hash->tok::identifier` are
      merged into a single new token `tok::identifier` with the `#` contained
      inside the TokenText.
      
      Before:
      
      ```
      class Example {
        pub = 1;
      
        static pub2 = "foo";
        static #priv2 = "bar";
      
        method() { this.#priv = 5; }
      
        static staticMethod() {
          switch (this.#priv) {
          case '1':
            break;
          }
        }
      
        this.#privateMethod(); // infinite loop
      }
      
      static #staticPrivateMethod() {}
      }
      ```
      
      After this fix the code will be correctly indented
      
      ```
      class Example {
        pub = 1;
        #priv = 2;
      
        static pub2 = "foo";
        static #priv2 = "bar";
      
        method() { this.#priv = 5; }
      
        static staticMethod() {
          switch (this.#priv) {
          case '1':
            #priv = 3;
            break;
          }
        }
      
        #privateMethod() {
          this.#privateMethod(); // infinite loop
        }
      
        static #staticPrivateMethod() {}
      }
      ```
      
      NOTE: There might be some JavaScript code out there which uses the C
      processor to preprocess .js files
      http://www.nongnu.org/espresso/js-cpp.html. It's not clear how this
      revision or even private fields and methods would interact.
      
      Patch originally by MyDeveloperDays (thanks!).
      
      llvm-svn: 356449
      26a484f4
    • Simon Pilgrim's avatar
      [InstCombine] Regenerate + add icmp with undef tests · 9497b2b2
      Simon Pilgrim authored
      Better test coverage for PR41125 and D59363
      
      llvm-svn: 356448
      9497b2b2
    • Martin Probst's avatar
      [clang-format] [JS] Don't break between template string and tag · b274d3d7
      Martin Probst authored
      Before:
          const x = veryLongIdentifier
              `hello`;
      After:
          const x =
              veryLongIdentifier`hello`;
      
      While it's allowed to have the template string and tag identifier
      separated by a line break, currently the clang-format output is not
      stable when a break is forced. Additionally, disallowing a line break
      makes it clear that the identifier is actually a tag for a template
      string.
      
      Patch originally by mitchellwills (thanks!).
      
      llvm-svn: 356447
      b274d3d7
    • Eric Liu's avatar
      [Tooling] Add more scope specifiers until spelling is not ambiguous. · 52b49ab3
      Eric Liu authored
      Summary:
      Previously, when the renamed spelling is ambiguous, we simply use the
      full-qualfied name (with leading "::"). This patch makes it try adding
      additional specifiers one at a time until name is no longer ambiguous,
      which allows us to find better disambuguated spelling.
      
      Reviewers: kadircet, gribozavr
      
      Subscribers: jdoerfert, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D59487
      
      llvm-svn: 356446
      52b49ab3
    • Kadir Cetinkaya's avatar
      [clangd] Add support for type hierarchy (super types only for now) · 86658022
      Kadir Cetinkaya authored
      Summary:
      Patch by Nathan Ridge(@nridge)!
      
      This is an LSP extension proposed here:
      https://github.com/Microsoft/vscode-languageserver-node/pull/426
      
      An example client implementation can be found here:
      https://github.com/theia-ide/theia/pull/3802
      
      Reviewers: kadircet, sammccall
      
      Reviewed By: kadircet
      
      Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D56370
      
      llvm-svn: 356445
      86658022
    • Markus Lavin's avatar
      Revert "[DebugInfo] Introduce DW_OP_LLVM_convert" · ad78768d
      Markus Lavin authored
      This reverts commit 1cf4b593a7ebd666fc6775f3bd38196e8e65fafe.
      
      Build bots found failing tests not detected locally.
      
      Failing Tests (3):
        LLVM :: DebugInfo/Generic/convert-debugloc.ll
        LLVM :: DebugInfo/Generic/convert-inlined.ll
        LLVM :: DebugInfo/Generic/convert-linked.ll
      
      llvm-svn: 356444
      ad78768d
    • Serge Guelton's avatar
      Use response file when generating LLVM-C.dll · d2f2f33e
      Serge Guelton authored
      As discovered in D56774 the command line gets to long, so use a response file
      to give the script the libs. This change has been tested and is confirmed
      working for me.
      
      Commited on behalf of Jakob Bornecrantz.
      Differential Revision: https://reviews.llvm.org/D56781
      
      llvm-svn: 356443
      d2f2f33e
    • Markus Lavin's avatar
      [DebugInfo] Introduce DW_OP_LLVM_convert · cd8a940b
      Markus Lavin authored
      Introduce a DW_OP_LLVM_convert Dwarf expression pseudo op that allows
      for a convenient way to perform type conversions on the Dwarf expression
      stack. As an additional bonus it paves the way for using other Dwarf
      v5 ops that need to reference a base_type.
      
      The new DW_OP_LLVM_convert is used from lib/Transforms/Utils/Local.cpp
      to perform sext/zext on debug values but mainly the patch is about
      preparing terrain for adding other Dwarf v5 ops that need to reference a
      base_type.
      
      For Dwarf v5 the op maps to DW_OP_convert and for earlier versions a
      complex shift & mask pattern is generated to emulate sext/zext.
      
      Differential Revision: https://reviews.llvm.org/D56587
      
      llvm-svn: 356442
      cd8a940b
    • Don Hinton's avatar
      Refactor cast<>'s in if conditionals, which can only assert on failure. · f170dff3
      Don Hinton authored
      Summary:
      This patch refactors several instances of cast<> used in if
      conditionals.  Since cast<> asserts on failure, the else branch can
      never be taken.
      
      In some cases, the fix is to replace cast<> with dyn_cast<>.  While
      others required the removal of the conditional and some minor
      refactoring.
      
      A discussion can be seen here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20190318/265044.html
      
      Differential Revision: https://reviews.llvm.org/D59529
      
      llvm-svn: 356441
      f170dff3
    • Heejin Ahn's avatar
      [WebAssembly] Small improvements in FixIrreducibleControlFlow (NFC) · c60bc94a
      Heejin Ahn authored
      Summary:
      - Make some class member methods const
      - Delete unnecessary includes
      - Use a simpler form of `BuildMI`
      
      Reviewers: kripken
      
      Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D59454
      
      llvm-svn: 356440
      c60bc94a