1. Jan 20, 2021
    • Fangrui Song's avatar
      d39adeaf
    • Jonas Devlieghere's avatar
      [llvm] Protect signpost map with a mutex · a4b42c62
      Jonas Devlieghere authored
      Use a mutex to protect concurrent access to the signpost map. This fixes
      nondeterministic crashes in LLDB that appeared after using signposts in
      the timer implementation.
      
      Differential revision: https://reviews.llvm.org/D94285
      a4b42c62
    • Wim Leflere's avatar
      [libc++][P1679] add string contains · 6ac9cb2a
      Wim Leflere authored
      C++23 string contains implementation and tests
      
      Paper: https://wg21.link/P1679R3
      Standard (string): https://eel.is/c++draft/string.contains
      Standard (string_view): https://eel.is/c++draft/string.view.ops#lib:contains,basic_string_view
      
      Differential Revision: https://reviews.llvm.org/D93912
      6ac9cb2a
    • Mariya Podchishchaeva's avatar
      [ScalarizeMaskedMemIntrin] Add missing dependency · 7113de30
      Mariya Podchishchaeva authored
      The pass has dependency on 'TargetTransformInfoWrapperPass', but the
      corresponding call to INITIALIZE_PASS_DEPENDENCY was missing.
      
      Differential Revision: https://reviews.llvm.org/D94916
      7113de30
    • Nikita Popov's avatar
      Reapply [InstCombine] Replace one-use select operand based on condition · 21443381
      Nikita Popov authored
      Relative to the original change, this adds a check that the
      instruction on which we're replacing operands is safe to speculatively
      execute, because that's what we're effectively doing. We're executing
      the instruction with the replaced operand, which is fine if it's pure,
      but not fine if can cause side-effects or UB (aka is not speculatable).
      
      Additionally, we cannot (generally) replace operands in phi nodes,
      as these may refer to a different loop iteration. This is also covered
      by the speculation check.
      
      -----
      
      InstCombine already performs a fold where X == Y ? f(X) : Z is
      transformed to X == Y ? f(Y) : Z if f(Y) simplifies. However,
      if f(X) only has one use, then we can always directly replace the
      use inside the instruction. To actually be profitable, limit it to
      the case where Y is a non-expr constant.
      
      This could be further extended to replace uses further up a one-use
      instruction chain, but for now this only looks one level up.
      
      Among other things, this also subsumes D94860.
      
      Differential Revision: https://reviews.llvm.org/D94862
      21443381
    • Nikita Popov's avatar
      [InstCombine] Add additional tests for select operand replacement (NFC) · bedbb582
      Nikita Popov authored
      In particular, add tests for speculatable and non-speculatable
      instructions.
      bedbb582
    • Arthur Eubanks's avatar
      [wasm][LLD] Rename --lto-new-pass-manager to --no-lto-legacy-pass-manager · a2317869
      Arthur Eubanks authored
      This follows a similar ELF change.
      
      Reviewed By: MaskRay, sbc100
      
      Differential Revision: https://reviews.llvm.org/D93253
      a2317869
    • Craig Topper's avatar
      [RISCV] Add DAG combine to turn (setcc X, 1, setne) -> (setcc X, 0, seteq) if... · ce8b3937
      Craig Topper authored
      [RISCV] Add DAG combine to turn (setcc X, 1, setne) -> (setcc X, 0, seteq) if we can prove X is 0/1.
      
      If we are able to compare with 0 instead of 1, we might be able
      to fold the setcc into a beqz/bnez.
      
      Often these setccs start life as an xor that gets converted to
      a setcc by DAG combiner's rebuildSetcc. I looked into a detecting
      (xor X, 1) and converting to (seteq X, 0) based on boolean contents
      being 0/1 in rebuildSetcc instead of using computeKnownBits. It was
      very perturbing to AMDGPU tests which I didn't look closely at.
      It had a few changes on a couple other targets, but didn't seem
      to be much if any improvement.
      
      Reviewed By: lenary
      
      Differential Revision: https://reviews.llvm.org/D94730
      ce8b3937
    • Shilei Tian's avatar
      [Clang][OpenMP] Fixed an issue that clang crashed when compiling OpenMP... · 82e537a9
      Shilei Tian authored
      [Clang][OpenMP] Fixed an issue that clang crashed when compiling OpenMP program in device only mode without host IR
      
      D94745 rewrites the `deviceRTLs` using OpenMP and compiles it by directly
      calling the device compilation. `clang` crashes because entry in
      `OffloadEntriesDeviceGlobalVar` is unintialized. Current design supposes the
      device compilation can only be invoked after host compilation with the host IR
      such that `clang` can initialize `OffloadEntriesDeviceGlobalVar` from host IR.
      This avoids us using device compilation directly, especially when we only have
      code wrapped into `declare target` which are all device code. The same issue
      also exists for `OffloadEntriesInfoManager`.
      
      In this patch, we simply initialized an entry if it is not in the maps. Not sure
      we need an option to tell the device compiler that it is invoked standalone.
      
      Reviewed By: jdoerfert
      
      Differential Revision: https://reviews.llvm.org/D94871
      82e537a9
    • Louis Dionne's avatar
      [libc++] Make LIBCXX_ENABLE_FILESYSTEM fully consistent · 933518ff
      Louis Dionne authored
      Previously, LIBCXX_ENABLE_FILESYSTEM controlled only whether the filesystem
      support was compiled into libc++'s library. This commit promotes the
      setting to a first-class option like LIBCXX_ENABLE_LOCALIZATION, where
      the whole library is aware of the setting and features that depend on
      <filesystem> won't be provided at all. The test suite is also properly
      annotated such that tests that depend on <filesystem> are disabled when
      the library doesn't support it.
      
      This is an alternative to https://llvm.org/D94824, but also an improvement
      along the lines of LIBCXX_ENABLE_LOCALIZATION that I had been wanting to
      make for a while.
      
      Differential Revision: https://reviews.llvm.org/D94921
      933518ff
    • Louis Dionne's avatar
      [libc++] Unbreak the debug mode · 68dba7ea
      Louis Dionne authored
      When the Debug mode is enabled, we disable extern declarations because we
      don't want to use the functions compiled in the library, which might not
      have had the debug mode enabled when built. However, some extern declarations
      need to be kept, because code correctness depends on it.
      
      31e82037 removed those declarations, which had the unintended
      consequence of breaking the debug build. This commit fixes that by
      re-introducing a separate macro for the required extern declarations,
      and adds a comment so that we don't fall into that trap in the future.
      
      Differential Revision: https://reviews.llvm.org/D94718
      68dba7ea
    • Reid Kleckner's avatar
      Add bounds checking assertions to APValue, NFC · e6786566
      Reid Kleckner authored
      These checks help find llvm.org/pr48582 without ASan
      e6786566
    • Reid Kleckner's avatar
      Consider ASan messages interesting for creduce · 6f69f2ed
      Reid Kleckner authored
      Helped me reduce llvm.org/pr48582
      6f69f2ed
    • Jeroen Dobbelaere's avatar
      [noalias.decl] Look through llvm.experimental.noalias.scope.decl · 121cac01
      Jeroen Dobbelaere authored
      Just like llvm.assume, there are a lot of cases where we can just ignore llvm.experimental.noalias.scope.decl.
      
      Reviewed By: nikic
      
      Differential Revision: https://reviews.llvm.org/D93042
      121cac01
    • Richard Smith's avatar
      [www] Fix background color in table cell. · 987760b4
      Richard Smith authored
      987760b4
    • Brendon Cahoon's avatar
      [Hexagon] Fix segment start to adjust for gaps between segments · 57443bfb
      Brendon Cahoon authored
      The Hexagon Vector Combine pass genertes stores for a complete
      aligned vector. The start of each section is a multiple of the
      vector size, so that value is passed to normalize to compute
      the offset of the stores in the section.  The first store may
      not occur at offset 0 when there is a gap between sections.
      57443bfb
    • Utkarsh Saxena's avatar
      17846ed5
    • Jay Foad's avatar
      [AMDGPU] Simpler names for arch-specific ttmp registers. NFC. · 18cb7441
      Jay Foad authored
      Rename the *_gfx9_gfx10 ttmp registers to *_gfx9plus for simplicity,
      and use the corresponding isGFX9Plus predicate to decide when to use
      them instead of the old *_vi versions.
      
      Differential Revision: https://reviews.llvm.org/D94975
      18cb7441
    • Jessica Paquette's avatar
      Fix buildbot after cfc60730 · cbf52463
      Jessica Paquette authored
      Windows buildbots were not happy with using find_if + instructionsWithoutDebug.
      
      In cfc60730, instructionsWithoutDebug is not technically necessary. So,
      just iterate over the block directly.
      
      http://lab.llvm.org:8011/#/builders/127/builds/4732/steps/7/logs/stdio
      cbf52463
    • Jessica Paquette's avatar
      [GlobalISel] Combine (a[0]) | (a[1] << k1) | ...| (a[m] << kn) into a wide load · cfc60730
      Jessica Paquette authored
      This is a restricted version of the combine in `DAGCombiner::MatchLoadCombine`.
      (See D27861)
      
      This tries to recognize patterns like below (assuming a little-endian target):
      
      ```
      s8* x = ...
      s32 val = a[0] | (a[1] << 8) | (a[2] << 16) | (a[3] << 24)
      ->
      s32 val = *((i32)a)
      
      s8* x = ...
      s32 val = a[3] | (a[2] << 8) | (a[1] << 16) | (a[0] << 24)
      ->
      s32 val = BSWAP(*((s32)a))
      ```
      
      (This patch also handles the big-endian target case as well, in which the first
      example above has a BSWAP, and the second example above does not.)
      
      To recognize the pattern, this searches from the last G_OR in the expression
      tree.
      
      E.g.
      
      ```
          Reg   Reg
           \    /
            OR_1   Reg
             \    /
              OR_2
                \     Reg
                 .. /
                Root
      ```
      
      Each non-OR register in the tree is put in a list. Each register in the list is
      then checked to see if it's an appropriate load + shift logic.
      
      If every register is a load + potentially a shift, the combine checks if those
      loads + shifts, when OR'd together, are equivalent to a wide load (possibly with
      a BSWAP.)
      
      To simplify things, this patch
      
      (1) Only handles G_ZEXTLOADs (which appear to be the common case)
      (2) Only works in a single MachineBasicBlock
      (3) Only handles G_SHL as the bit twiddling to stick the small load into a
          specific location
      
      An IR example of this is here: https://godbolt.org/z/4sP9Pj (lifted from
      test/CodeGen/AArch64/load-combine.ll)
      
      At -Os on AArch64, this is a 0.5% code size improvement for CTMark/sqlite3,
      and a 0.4% improvement for CTMark/7zip-benchmark.
      
      Also fix a bug in `isPredecessor` which caused it to fail whenever `DefMI` was
      the first instruction in the block.
      
      Differential Revision: https://reviews.llvm.org/D94350
      cfc60730
    • Fraser Cormack's avatar
      [RISCV] Add ISel patterns for scalable mask exts & truncs · 9c6a00fe
      Fraser Cormack authored
      
      
      Original patch by @rogfer01.
      
      This patch adds support for sign-, zero-, and any-extension from
      scalable mask vector types to integer vector types, as well as
      truncation in the opposite direction.
      
      Authored-by: default avatarRoger Ferrer Ibanez <rofirrim@gmail.com>
      Co-Authored-by: default avatarFraser Cormack <fraser@codeplay.com>
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D94590
      9c6a00fe
    • Abhina Sreeskantharajan's avatar
      [SystemZ][z/OS] Fix Permission denied pattern matching · 88e7c349
      Abhina Sreeskantharajan authored
      On z/OS, the error message "EDC5111I Permission denied." is not matched correctly in lit tests. This patch updates the check expression to match successfully.
      
      Differential Revision: https://reviews.llvm.org/D94432
      88e7c349
    • Michael Kruse's avatar
      [Polly] Update isl to isl-0.23-61-g24e8cd12. · 842314b5
      Michael Kruse authored
      This fixes llvm.org/PR48554
      
      Some test cases had to be updated because the hash function for
      union_maps have been changed which affects the output order.
      842314b5
    • Raphael Isemann's avatar
      [lldb][docs] Update .htaccess to redirect from old SB API documentation to new one · 2f809950
      Raphael Isemann authored
      This is mostly SEO so that the new API can take over the old API when people
      search for the different SB* classes. Sadly epydoc decided to throw in a -class
      prefix behind all the class file names, so we can't just overwrite the old files
      with the newly generated ones.
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D94900
      2f809950
    • David Green's avatar
      [ARM] Expand vXi1 VSELECT's · 6a563eef
      David Green authored
      We have no lowering for VSELECT vXi1, vXi1, vXi1, so mark them as
      expanded to turn them into a series of logical operations.
      
      Differential Revision: https://reviews.llvm.org/D94946
      6a563eef
    • Raphael Isemann's avatar
      [lldb][docs] Add a doc page for enums and constants · 3cae8b33
      Raphael Isemann authored
      Enums and constants are currently missing in the new LLDB Python API docs.
      
      In theory we could just let them be autogenerated like the SB API classes, but sadly the generated documentation
      suffers from a bunch of problems. Most of these problems come from the way SWIG is representing enums, which is
      done by translating every single enum case into its own constant. This has a bunch of nasty effects:
      
      * Because SWIG throws away the enum types, we can't actually reference the enum type itself in the API. Also because automodapi is impossible to script, this can't be fixed in post (at least without running like sed over the output files).
      * The lack of enum types also causes that every enum *case* has its own full doc page. Having a full doc page that just shows a single enum case is pointless and it really slows down sphinx.
      * There is no SWIG code for the enums, so there is also no place to write documentation strings for them. Also there is no support for copying the doxygen strings (which would be in the wrong format, but better than nothing) for enums (let alone our defines), so we can't really document all this code.
      * Because the enum cases are just forwards to the native lldb module (which we mock), automodapi actually takes the `Mock` docstrings and adds it to every single enum case.
      
      I don't see any way to solve this via automodapi or SWIG. The most reasonable way to solve this is IMHO to write a simple Clang tool
      that just parses our enum/constant headers and emits an *.rst file that we check in. This way we can do all the LLDB-specific enum case and constant
      grouping that we need to make a readable documentation page.
      
      As we're without any real documentation until I get around to write that tool, I wrote a doc page for the enums/constants as a stop gap measure.
      Most of this is done by just grepping our enum header and then manually cleaning up all the artifacts and copying the few doc strings we have.
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D94959
      3cae8b33
    • Andrzej Warzynski's avatar
      [flang][driver] Move isFixedFormSuffix and isFreeFormSuffix to flangFrontend · cea3abc2
      Andrzej Warzynski authored
      isFixedFormSuffix and isFreeFormSuffix should be defined in
      flangFrontend rather than flangFrontendTool library. That's for 2
      reasons:
        * these methods are used in flangFrontend rather than flangFrontendTool
        * flangFrontendTool depends on flangFrontend
      
      As mentioned in the post-commit review for D94228, without this change
      shared library builds fail.
      
      Differential Revision: https://reviews.llvm.org/D94968
      cea3abc2
    • Stella Laurenzo's avatar
      [mlir][python] Factor out standalone OpView._ods_build_default class method. · 71b6b010
      Stella Laurenzo authored
      * This allows us to hoist trait level information for regions and sized-variadic to class level attributes (_ODS_REGIONS, _ODS_OPERAND_SEGMENTS, _ODS_RESULT_SEGMENTS).
      * Eliminates some splicey python generated code in favor of a native helper for it.
      * Makes it possible to implement custom, variadic and region based builders with one line of python, without needing to manually code access to the segment attributes.
      * Needs follow-on work for region based callbacks and support for SingleBlockImplicitTerminator.
      * A follow-up will actually add ODS support for generating custom Python builders that delegate to this new method.
      * Also includes the start of an e2e sample for constructing linalg ops where this limitation was discovered (working progressively through this example and cleaning up as I go).
      
      Differential Revision: https://reviews.llvm.org/D94738
      71b6b010
    • Björn Schäpers's avatar
      [clang-format] Apply Allman style to lambdas · cbdde495
      Björn Schäpers authored
      Differential Revision: https://reviews.llvm.org/D94906
      cbdde495
    • Nikita Popov's avatar
      [ValueTracking] Strengthen impliesPoison reasoning · 051ec9f5
      Nikita Popov authored
      Split impliesPoison into two recursive walks, one over V, the
      other over ValAssumedPoison. This allows us to reason about poison
      implications in a number of additional cases that are important
      in practice. This is a generalized form of D94859, which handles
      the cmp to cmp implication in particular.
      
      Differential Revision: https://reviews.llvm.org/D94866
      051ec9f5
    • Jay Foad's avatar
      [AMDGPU] Fix test case for D94010 · 0808c700
      Jay Foad authored
      0808c700
    • KareemErgawy-TomTom's avatar
      [MLIR][SPIRV] Add `SignedOp` trait. · 27820496
      KareemErgawy-TomTom authored
      This commit adds a new trait that can be attached to ops that have
      signed semantics.
      
      Reviewed By: antiagainst
      
      Differential Revision: https://reviews.llvm.org/D94896
      27820496
    • Jay Foad's avatar
      [AMDGPU] Simplify test case for D94010 · de2f9423
      Jay Foad authored
      de2f9423
  2. Jan 19, 2021
    • Hansang Bae's avatar
      [OpenMP] Fix atomic entries for captured logical operation · 2d911f7c
      Hansang Bae authored
      Added missing code for the captured atomic operation.
      
      Differential Revision: https://reviews.llvm.org/D94848
      2d911f7c
    • Fraser Cormack's avatar
      [RISCV] Extend RVV VType info with the type's AVL (NFC) · 15fd6bae
      Fraser Cormack authored
      This patch factors out the "VLMax" operand passed to most
      scalable-vector ISel patterns into a property of each VType.
      
      This is seen as a preparatory change to allow RVV in the future to
      more easily support fixed-length vector types with constrained vector
      lengths, with the AVL operand set to the length of the fixed-length
      vector. It has no effect on the scalable code generation path.
      
      Reviewed By: HsiangKai
      
      Differential Revision: https://reviews.llvm.org/D94594
      15fd6bae
    • David Green's avatar
      [ARM] Add MVE add.sat costs · f373b309
      David Green authored
      This adds some basic MVE sadd_sat/ssub_sat/uadd_sat/usub_sat costs,
      based on when the instruction is legal. With smaller than legal types
      that are promoted we generate shr(qadd(shl, shl)), so the cost is 4
      appropriately.
      
      Differential Revision: https://reviews.llvm.org/D94958
      f373b309
    • Valentin Clement's avatar
      [flang][directive] Get rid of flangClassValue in TableGen · 6bd0a445
      Valentin Clement authored
      The TableGen emitter for directives has two slots for flangClass information and this was mainly
      to be able to keep up with the legacy openmp parser at the time. Now that all clauses are encapsulated in
      AccClause or OmpClause, these two strings are not necessary anymore and were the the source of couple
      of problem while working with the generic structure checker for OpenMP.
      This patch remove the flangClassValue string from DirectiveBase.td and use the string flangClass as the
      placeholder for the encapsulated class.
      
      Reviewed By: sameeranjoshi
      
      Differential Revision: https://reviews.llvm.org/D94821
      6bd0a445
    • Victor Huang's avatar
      [PowerPC] Fix the check for the instruction using FRSP/XSRSP output register · 909d6c86
      Victor Huang authored
      When performing peephole optimization to simplify the code, after removing
      passed FPSP/XSRSP instruction we will set any uses of that FRSP/XSRSP to the
      source of the FRSP/XSRSP.
      
      We are finding the machine instruction using virtual register holding FRSP/XSRSP
      results by searching all following instructions and encountering an issue
      that the first use of the virtual register is a debug MI causing:
      1. virtual register in the debug MI removed unexpectedly.
      2. virtual register used in non-debug MI not replaced with the source of
        FRSP/XSRSP. which stays in a undef status.
      
      This patch fix the issue by only searching non-debug machine instruction using
      virtual register holding FRSP/XSRSP results when the vr only has one non debug
      usage.
      
      Differential Revisien: https://reviews.llvm.org/D94711
      Reviewed by: nemanjai
      909d6c86
    • Raul Tambre's avatar
      [CMake] Remove dead code setting policies to NEW · 480643a9
      Raul Tambre authored
      cmake_minimum_required(VERSION) calls cmake_policy(VERSION),
      which sets all policies up to VERSION to NEW.
      LLVM started requiring CMake 3.13 last year, so we can remove
      a bunch of code setting policies prior to 3.13 to NEW as it
      no longer has any effect.
      
      Reviewed By: phosek, #libunwind, #libc, #libc_abi, ldionne
      
      Differential Revision: https://reviews.llvm.org/D94374
      480643a9
    • Utkarsh Saxena's avatar
      [clangd] Index local classes, virtual and overriding methods. · 8bf7116d
      Utkarsh Saxena authored
      Previously we did not record local class declarations. Now with features like
      findImplementation and typeHierarchy, we have a need to index such local
      classes to accurately report subclasses and implementations of methods.
      
      Performance testing results:
      - No changes in indexing timing.
      - No significant change in memory usage.
      - **1%** increase in #relations.
      - **0.17%** increase in #refs.
      - **0.22%** increase #symbols.
      
      **New index stats**
      Time to index: **4:13 min**
      memory usage **543MB**
      number of symbols: **521.5K**
      number of refs: **8679K**
      number of relations: **49K**
      
      **Base Index stats**
      Time to index: **4:15 min**
      memory usage **542MB**
      number of symbols: **520K**
      number of refs: **8664K**
      number of relations: **48.5K**
      
      Fixes: https://github.com/clangd/clangd/issues/644
      
      Differential Revision: https://reviews.llvm.org/D94785
      8bf7116d