1. Aug 21, 2020
    • Jonas Devlieghere's avatar
      [lldb] Simplify CMake logic with LLVM's append_if function · c1bc4fb9
      Jonas Devlieghere authored
      Use the append_if CMake function from HandleLLVMOptions. Since we
      include this file in LLDBStandalone it should work in both for in-tree
      and out-of-tree builds.
      c1bc4fb9
    • Michael Kruse's avatar
      [Polly] Update isl to isl-0.22.1-416-g61d6dc75. · a54eb9b7
      Michael Kruse authored
      This fixes llvm.org/PR47104
      a54eb9b7
    • Mauricio Sifontes's avatar
      Refactor Reduction Tree Pass · 21f8d414
      Mauricio Sifontes authored
      Refactor the way the reduction tree pass works in the MLIR Reduce tool by introducing a set of utilities that facilitate the implementation of new Reducer classes to be used in the passes.
      
      This will allow for the fast implementation of general transformations to operate on all mlir modules as well as custom transformations for different dialects.
      
      These utilities allow for the implementation of Reducer classes by simply defining a method that indexes the operations/blocks/regions to be transformed and a method to perform the deletion or transfomration based on the indexes.
      
      Create the transformSpace class member in the ReductionNode class to keep track of the indexes that have already been transformed or deleted at a current level.
      
      Delete the FunctionReducer class and replace it with the OpReducer class to reflect this new API while performing the same transformation and allowing the instantiation of a reduction pass for different types of operations at the module's highest hierarchichal level.
      
      Modify the SinglePath Traversal method to reflect the use of the new API.
      
      Reviewed: jpienaar
      
      Differential Revision: https://reviews.llvm.org/D85591
      21f8d414
    • Xing GUO's avatar
    • Yevgeny Rouban's avatar
      [ADT] Allow IsSizeLessThanThresholdT for incomplete types. NFC · 7d9a1624
      Yevgeny Rouban authored
      If the type T is incomplete then sizeof(T) results in C++ compilation error at line:
        static constexpr bool value = sizeof(T) <= (2 * sizeof(void *));
      
      This patch allows incomplete types in parameters of function. Example:
        using SomeFunc = void(SomeIncompleteType &);
        llvm::unique_function<SomeFuncType> SomeFunc;
      
      Reviewers: DaniilSuchkov, vvereschaka
      
      Differential Revision: https://reviews.llvm.org/D81554
      7d9a1624
    • Xing GUO's avatar
      [DWARFYAML] Add support for referencing different abbrev tables. · f7ff0ace
      Xing GUO authored
      This patch adds support for referencing different abbrev tables. We use
      'ID' to distinguish abbrev tables and use 'AbbrevTableID' to explicitly
      assign an abbrev table to compilation units.
      
      The syntax is:
      ```
      debug_abbrev:
        - ID: 0
          Table:
            ...
        - ID: 1
          Table:
            ...
      debug_info:
        - ...
          AbbrevTableID: 1 ## Reference the second abbrev table.
        - ...
          AbbrevTableID: 0 ## Reference the first abbrev table.
      ```
      
      Reviewed By: jhenderson
      
      Differential Revision: https://reviews.llvm.org/D83116
      f7ff0ace
    • Xing GUO's avatar
      [DWARFYAML] Add support for emitting multiple abbrev tables. · e151acc0
      Xing GUO authored
      This patch adds support for emitting multiple abbrev tables. Currently,
      compilation units will always reference the first abbrev table.
      
      Reviewed By: jhenderson, labath
      
      Differential Revision: https://reviews.llvm.org/D86194
      e151acc0
    • Shoaib Meenai's avatar
      [cmake] Don't use ld.lld when targeting Darwin · 16f27e1e
      Shoaib Meenai authored
      ld.lld is an ELF linker. We can switch to the new LLD for Mach-O port
      when it's more complete, but for now, assume the user will have set
      CMAKE_LINKER correctly themselves when targeting Darwin.
      16f27e1e
    • Xing GUO's avatar
      [DWARFYAML] Add support for emitting multiple abbrev tables. · 290e399f
      Xing GUO authored
      This patch adds support for emitting multiple abbrev tables. Currently,
      compilation units will always reference the first abbrev table.
      
      Reviewed By: jhenderson, labath
      
      Differential Revision: https://reviews.llvm.org/D86194
      290e399f
    • Michael Liao's avatar
      [amdgpu] Add codegen support for HIP dynamic shared memory. · 5257a60e
      Michael Liao authored
      Summary:
      - HIP uses an unsized extern array `extern __shared__ T s[]` to declare
        the dynamic shared memory, which size is not known at the
        compile time.
      
      Reviewers: arsenm, yaxunl, kpyzhov, b-sumner
      
      Subscribers: kzhuravl, jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82496
      5257a60e
    • Shoaib Meenai's avatar
      [runtimes] Allow LLVM_BUILTIN_TARGETS to include Darwin · e2ab5bcf
      Shoaib Meenai authored
      We have two ways of using the runtimes build setup to build the
      builtins. You can either have an empty LLVM_BUILTIN_TARGETS (or have it
      include the "default" target), in which case builtin_default_target is
      called to set up the default target, or you can have actual triples in
      LLVM_BUILTIN_TARGETS, in which case builtin_register_target is called
      for each triple. builtin_default_target lets you build the builtins for
      Darwin (assuming your default triple is Darwin); builtin_register_target
      does not.
      
      I don't understand the reason for this distinction. The Darwin builtins
      build is special in that a single CMake configure handles building the
      builtins for multiple platforms (e.g. macOS, iPhoneSimulator, and iOS)
      and architectures (e.g. arm64, armv7, and x86_64). Consequently, if you
      specify multiple Darwin triples in LLVM_BUILTIN_TARGETS, expecting each
      configure to only build for that particular triple, it won't work.
      However, if you specify a *single* x86_64-apple-darwin triple in
      LLVM_BUILTIN_TARGETS, that single configure will build the builtins for
      all Darwin targets, exactly the same way that the default target would.
      The only difference between the configuration for the default target and
      the x86_64-apple-darwin triple is that the latter runs the configuration
      with `-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON`, but that makes no
      difference for Apple targets (none of the CMake codepaths which have
      different behavior based on that variable are run for Apple targets).
      
      I tested this by running two builtins builds on my Mac, one with the
      default target and one with the x86_64-apple-darwin19.5.0 target (which
      is the default target triple for my clang). The only relevant
      CMakeCache.txt difference was the following, and as discussed above, it
      has no effect on the actual build for Apple targets:
      
      ```
      -//Default triple for which compiler-rt runtimes will be built.
      -COMPILER_RT_DEFAULT_TARGET_TRIPLE:STRING=x86_64-apple-darwin19.5.0
      +//No help, variable specified on the command line.
      +COMPILER_RT_DEFAULT_TARGET_ONLY:UNINITIALIZED=ON
      ```
      
      Furthermore, when I add the `-D` flag to compiler-rt's libtool
      invocations, the libraries produced by the two builds are *identical*.
      
      If anything, I would expect builtin_register_target to complain if you
      tried specifying a triple for a particular Apple platform triple (e.g.
      macosx), since that's the scenario in which it won't work as you want.
      The generic darwin triple should be fine though, as best as I can tell.
      I'm happy to add the error for specific Apple platform triples, either
      in this diff or in a follow-up.
      
      Reviewed By: phosek
      
      Differential Revision: https://reviews.llvm.org/D86313
      e2ab5bcf
    • Gousemoodhin Nadaf's avatar
      [clang]: Remove assertion which checks explicit declaration · fe86dbb3
      Gousemoodhin Nadaf authored
      explicit keyword is declared outside of class is invalid, invalid explicit declaration is handled inside DiagnoseFunctionSpecifiers() function. To avoid compiler crash in case of invalid explicit declaration, remove assertion.
      
      Reviewed By: rsmith
      
      Differential Revision: https://reviews.llvm.org/D83929
      fe86dbb3
    • Kang Zhang's avatar
      [PowerPC] Fix a typo for InstAlias of mfsprg · 95e18b2d
      Kang Zhang authored
      D77531 has a type for mfsprg, it should be mtsprg. This patch is to fix
      this typo.
      95e18b2d
    • Jonas Devlieghere's avatar
      [lldb] Capture and load home directory from the reproducer. · 73af341b
      Jonas Devlieghere authored
      When replaying the reproducer, lldb should source the .lldbinit file
      that was captured by the reproducer and not the one in the current home
      directory. This requires that we store the home directory as part of the
      reproducer. By returning the virtual home directory during replay, we
      ensure the correct virtual path gets constructed which the VFS can then
      find and remap to the correct file in the reproducer root.
      
      This patch adds a new HomeDirectoryProvider, similar to the existing
      WorkingDirectoryProvider. As the home directory is not part of the VFS,
      it is stored in LLDB's FileSystem instance.
      73af341b
    • Jonas Devlieghere's avatar
      [lldb] Implement WorkingDirectoryProvider in terms of DirectoryProvider (NFC) · c90ca0c8
      Jonas Devlieghere authored
      Add an abstract base class that can be used to create other directory
      providers.
      c90ca0c8
    • Vitaly Buka's avatar
      Revert "[libFuzzer] Fix value-profile-load test." · 66c882e5
      Vitaly Buka authored
      D86247 fails on Windows.
      
      This reverts commit 428bebaf.
      66c882e5
    • Volodymyr Sapsai's avatar
      [HeaderSearch] Fix processing #import-ed headers multiple times with modules enabled. · 7ac737e5
      Volodymyr Sapsai authored
      HeaderSearch was marking requested HeaderFileInfo as Resolved only based on
      the presence of ExternalSource. As the result, using any module was enough
      to set ExternalSource and headers unknown to this module would have
      HeaderFileInfo with empty fields, including `isImport = 0`, `NumIncludes = 0`.
      Such HeaderFileInfo was preserved without changes regardless of how the
      header was used in other modules and caused incorrect result in
      `HeaderSearch::ShouldEnterIncludeFile`.
      
      Fix by marking HeaderFileInfo as Resolved only if ExternalSource knows
      about this header.
      
      rdar://problem/62126911
      
      Reviewed By: bruno
      
      Differential Revision: https://reviews.llvm.org/D80263
      7ac737e5
    • Vitaly Buka's avatar
      [NFC][libFuzzer] Try to fix test on Windows · ea9bf460
      Vitaly Buka authored
      Broken after D86247
      ea9bf460
    • Vitaly Buka's avatar
      Fix msan build · 34fe9613
      Vitaly Buka authored
      After D85820 TERMINFO_LIB is undefined.
      34fe9613
    • Justin Bogner's avatar
      [GISel] Correct the known bits of G_ANYEXT · 1283dca0
      Justin Bogner authored
      Known bits for G_ANYEXT was incorrectly using KnownBits::zext, causing
      us to treat the high bits as zero even though they're (by definition)
      unknown.
      
      Differential Revision: https://reviews.llvm.org/D86323
      1283dca0
    • Richard Smith's avatar
      Improve pretty-printing for APValues of void type. · 70923983
      Richard Smith authored
      No functionality change intended: there doesn't seem to be any way to
      cause Clang to print such a value, but they can show up when dumping
      APValues from a debugger.
      70923983
    • Julian Lettner's avatar
      [Darwin][iOS] Enable test on non-macOS platforms · 53aff8d8
      Julian Lettner authored
      We are now using a properly-substituted minimal deployment target
      compiler flag (`%min_macos_deployment_target=10.11`).  Enable test on
      iOS and watchOS plus simulators.  We are also not testing on very old
      platforms anymore, so we can remove some obsolete lit infrastructure.
      53aff8d8
    • Richard Smith's avatar
      Fix up clangd after Clang 038edf60. · efeb65d5
      Richard Smith authored
      Now that Clang is able to constant-evaluate void-typed expressions,
      disable showing hover-card values for them. It's not useful to say that
      an expression cast to void has value '<no value>', even if we can
      constant-evaluate it to that result!
      efeb65d5
    • Julian Lettner's avatar
      [compiler-rt][Darwin] Refactor minimum deployment target substitutions · 1f3c92f9
      Julian Lettner authored
      * Support macOS 11+ version scheme
      * Standardize substitution name `%min_deployment_target=x.y`
      * Remove unneeded error cases (the input version is hard-coded)
      * Specify version as tuple instead of string; no need to parse it
      
      These changes should also facilitate a future addition of a substitution
      that expands to "set deployment target to current target version"
      (https://reviews.llvm.org/D70151).
      
      Reviewed By: delcypher
      
      Differential Revision: https://reviews.llvm.org/D85925
      1f3c92f9
    • Fangrui Song's avatar
      [ELF] Keep st_type for symbol assignment · 9670029b
      Fangrui Song authored
      PR46970: for `alias = aliasee`, the alias can be used in relocation processing
      and on ARM st_type does affect Thumb interworking. It is thus desirable for the
      alias to get the same st_type.
      
      Note that the st_size field should not be inherited because some tools use
      st_size=0 as a heuristic to detect aliases. Retaining st_size can thwart such
      heuristics and cause aliases to be preferred over the original symbols.
      
      Differential Revision: https://reviews.llvm.org/D86263
      9670029b
    • JonChesterfield's avatar
    • Richard Smith's avatar
      038edf60
    • Frank Laub's avatar
      [MLIR] Add affine.parallel folder and normalizer · cca3f3dd
      Frank Laub authored
      Add a folder to the affine.parallel op so that loop bounds expressions are canonicalized.
      
      Additionally, a new AffineParallelNormalizePass is added to adjust affine.parallel ops so that the lower bound is always 0 and the upper bound always represents a range with a step size of 1.
      
      Differential Revision: https://reviews.llvm.org/D84998
      cca3f3dd
    • Eric Leese's avatar
      Make DWARFExpression::GetLocationExpression public · 4e266eaf
      Eric Leese authored
      This method is used to get the DataExtractor when the expression is a location list.
      
      Reviewed By: labath
      
      Differential Revision: https://reviews.llvm.org/D86090
      4e266eaf
    • Jonas Devlieghere's avatar
      [lldb] Extract FileSystem initialization code into helper (NFC) · ed17b6f6
      Jonas Devlieghere authored
      The FileSystem initialization depends on the reproducer mode. It has
      been growing organically to the point where it deserves its own helper
      function. This also allows for early returns to simplify the code.
      ed17b6f6
    • Fangrui Song's avatar
    • George Mitenkov's avatar
      [MLIR][SPIRVToLLVM] Removed std to llvm patterns from the conversion · dc693a03
      George Mitenkov authored
      Removed the Standard to LLVM conversion patterns that were previously
      pulled in for testing purposes. This helps to separate the conversion
      to LLVM dialect of the MLIR module with both SPIR-V and Standard
      dialects in it (particularly helpful for SPIR-V cpu runner). Also,
      tests were changed accordingly.
      
      Reviewed By: mravishankar
      
      Differential Revision: https://reviews.llvm.org/D86285
      dc693a03
    • Fangrui Song's avatar
      2b0f40b0
    • Jonas Devlieghere's avatar
      [lldb] Provide GetHomeDirectory wrapper in Host::FileSystem (NFC) · 921c1b7d
      Jonas Devlieghere authored
      Provider a wrapper around llvm::sys::path::home_directory in the
      FileSystem class. This will make it possible for the reproducers to
      intercept the call in a central place.
      921c1b7d
    • Jon Roelofs's avatar
      Fix a couple of typos. NFC · 74ca5275
      Jon Roelofs authored
      74ca5275
    • Simon Pilgrim's avatar
      [X86] Enable constexpr on POPCNT intrinsics (PR31446) · cff0db08
      Simon Pilgrim authored
      This is a first step patch to enable constexpr support and testing to a large number of x86 intrinsics.
      
      All I've done here is provide a DEFAULT_FN_ATTRS_CONSTEXPR variant to our existing DEFAULT_FN_ATTRS tag approach that adds constexpr on c++ builds. The clang cuda headers do something similar.
      
      I've started with POPCNT mainly as its tiny and are wrappers to generic __builtin_* intrinsics which already act as constexpr.
      
      Differential Revision: https://reviews.llvm.org/D86229
      cff0db08
    • Matt Arsenault's avatar
      CodeGen: Don't drop AA metadata when splitting MachineMemOperands · 79ce9bb3
      Matt Arsenault authored
      Assuming this is used to split a memory access into smaller pieces,
      the new access should still have the same aliasing properties as the
      original memory access. As far as I can tell, this wasn't
      intentionally dropped. It may be necessary to drop this if you are
      moving the operand outside of the bounds of the original object in
      such a way that it may alias another IR object, but I don't think any
      of the existing users are doing this. Some of the uses widen into
      unused alignment padding, which I think is OK.
      79ce9bb3
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Legalize odd sized loads with widening · 18b21800
      Matt Arsenault authored
      Custom lower and widen odd sized loads up to the alignment. The
      default set of legalization actions doesn't have a way to represent
      this. This fixes naturally aligned <3 x s8> and <3 x s16> loads.
      
      This also starts moving towards eliminating the buggy and
      overcomplicated legalization rules for narrowing. All the memory size
      changes should be done in the lower or custom action, not NarrowScalar
      / FewerElements. These currently have redundant and ambiguous code
      with the lower action.
      18b21800
    • vnalamot's avatar
      allSGPRSpillsAreDead() should use actual FP/BP frame indices · 54d8ded4
      vnalamot authored
      The SGPR spills happen in SILowerSGPRSpills() and allSGPRSpillsAreDead()
      make sure there are no SGPR spills pending during PEI. But the FP/BP
      spills happen during PEI and are exceptions.
      
      Use actual frame indices of FP/BP in allSGPRSpillsAreDead() to
      accommodate the exceptions.
      
      Differential Revision: https://reviews.llvm.org/D86291
      54d8ded4
    • Kamau Bridgeman's avatar
      [PowerPC][PCRelative] Thread Local Storage Support for General Dynamic · b74b80bb
      Kamau Bridgeman authored
      This patch is the initial support for the General Dynamic Thread Local
      Local Storage model to produce code sequence and relocations correct
      to the ABI for the model when using PC relative memory operations.
      
      Patch by: NeHuang
      
      Reviewed By: stefanp
      
      Differential Revision: https://reviews.llvm.org/D82315
      b74b80bb