1. Sep 26, 2021
    • Jon Chesterfield's avatar
      [libomptarget][amdgpu] Destruct HSA queues · 8cf93a35
      Jon Chesterfield authored
      Store queues in unique_ptr so they are destroyed when the global DeviceInfo is. Currently they leak which raises an assert in debug builds of hsa.
      
      Reviewed By: pdhaliwal
      
      Differential Revision: https://reviews.llvm.org/D109511
      8cf93a35
    • Sanjay Patel's avatar
      [InstCombine] move add after min/max intrinsic · 6063e6b4
      Sanjay Patel authored
      This is another regression noted with the proposal to canonicalize
      to the min/max intrinsics in D98152.
      
      Here are Alive2 attempts to show correctness without specifying
      exact constants:
      https://alive2.llvm.org/ce/z/bvfCwh (smax)
      https://alive2.llvm.org/ce/z/of7eqy (smin)
      https://alive2.llvm.org/ce/z/2Xtxoh (umax)
      https://alive2.llvm.org/ce/z/Rm4Ad8 (umin)
      (if you comment out the assume and/or no-wrap, you should see failures)
      
      The different output for the umin test is due to a fold added with
      c4fc2cb5 :
      
      // umin(x, 1) == zext(x != 0)
      
      We probably want to adjust that, so it applies more generally
      (umax --> sext or patterns where we can fold to select-of-constants).
      Some folds that were ok when starting with cmp+select may increase
      instruction count for the equivalent intrinsic, so we have to decide
      if it's worth altering a min/max.
      
      Differential Revision: https://reviews.llvm.org/D110038
      6063e6b4
    • Simon Pilgrim's avatar
      [CostModel][X86] Improve AVX1/AVX2 v16i32->v16i16/v16i8 truncation costs (PR51972) · 3538ee76
      Simon Pilgrim authored
      Based off worst case btver2 (AVX1) and haswell (AVX2) llvm-mca reports
      3538ee76
    • Michael Kruse's avatar
      [Polly] Support for InlineAsm. · 9820dd97
      Michael Kruse authored
      Inline assembly was not handled at all and treated like a llvm::Value.
      In particular, it tried to create a pointer it which is not allowed.
      
      Fix by handling like a llvm::Constant such that it is just reused when
      required, instead of trying to marshall it in memory.
      
      Fixes llvm.org/PR51960
      9820dd97
    • Michael Kruse's avatar
      [Polly] Use VirtualUse to determine references. · d5c87162
      Michael Kruse authored
      VirtualUse ensures consistency over different source of values with
      Polly. In particular, this enables its use of instructions moved between
      Statement. Before the patch, the code wrongly assumed that the BB's
      instructions are also the ScopStmt's instructions. Reference are
      determined for OpenMP outlining and GPGPU kernel extraction.
      
      GPGPU CodeGen had some problems. For one, it generated GPU kernel
      parameters for constants. Second, it emitted GPU-side invariant loads
      which have already been loaded by the host. This has been partially
      fixed, it still generates a store for the invariant load result, but
      using the value that the host has already written.
      
      WARNING: I did not test the generated PollyACC code on an actual GPU.
      
      The improved consistency will be made use of in the next patch.
      d5c87162
    • Michael Kruse's avatar
      [Polly] Remove isConstCall. · 1cea25ee
      Michael Kruse authored
      The function was intended to catch OpenMP functions such as
      get_thread_id(). If matched, the call would be considered synthesizable.
      
      There were a few problems with this:
      
       * get_thread_id() is not 'const' in the sense of have the gcc manual
         defines it: "do not examine any values except their arguments".
         get_thread_id() reads OpenCL runtime libreary global state.
         What was inteded was probably 'speculable'.
      
       * isConstCall was implemented using mayReadOrWriteMemory(). 'const' is
         stricter than that, mayReadOrWriteMemory is e.g. true for malloc(),
         since it may only read/write addresses that are considered
         inaccessible fro the application. However, malloc is certainly not
         speculable.
      
       * Values that are isConstCall were not handled consistently throughout
         Polly. In particular, it was not considered for referenced values
         (OpenMP outlining and PollyACC).
      
      Fix by removing special handling for isConstCall entirely.
      1cea25ee
    • Alexandre Rames's avatar
      [ADT] Add trailing comma on TYPED_TEST_SUITE · e21b0ba8
      Alexandre Rames authored
      This avoids a -pedantic warning:
      warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
      
      See also https://github.com/google/googletest/issues/2271
      
      Reviewed By: arames, bkramer
      
      Differential Revision: https://reviews.llvm.org/D110283
      e21b0ba8
    • Mehdi Amini's avatar
      MLIR can't support -Bsymbolic link option, fail at CMake time with a helpful... · c3aed0d3
      Mehdi Amini authored
      MLIR can't support -Bsymbolic link option, fail at CMake time with a helpful message instead of broken runtime
      
      Differential Revision: https://reviews.llvm.org/D110483
      c3aed0d3
    • Lang Hames's avatar
      [ORC] Wait for handleDisconnect to complete in SimpleRemoteEPC::disconnect. · 320832cc
      Lang Hames authored
      Disconnect should block until handleDisconnect completes, otherwise we might
      destroy the SimpleRemoteEPC instance while it's still in use.
      
      Thanks to Dave Blaikie for helping me track this down.
      320832cc
    • Lang Hames's avatar
      [ORC] Fix uninitialized variable. · 03710492
      Lang Hames authored
      Spotted by Dave Blaikie. Thanks Dave!
      03710492
    • Fangrui Song's avatar
      [ELF] Remove unneeded binding parameter from addOptionalRegular. NFC · db6a00da
      Fangrui Song authored
      __rela_iplt_start uses spurious STB_WEAK, but it doesn't matter because STV_HIDDEN overrides the binding.
      db6a00da
    • Fangrui Song's avatar
      [ELF] Replace noneRel = R_*_NONE with static constexpr. NFC · d23fd8ae
      Fangrui Song authored
      All architectures define R_*_NONE to 0.
      d23fd8ae
    • Fangrui Song's avatar
      [ELF] Default gotBaseSymInGotPlt to false (NFC for most architectures) · 40cd4db4
      Fangrui Song authored
      Most architectures use .got instead of .got.plt, so switching the default can
      minimize customization.
      
      This fixes an issue for SPARC V9 which uses .got .
      AVR, AMDGPU, and MSP430 don't seem to use _GLOBAL_OFFSET_TABLE_.
      40cd4db4
    • Nikita Popov's avatar
      [AA] Move earliest escape tracking from DSE to AA · ba664d90
      Nikita Popov authored
      This is a followup to D109844 (and alternative to D109907), which
      integrates the new "earliest escape" tracking into AliasAnalysis.
      This is done by replacing the pre-existing context-free capture
      cache in AAQueryInfo with a replaceable (virtual) object with two
      implementations: The SimpleCaptureInfo implements the previous
      behavior (check whether object is captured at all), while
      EarliestEscapeInfo implements the new behavior from DSE.
      
      This combines the "earliest escape" analysis with the full power of
      BasicAA: It subsumes the call handling from D109907, considers a
      wider range of escape sources, and works with AA recursion. The
      compile-time cost is slightly higher than with D109907.
      
      Differential Revision: https://reviews.llvm.org/D110368
      ba664d90
    • Nikita Popov's avatar
      [DSE] Make capture check more precise · 327bbbb1
      Nikita Popov authored
      It is sufficient that the object has not been captured before the
      load that produces the pointer we're loading. A capture after that
      can not affect the already loaded pointer.
      
      This is small part of D110368 applied separately.
      327bbbb1
    • Nikita Popov's avatar
      [BasicAA] Don't consider Argument as escape source (NFCI) · 1c3859f3
      Nikita Popov authored
      The case of an Argument and an identified function local is already
      handled earlier, because we don't care about captures in that case.
      As such, we don't need to additionally consider the combination of
      an Argument with a non-escaping identified function local.
      
      This ensures that isEscapeSource() only returns true for
      instructions, which is necessary for D110368.
      1c3859f3
    • Lang Hames's avatar
      [ORC-RT] ExecutorAddrDiff ergonomic improvements; contains and overlaps methods · 897eb579
      Lang Hames authored
      Renames StartAddress and EndAddress members to Start and End.
      
      Adds contains and overlap methods.
      
      Adds a constructor from an address and size.
      
      These changes are counterparts to LLVM commits ef391df2, c0d88999, and
      37f1b7a3.
      897eb579
    • Fangrui Song's avatar
      [ELF][test] Improve test coverage · a892c0e4
      Fangrui Song authored
      a892c0e4
    • Lang Hames's avatar
      Revert "[ORC] Introduce EPCGenericRTDyldMemoryManager." · 99951a56
      Lang Hames authored
      This reverts commit bef55a2b while I investigate
      failures on some bots. Also reverts "[lli] Add ChildTarget dependence on
      OrcTargetProcess library." (7a219d80) which was
      a fallow-up to bef55a2b.
      99951a56
    • Lang Hames's avatar
      [lli] Add ChildTarget dependence on OrcTargetProcess library. · 7a219d80
      Lang Hames authored
      ChildTarget depends on OrcTargetProcess after bef55a2b.
      7a219d80
    • Lang Hames's avatar
      [ORC] Introduce EPCGenericRTDyldMemoryManager. · bef55a2b
      Lang Hames authored
      EPCGenericRTDyldMemoryMnaager is an EPC-based implementation of the
      RuntimeDyld::MemoryManager interface. It enables remote-JITing via EPC (backed
      by a SimpleExecutorMemoryManager instance on the executor side) for RuntimeDyld
      clients.
      
      The lli and lli-child-target tools are updated to use SimpleRemoteEPC and
      SimpleRemoteEPCServer (rather than OrcRemoteTargetClient/Server), and
      EPCGenericRTDyldMemoryManager for MCJIT tests.
      
      By enabling remote-JITing for MCJIT and RuntimeDyld-based ORC clients,
      EPCGenericRTDyldMemoryManager allows us to deprecate older remote-JITing
      support, including OrcTargetClient/Server, OrcRPCExecutorProcessControl, and the
      Orc RPC system itself. These will be removed in future patches.
      bef55a2b
    • Simon Pilgrim's avatar
      [DAG] ReduceLoadOpStoreWidth - replace getABITypeAlign with allowsMemoryAccess (PR45116) · 18c8ed54
      Simon Pilgrim authored
      One of the cases identified in PR45116 - we don't need to limit store narrowing to ABI alignment, we can use allowsMemoryAccess - which tests using getABITypeAlign, but also checks if a target permits (fast) misaligned memory access by checking allowsMisalignedMemoryAccesses as a fallback.
      18c8ed54
    • mydeveloperday's avatar
      [clang-format] Left/Right alignment fixer can cause false positive... · c2ec5dd2
      mydeveloperday authored
      [clang-format] Left/Right alignment fixer can cause false positive replacements when they don't actually change anything
      
      Earlier during the development of {D69764} I felt it was no longer necessary to
      ensure we were not trying to change code which didn't need to change
      and we felt this could be removed, however I'd like to bring this back for now
      as I am seeing some false positives in terms of the "replacements"
      
      What I see is the generation of a replacement which is a "No Op" on the original
      code, I think this comes about because of the merging of replacements:
      
      ```
      static const a;
      ->
      const static a;
      ->
      static const a;
      ```
      
      The replacements don't really merge, in such a way as to identify when we have gone
      back to the original
      
      Also remove the Penalty as I'm not using it (and it became marked as set and no used,
      I'd rather get rid of it if it means nothing)
      
      I think we need to do this step for now, as many people use the --output-replacements-xml
      to identify that the file "needs a clang-format"
      
      The same can be seen with the -n or --dry-run option as this uses the replacements
      to drive the error/warning output.
      
      Reviewed By: HazardyKnusperkeks
      
      Differential Revision: https://reviews.llvm.org/D110392
      c2ec5dd2
  2. Sep 25, 2021