1. Jun 19, 2020
    • Nemanja Ivanovic's avatar
      [PowerPC] Canonicalize shuffles to match more single-instruction masks on LE · 1fed1316
      Nemanja Ivanovic authored
      We currently miss a number of opportunities to emit single-instruction
      VMRG[LH][BHW] instructions for shuffles on little endian subtargets. Although
      this in itself is not a huge performance opportunity since loading the permute
      vector for a VPERM can always be pulled out of loops, producing such merge
      instructions is useful to downstream optimizations.
      Since VPERM is essentially opaque to all subsequent optimizations, we want to
      avoid it as much as possible. Other permute instructions have semantics that can
      be reasoned about much more easily in later optimizations.
      
      This patch does the following:
      - Canonicalize shuffles so that the first element comes from the first vector
        (since that's what most of the mask matching functions want)
      - Switch the elements that come from splat vectors so that they match the
        corresponding elements from the other vector (to allow for merges)
      - Adds debugging messages for when a shuffle is matched to a VPERM so that
        anyone interested in improving this further can get the info for their code
      
      Differential revision: https://reviews.llvm.org/D77448
      1fed1316
    • Carl Ritson's avatar
      AMDGPU/GlobalISel: Remove selection of MAD/MAC when not available · 8f3b2c8a
      Carl Ritson authored
      Add code to respect mad-mac-f32-insts target feature.
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D81990
      8f3b2c8a
    • LLVM GN Syncbot's avatar
      [gn build] Port 9ca50e88 · 9c9b71a2
      LLVM GN Syncbot authored
      9c9b71a2
    • Richard Smith's avatar
      More test cleanup for c36b03e3. · 6f9fe31c
      Richard Smith authored
      6f9fe31c
    • Yitzhak Mandelbaum's avatar
      [libTooling] Add parser for string representation of `RangeSelector`. · 9ca50e88
      Yitzhak Mandelbaum authored
      This patch adds a parser for a `RangeSelector` written as a string. The format
      is closely based on the way one would right the selector in C++. This should
      enable use of `RangeSelector`s from tools like clang-query and web UIs.
      9ca50e88
    • Richard Smith's avatar
      The type of a reference to a non-type template parameter pack should · c36b03e3
      Richard Smith authored
      not be a pack expansion type.
      
      Using a pack expansion type for a pack declaration makes sense, but
      general expressions should never have pack expansion types. If we have a
      pack `T *...V`, then the type of `V` is the type `T *`, which contains
      an unexpanded pack, and is a pointer type.
      
      This allows us to better diagnose issues where a template is invalid due
      to some non-dependent portion of a dependent type of a non-type template
      parameter pack.
      c36b03e3
    • Ties Stuij's avatar
      [BFloat] Move LLVMBFloatTypeKind to the end of the enum · 9dda41e4
      Ties Stuij authored
      Summary: so it doesn't change the C ABI
      
      Reviewers: deadalnix
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82135
      9dda41e4
    • peter klausler's avatar
      [flang] DATA statement processing (part 2/4): Initial images · 286d7a21
      peter klausler authored
      Summary:
      Defines a representation for the initialized memory image of
      a variable.  This image is populated by DATA statement
      processing as designator elements are put into correspondence
      with values, then converted into an initializer in the symbol
      table so that lowering can pass the initial image to the
      code generator.
      
      Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
      
      Reviewed By: tskeith
      
      Subscribers: mgorny, llvm-commits, flang-commits
      
      Tags: #flang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D82131
      286d7a21
    • Brad Smith's avatar
      0f92096c
    • Derek Schuff's avatar
      Set appropriate host defines for building under emscripten · c1709e5d
      Derek Schuff authored
      Emscripten has emulations for several headers found on Linux,
      including spwan.h and endian.h
      
      Differential Revision: https://reviews.llvm.org/D82121
      c1709e5d
    • Vitaly Buka's avatar
      [sanitizer] Update global_symbols.txt · 92f22259
      Vitaly Buka authored
      92f22259
    • Vitaly Buka's avatar
      [StackSafety] Add "Must Live" logic · fcd67665
      Vitaly Buka authored
      Summary:
      Extend StackLifetime with option to calculate liveliness
      where alloca is only considered alive on basic block entry
      if all non-dead predecessors had it alive at terminators.
      
      Depends on D82043.
      
      Reviewers: eugenis
      
      Reviewed By: eugenis
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82124
      fcd67665
    • Nathan James's avatar
      [NFC] Refactor Registry loops to range for · 8b0df1c1
      Nathan James authored
      8b0df1c1
    • Vitaly Buka's avatar
      [StackSafety] Add pass for StackLifetime testing · f672791e
      Vitaly Buka authored
      Summary: lifetime.ll is a copy of SafeStack/X86/coloring2.ll
      
      Reviewers: eugenis
      
      Reviewed By: eugenis
      
      Subscribers: hiraditya, mgrang, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82043
      f672791e
    • Brad Smith's avatar
      Hook up OpenBSD 64-bit PowerPC support · 3008609d
      Brad Smith authored
      3008609d
    • River Riddle's avatar
      [mlir][DialectConversion] Refactor how block argument types get converted · 8d67d187
      River Riddle authored
      This revision removes the TypeConverter parameter passed to the apply* methods, and instead moves the responsibility of region type conversion to patterns. The types of a region can be converted using the 'convertRegionTypes' method, which acts similarly to the existing 'applySignatureConversion'. This method ensures that all blocks within, and including those moved into, a region will have the block argument types converted using the provided converter.
      
      This has the benefit of making more of the legalization logic controlled by patterns, instead of being handled explicitly by the driver. It also opens up the possibility to support multiple type conversions at some point in the future.
      
      This revision also adds a new utility class `FailureOr<T>` that provides a LogicalResult friendly facility for returning a failure or a valid result value.
      
      Differential Revision: https://reviews.llvm.org/D81681
      8d67d187
    • Xiangling Liao's avatar
      [NFC] Cleanup of EmitCXXGlobalInitFunc() and EmitCXXGlobalDtorFunc() · ed1b5569
      Xiangling Liao authored
      Tidy up some code of EmitCXXGlobalInitFunc() and EmitCXXGlobalDtorFunc() as the
      pre-work of D74166 patch.
      
      Differential Revision: https://reviews.llvm.org/D81972
      ed1b5569
    • peter klausler's avatar
      [flang] DATA stmt processing (part 1/4): designator folding · d1862eb8
      peter klausler authored
      Summary:
      Add code to resolve constant Designators at compilation time
      into a base Symbol, byte offset, and field size.  This is used in
      later DATA statement processing to identify the static storage being
      initialized by each object in a DATA statement.  Also implement
      the reverse mapping so that Designators can be reconstructed for
      use in error messages about (e.g.) duplicate initializers.
      
      Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
      
      Reviewed By: PeteSteinfeld
      
      Subscribers: mgorny, llvm-commits, flang-commits
      
      Tags: #flang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D82125
      d1862eb8
    • Fangrui Song's avatar
    • Matt Arsenault's avatar
      ARC: Enforce function alignment at code emission time · bbd78519
      Matt Arsenault authored
      Don't do this in the MachineFunctionInfo constructor. Also, ensure the
      alignment rather than overwriting it outright. I vaguely remember
      there was another place to enforce the target minimum alignment, but I
      couldn't find it (it's there for instructions).
      bbd78519
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Implement computeKnownAlignForTargetInstr · 95605b78
      Matt Arsenault authored
      We probably need to move where intrinsics are lowered to copies to
      make this useful.
      95605b78
    • Matt Arsenault's avatar
      AMDGPU: Update private null pointer value in documentation · ae5adb8d
      Matt Arsenault authored
      Private pointers used to workaround IR semantics by artifically
      reserving an object at offset 0 so no user object would be allocated
      there. Since alloca now uses a non-0 address space, that workaround is
      unnecssary and 0 can be treated as a valid pointer.
      ae5adb8d
    • Matt Arsenault's avatar
      BypassSlowDivision: Fix dropping debug info · b13f6b0f
      Matt Arsenault authored
      I don't know anything about debug info, but this seems like more work
      should be necessary. This constructs a new IRBuilder and reconstructs
      the original divides rather than moving the original.
      
      One problem this has is if a div/rem pair are handled, both end up
      with the same debugloc. I'm not sure how to fix this, since this uses
      a cache when it sees the same input operands again, which will have
      the first instance's location attached.
      b13f6b0f
    • peter klausler's avatar
      [flang] Roll up small fixes to runtime bugs found in testing · 27505565
      peter klausler authored
      Summary:
      Fix several bugs in the Fortran runtime found in initial
      testing.
      
      Reviewers: tskeith, PeteSteinfeld, sscalpone, jdoerfert, DavidTruby
      
      Reviewed By: tskeith, PeteSteinfeld
      
      Subscribers: llvm-commits, flang-commits
      
      Tags: #flang, #llvm
      
      Differential Revision: https://reviews.llvm.org/D82116
      27505565
    • Amy Kwan's avatar
      [PowerPC][Power10] Implement Parallel Bits Deposit/Extract Builtins in LLVM/Clang · c45c1611
      Amy Kwan authored
      This patch implements builtins for the following prototypes:
      
      vector unsigned long long vec_pdep(vector unsigned long long, vector unsigned long long);
      vector unsigned long long vec_pext(vector unsigned long long, vector unsigned long long __b);
      unsigned long long __builtin_pdepd (unsigned long long, unsigned long long);
      unsigned long long __builtin_pextd (unsigned long long, unsigned long long);
      
      Revision Depends on D80758
      
      Differential Revision: https://reviews.llvm.org/D80935
      c45c1611
    • Matt Arsenault's avatar
      GlobalISel: Fix some artifact combiner worklist inconsistencies · 2ec1267e
      Matt Arsenault authored
      In one case, UpdateDefs was not getting set and a dead SmallVector
      constructed. In another, it was adding new vreg defs to the updated
      set which should be unnecessary. This also wasn't considering the
      multiple defs of G_UNMERGE_VALUES.
      
      Also increase the small vector sizes for merge/unmerge operands to the
      usual semi-arbitrary 8. While debugging these, I'm usually seeing
      merges and unmerges with at least 4 uses/defs.
      
      I haven't run into an actual problem from any of these though.
      2ec1267e
    • Matt Arsenault's avatar
      GlobalISel: Pass LegalizerHelper to custom legalize callbacks · 7f8b2e1b
      Matt Arsenault authored
      This was passing in all the parameters needed to construct a
      LegalizerHelper in the custom legalization, when it's simpler to just
      pass in the existing helper.
      
      This is slightly more annoying to use in the common case where you
      don't need the legalizer helper, but we could add back the common
      parameters back in addition to the helper.
      
      I didn't propagate this to all the internal target changes that this
      logically implies, but did update a sample one for
      legalizeMinNumMaxNum.
      
      This is in preparation for moving AMDGPU load/store legalization
      entirely into custom lowering. The current set of legalization actions
      is really constraining and not really capable of expressing all the
      actions needed to legalize loads/stores. In particular there's no way
      to express when the memory access itself needs to change size vs. the
      result type. There's also a lot of redundancy since the same
      split/widen actions need to be applied in both vector and scalar
      cases. All of the sub-cases logically belong as steps in the legalizer
      helper, but it will be easier to consider everything at once in custom
      lowering.
      7f8b2e1b
    • Vedant Kumar's avatar
      [docs] Specify rules for updating debug locations · b4459b59
      Vedant Kumar authored
      Summary:
      Restructure HowToUpdateDebugInfo.rst to specify rules for when
      transformations should preserve, merge, or drop debug locations.
      
      The goal is to have clear, well-justified rules that come with a few
      examples and counter-examples, so that pass authors can pick the best
      strategy for managing debug locations depending on the specific task at
      hand.
      
      I've tried to set down sensible rules here that mostly align with what
      we already do in llvm today, and that take a diverse set of use cases
      into account (interactive debugging, crash triage, SamplePGO).
      
      Please *do* try to pick these rules apart and suggest clarifications or
      improvements :).
      
      Side note: Prior to 24660ea1, this document was structured as a long
      list of very specific code transformations -- the idea being that we
      would fill in what to do in each specific case. I chose to reorganize
      the document as a list of actions to take because it drastically cuts
      down on the amount of redundant exposition/explanation needed. I hope
      that's fine...
      
      Reviewers: jmorse, aprantl, dblaikie
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D81198
      b4459b59
    • Jonas Devlieghere's avatar
      [Sphinx] Adjust for source_parsers deprecation in Sphinx 3.0 · 9989e816
      Jonas Devlieghere authored
      Update the Sphinx configuration for the removal of source_parsers in
      Sphinx 3.0. The variable has been deprecated since version 1.8.
      
      > Version 1.8 deprecates and version 3.0 removes the source_parsers
      > configuration variable that was used by older recommonmark versions.
      
      https://www.sphinx-doc.org/en/master/usage/markdown.html
      
      Differential revision: https://reviews.llvm.org/D75284
      9989e816
    • Alex Zinenko's avatar
      [mlir] Update Toy tutorial to use callback-based loop constructors · 68628c94
      Alex Zinenko authored
      We recently introduced support for building loops or loop nests using callbacks
      that populate the body. Use these in the tutorial instead of setInsertionPoint
      manipulations.
      
      Differential Revision: https://reviews.llvm.org/D82104
      68628c94
    • Alex Zinenko's avatar
      [mlir] Refactor affine loop nest builders · 8647a9bc
      Alex Zinenko authored
      Existing implementation of affine loop nest builders relies on EDSC
      ScopedContext, which is not used pervasively. Provide a common OpBuilder-based
      helper function to construct a perfect nest of affine loops with the body of
      the innermost loop populated by a callback. Use this function to implement the
      EDSC version.
      
      Affine "for" loops differ from SCF "for" loops by (1) not allowing to yield
      values and (2) supporting short-hand form for constant bounds, which justifies
      a separate implementation of the loop nest builder for the same of simplicity.
      
      Differential Revision: https://reviews.llvm.org/D81955
      8647a9bc
    • River Riddle's avatar
      [mlir] Allow for patterns to match any root kind. · 80d7ac3b
      River Riddle authored
      Traditionally patterns have always had the root operation kind hardcoded to a specific operation name. This has worked well for quite some time, but it has certain limitations that make it undesirable. For example, some lowering have the same implementation for many different operations types with a few lowering entire dialects using the same pattern implementation. This problem has led to several "solutions":
      a) Provide a template implementation to the user so that they can instantiate it for each operation combination, generally requiring the inclusion of the auto-generated operation definition file.
      b) Use a non-templated pattern that allows for providing the name of the operation to match
        - No one ever does this, because enumerating operation names can be cumbersome and so this quickly devolves into solution a.
      
      This revision removes the restriction that patterns have a hardcoded root type, and allows for a class patterns that could match "any" operation type. The major downside of root-agnostic patterns is that they make certain pattern analyses more difficult, so it is still very highly encouraged that an operation specific pattern be used whenever possible.
      
      Differential Revision: https://reviews.llvm.org/D82066
      80d7ac3b
    • River Riddle's avatar
      [mlir] Refactor RewritePatternMatcher into a new PatternApplicator class. · 3e98fbf4
      River Riddle authored
      This class enables for abstracting more of the details for the rewrite process, and will allow for clients to apply specific cost models to the pattern list. This allows for DialectConversion and the GreedyPatternRewriter to share the same underlying matcher implementation. This also simplifies the plumbing necessary to support dynamic patterns.
      
      Differential Revision: https://reviews.llvm.org/D81985
      3e98fbf4
    • Shuhong Liu's avatar
      [AIX] Split lit test shtest-format into two separate tests and add AIX as... · af8aee7c
      Shuhong Liu authored
      [AIX] Split lit test shtest-format into two separate tests and add AIX as UNSUPPORTED for shtest-format-argv0
      
      Summary: lit test `shtest-format.py` fails on AIX  because one of the subtest of shtest-format requires the tool `[` to be installed under the system PATH. For AIX, `[` is only available as a shell builtin and does not present as an executable file under PATH. Hence, split the original shtest-format into two separate test files and added AIX as UNSUPPORTED for the test using `[` .
      
      Reviewers: daltenty, hubert.reinterpretcast
      
      Reviewed By: hubert.reinterpretcast
      
      Subscribers: delcypher, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82100
      af8aee7c
    • aartbik's avatar
      [mlir] [integration-test] [LLVMIR] Add reduction intrinsic tests · 01277bc9
      aartbik authored
      Reviewers: ftynse, nicolasvasilache, reidtatge
      
      Reviewed By: nicolasvasilache
      
      Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
      
      Tags: #mlir
      
      Differential Revision: https://reviews.llvm.org/D82117
      01277bc9
    • Christopher Tetreault's avatar
      [SVE] Remove calls to VectorType::getNumElements from Transforms/Utils · 8d11ec66
      Christopher Tetreault authored
      Reviewers: efriedma, c-rhodes, david-arm, Tyker, asbirlea
      
      Reviewed By: david-arm
      
      Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D82057
      8d11ec66
    • Yaxun (Sam) Liu's avatar
      [HIP] Enable -amdgpu-internalize-symbols · c830d517
      Yaxun (Sam) Liu authored
      Enable -amdgpu-internalize-symbols to eliminate unused functions and global variables
      for whole program to speed up compilation and improve performance.
      
      For -fno-gpu-rdc, -amdgpu-internalize-symbols is passed to clang -cc1.
      
      For -fgpu-rdc, -amdgpu-internalize-symbols is passed to lld.
      
      Differential Revision: https://reviews.llvm.org/D81959
      c830d517
    • Thomas Raoux's avatar
      [mlir][vulkan-runner] add support for memref of i8, i16 types in vulkan runner · afd43a7a
      Thomas Raoux authored
      This extends the types supported as kernel arguments when using vulkan runner.
      
      Differential Revision: https://reviews.llvm.org/D82068
      afd43a7a
    • Alexandre Ganea's avatar
      [CodeView] Revert 8374bf43 and... · 2ae0df5b
      Alexandre Ganea authored
      [CodeView] Revert 8374bf43 and 403f9537
      
      This reverts:
      8374bf43 [CodeView] Fix generated command-line expansion in LF_BUILDINFO. Fix the 'pdb' entry which was previously a null reference, now an empty string.
      403f9537 [CodeView] Add full repro to LF_BUILDINFO record
      
      This is causing the lld/test/COFF/pdb-relative-source-lines.test to fail: http://lab.llvm.org:8011/builders/lld-x86_64-win/builds/1096/steps/test-check-all/logs/FAIL%3A%20lld%3A%3Apdb-relative-source-lines.test
      And clang/test/CodeGen/debug-info-codeview-buildinfo.c fails as well: http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/33346/steps/ninja%20check%201/logs/FAIL%3A%20Clang%3A%3Adebug-info-codeview-buildinfo.c
      2ae0df5b
    • Sam Clegg's avatar
      [lld][WebAssembly] Allow ctors functions that return values · 21e14cce
      Sam Clegg authored
      Some projects use the constructor attribute on functions that also
      return values.  In this case we just ignore them.
      
      The error was reported in the libgpg-error project that marks
      gpg_err_init with the `__constructor__` attribute.
      
      Differential Revision: https://reviews.llvm.org/D81962
      21e14cce