1. Jan 27, 2021
    • Adhemerval Zanella's avatar
      [ARM] [ELF] Fix ARMMaterializeGV for Indirect calls · dad55c22
      Adhemerval Zanella authored
      Recent shouldAssumeDSOLocal changes (introduced by 961f31d8)
      do not take in consideration the relocation model anymore.  The ARM
      fast-isel pass uses the function return to set whether a global symbol
      is loaded indirectly or not, and without the expected information
      llvm now generates an extra load for following code:
      
      ```
      $ cat test.ll
      @__asan_option_detect_stack_use_after_return = external global i32
      define dso_local i32 @main(i32 %argc, i8** %argv) #0 {
      entry:
        %0 = load i32, i32* @__asan_option_detect_stack_use_after_return,
      align 4
        %1 = icmp ne i32 %0, 0
        br i1 %1, label %2, label %3
      
      2:
        ret i32 0
      
      3:
        ret i32 1
      }
      
      attributes #0 = { noinline optnone }
      
      $ lcc test.ll -o -
      [...]
      main:
              .fnstart
      [...]
              movw    r0, :lower16:__asan_option_detect_stack_use_after_return
              movt    r0, :upper16:__asan_option_detect_stack_use_after_return
              ldr     r0, [r0]
              ldr     r0, [r0]
              cmp     r0, #0
      [...]
      ```
      
      And without 'optnone' it produces:
      ```
      [...]
      main:
              .fnstart
      [...]
              movw    r0, :lower16:__asan_option_detect_stack_use_after_return
              movt    r0, :upper16:__asan_option_detect_stack_use_after_return
              ldr     r0, [r0]
              clz     r0, r0
              lsr     r0, r0, #5
              bx      lr
      
      [...]
      ```
      
      This triggered a lot of invalid memory access in sanitizers for
      arm-linux-gnueabihf.  I checked this patch both a stage1 built with
      gcc and a stage2 bootstrap and it fixes all the Linux sanitizers
      issues.
      
      Reviewed By: MaskRay
      
      Differential Revision: https://reviews.llvm.org/D95379
      dad55c22
    • Craig Topper's avatar
      [RISCV] Have customLegalizeToWOp truncate to the original type instead of i32... · f9d7f772
      Craig Topper authored
      [RISCV] Have customLegalizeToWOp truncate to the original type instead of i32 now that we use it for i8/i16 as well.
      
      239cfbcc add support for legalizing
      i8/i16 UDIV/UREM/SDIV to use *W instructions. So we need to truncate
      to i8/i16 if we're legalizing one of those.
      f9d7f772
    • Eric Schweitz's avatar
      [mlir] sret and byval now require a type argument when constructed. · 1d6df1fc
      Eric Schweitz authored
      Fixes the LLVM code gen bugs and adds the missing tests.
      
      Reviewed By: ftynse
      
      Differential Revision: https://reviews.llvm.org/D95378
      1d6df1fc
    • Julian Lettner's avatar
      Reland "[lit] Use os.cpu_count() to cleanup TODO" · 302432f7
      Julian Lettner authored
      The initial problem with the remaining bot config was resolved.
      
      We can now use Python3.  Let's use `os.cpu_count()` to cleanup this
      helper.
      
      Differential Revision: https://reviews.llvm.org/D94734
      302432f7
    • Raphael Isemann's avatar
      [lldb][NFC] Another attempt to fix GCC 5.x compilation · 48e09faa
      Raphael Isemann authored
      37510f69 tried to fix GCC 5.x compilation
      by making the enum which is used as a unordered_map key unscoped. However it
      seems that in GCC 5.x, enum keys are not supported *at all* in unordered_maps
      (at least that's what some trial&error on godbolt tells me). This updates the
      workaround to just use an int until GCC 5.x support is dropped.
      48e09faa
    • Christian Sigg's avatar
      [mlir] Set CUDA/ROCm context before creating resources. · 8262cd8a
      Christian Sigg authored
      The current context is thread-local state, and in preparation of GPU async execution (on multiple threads) we need to set the context before calling API that create resources.
      
      Reviewed By: herhut
      
      Differential Revision: https://reviews.llvm.org/D94495
      8262cd8a
    • Matt Arsenault's avatar
      AMDGPU: Fix redundant FP spilling/assert in some functions · 5f9707b7
      Matt Arsenault authored
      If a function has stack objects, and a call, we require an FP. If we
      did not initially have any stack objects, and only introduced them
      during PrologEpilogInserter for CSR VGPR spills, SILowerSGPRSpills
      would end up spilling the FP register as if it were a normal
      register. This would result in an assert in a debug build, or
      redundant handling of the FP register in a release build.
      
      Try to predict that we will have an FP later, although this is ugly.
      5f9707b7
    • Matt Arsenault's avatar
      AMDGPU: Add assertion to determineCalleeSaves · 92d1195b
      Matt Arsenault authored
      Make sure this isn't getting called multiple times. I was surprised we
      were modifying the function here, which I think is a bit questionable.
      92d1195b
    • Shilei Tian's avatar
      [OpenMP][deviceRTLs] Build the deviceRTLs with OpenMP instead of target dependent language · 7c03f7d7
      Shilei Tian authored
      From this patch (plus some landed patches), `deviceRTLs` is taken as a regular OpenMP program with just `declare target` regions. In this way, ideally, `deviceRTLs` can be written in OpenMP directly. No CUDA, no HIP anymore. (Well, AMD is still working on getting it work. For now AMDGCN still uses original way to compile) However, some target specific functions are still required, but they're no longer written in target specific language. For example, CUDA parts have all refined by replacing CUDA intrinsic and builtins with LLVM/Clang/NVVM intrinsics.
      Here're a list of changes in this patch.
      1. For NVPTX, `DEVICE` is defined empty in order to make the common parts still work with AMDGCN. Later once AMDGCN is also available, we will completely remove `DEVICE` or probably some other macros.
      2. Shared variable is implemented with OpenMP allocator, which is defined in `allocator.h`. Again, this feature is not available on AMDGCN, so two macros are redefined properly.
      3. CUDA header `cuda.h` is dropped in the source code. In order to deal with code difference in various CUDA versions, we build one bitcode library for each supported CUDA version. For each CUDA version, the highest PTX version it supports will be used, just as what we currently use for CUDA compilation.
      4. Correspondingly, compiler driver is also updated to support CUDA version encoded in the name of bitcode library. Now the bitcode library for NVPTX is named as `libomptarget-nvptx-cuda_[cuda_version]-sm_[sm_number].bc`, such as `libomptarget-nvptx-cuda_80-sm_20.bc`.
      
      With this change, there are also multiple features to be expected in the near future:
      1. CUDA will be completely dropped when compiling OpenMP. By the time, we also build bitcode libraries for all supported SM, multiplied by all supported CUDA version.
      2. Atomic operations used in `deviceRTLs` can be replaced by `omp atomic` if OpenMP 5.1 feature is fully supported. For now, the IR generated is totally wrong.
      3. Target specific parts will be wrapped into `declare variant` with `isa` selector if it can work properly. No target specific macro is needed anymore.
      4. (Maybe more...)
      
      Reviewed By: JonChesterfield
      
      Differential Revision: https://reviews.llvm.org/D94745
      7c03f7d7
    • Dave Lee's avatar
      [lldb] Remove unused ThreadPlanStack::GetStackOfKind (NFC) · 90b8ae01
      Dave Lee authored
      This function isn't used.
      
      Differential Revision: https://reviews.llvm.org/D95411
      90b8ae01
    • Kadir Cetinkaya's avatar
      [clangd] Add std::size_t to StdSymbol mapping · 9190f17a
      Kadir Cetinkaya authored
      This is a common symbol that's missing from our mapping because
      cppreference yields multiple headers.
      
      Add it manually by picking cstddef to prevent insertion of some stdlib-internal
      headers instead.
      
      Fixes https://github.com/clangd/clangd/issues/666.
      
      Differential Revision: https://reviews.llvm.org/D95423
      9190f17a
    • Alex Zinenko's avatar
      [mlir] Add Python bindings for IntegerSet · b208e5bc
      Alex Zinenko authored
      This follows up on the introduction of C API for the same object and is similar
      to AffineExpr and AffineMap.
      
      Reviewed By: stellaraccident
      
      Differential Revision: https://reviews.llvm.org/D95437
      b208e5bc
    • Sanjay Patel's avatar
      [LoopVectorize] add test for fmin/fmax FMF propagation; NFC · 00773ef7
      Sanjay Patel authored
      The existing test has less FMF than we might expect if
      our FMF was fixed (on all FP values), so this additional
      test is intended to check propagation in a more "normal"
      example.
      00773ef7
    • Sanjay Patel's avatar
      [LoopUtils] do not initialize Cmp predicate unnecessarily; NFC · 09b1c563
      Sanjay Patel authored
      The switch must set the predicate correctly; anything else
      should lead to unreachable/assert.
      
      I'm trying to fix FMF propagation here and the callers,
      so this is a preliminary cleanup.
      09b1c563
    • Simon Pilgrim's avatar
      Fix null dereference static analysis warning. NFCI. · 879c12d9
      Simon Pilgrim authored
      Replace cast_or_null<> with cast<> as we immediately dereference the pointer afterward so we're not expecting a null pointer.
      879c12d9
    • Simon Pilgrim's avatar
      [AMDGPU] HSAMD::fromString - replace std::string arg with StringRef. NFCI. · f82cff31
      Simon Pilgrim authored
      Removes an unnecessary chain of StringRef -> std::string -> StringRef conversions
      f82cff31
    • Mircea Trofin's avatar
      0c0d009a
    • Alexander Belyaev's avatar
  2. Jan 26, 2021