1. Apr 11, 2023
    • Aiden Grossman's avatar
      [Docs][llvm-exegesis] Add documentation for --use-dummy-perf-counters · c19bc611
      Aiden Grossman authored
      This patch adds in documentation for the --use-dummy-perf-counters
      option (introduced in D146301).
      
      Reviewed By: kpdev42
      
      Differential Revision: https://reviews.llvm.org/D147842
      c19bc611
    • ziqingluo-90's avatar
      [-Wunsafe-buffer-usage] Improve fix-its for local variable declarations with... · 63413015
      ziqingluo-90 authored
      [-Wunsafe-buffer-usage] Improve fix-its for local variable declarations with null pointer initializers
      
      For a local pointer declaration of the form `T * p = 0` or `T * p = std::nullptr`,
      
      Before this patch, we generate fix-its that convert the declaration to
      `std::span<T> p{nullptr, <# placeholder #>}`, in cases where `p` is
      used in some unsafe operations.  This patch improves the fix-its to
      result in a simpler form `std::span<T> p`. It gets rid of the
      placeholder and keeps the result concise.
      
      Reviewed by: NoQ (Artem Dergachev)
      
      Differential Revision: https://reviews.llvm.org/D143680
      63413015
    • Jordan Rupprecht's avatar
      [bazel][NFC] Replace @bazel_tools//src/conditions with equivalent @platforms rules · 5e57f1bf
      Jordan Rupprecht authored
      Followup to D147354. Using src/conditions is discouraged in favor of using rules from the `@platforms` repository directly.
      
      This replaces three conditions:
      * `@bazel_tools//src/conditions:windows` -> `@platforms//os:windows`
      * `@bazel_tools//src/conditions:darwin` -> `@platforms//os:macos`
      * `@bazel_tools//src/conditions:freebsd` -> `@platforms//os:freebsd`
      
      `llvm/config.bzl` has a non-trivial OS+CPU selection config, so that is omitted from this patch. There is intentionally no equivalent for that in `@platforms` because every project will have their own opinions about what a platform is, and it is not feasible for the bazel selection list to include every possible combination. The recommended idiom there is for projects to define their own supported platforms list, e.g. in a separate BUILD file or platform mapping.
      
      Reviewed By: GMNGeoffrey
      
      Differential Revision: https://reviews.llvm.org/D147948
      5e57f1bf
    • Craig Topper's avatar
      [TableGen] Simplify how commuted variants are generated in GenerateVariantsOf. NFC · 6de3afea
      Craig Topper authored
      We don't need to copy the ChildVariants vector into a new vector.
      We're using std::move on every entry we copy so they clearly
      aren't needed again. We can swap entries in the vector and reuse
      it instead.
      6de3afea
    • Nico Weber's avatar
      [gn build] Port eb65912e · 18777c7b
      Nico Weber authored
      18777c7b
    • Changpeng Fang's avatar
      AMDGPU: Created a subclass for the return address operand in the tail call return instruction · 3bc1e084
      Changpeng Fang authored
      Summary:
        This is to avoid using the callee saved registers for the return address
      of the tail call return instruction.
      
      Reviewers:
        arsenm, cdevadas
      
      Differential Revision:
        https://reviews.llvm.org/D147096
      3bc1e084
    • Paul Kirth's avatar
      [clang][driver] Pass `-femulated-tls` through to the linker in LTO mode · a78816a6
      Paul Kirth authored
      Currently the driver does not propagate the `-f[no-]emulated-tls` flags
      to the linker under LTO. This can be surprising when the platform
      defaults differ from the flags being passed. A related discussion can be
      found in https://reviews.llvm.org/D143619. While the focus there was
      RISC-V support, the root cause was that setting `-femualted-tls` and
      `-flto` when compiling with Clang resulted in missing symbols because
      the platform defaults for Android differed from the flags being passed
      to Clang.
      
      This patch changes the Clang driver's behavior to pass the emulated-tls
      flags through to the linker when compiling with LTO/ThinLTO.
      
      Reviewed By: phosek, vit9696
      
      Differential Revision: https://reviews.llvm.org/D147834
      a78816a6
    • Nikolas Klauser's avatar
      [libc++] Move __errc to __system_error/errc.h · eb65912e
      Nikolas Klauser authored
      This file was added before we started granularizing the headers, but is essentially just a granularized header. This moves the header to the correct place.
      
      Reviewed By: #libc, EricWF
      
      Spies: libcxx-commits, arichardson, mikhail.ramalho
      
      Differential Revision: https://reviews.llvm.org/D146395
      eb65912e
    • Augusto Noronha's avatar
      [lldb] Implement SymbolFile::GetCompileOptions · 19d969e3
      Augusto Noronha authored
      Implement SymbolFile::GetCompileOptions, which returns a map from
      compilation units to compilation arguments associated with that unit.
      
      Differential Revision: https://reviews.llvm.org/D147748
      19d969e3
    • Kazu Hirata's avatar
      Fix warnings · d5a50b02
      Kazu Hirata authored
      This patch fixes:
      
        mlir/lib/Dialect/Linalg/TransformOps/LinalgTransformOps.cpp:1334:51:
        warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
      
        lld/wasm/Writer.cpp:250:39: warning: suggest parentheses around ‘&&’
        within ‘||’ [-Wparentheses]
      d5a50b02
    • Michael Jones's avatar
      [libc][obvious] fix new assert typo · d374d474
      Michael Jones authored
      d374d474
    • Jeremy Kun's avatar
      Add support for math.ctlz in convert-math-to-funcs · bfbccfa1
      Jeremy Kun authored
      This change adds a software implementation of the `math.ctlz` operation
      and includes it in `--convert-math-to-funcs`.
      
      This is my first change to MLIR, so please bear with me as I'm still learning
      the idioms of the codebase.
      
      The context for this change is that I have some larger scale project in which
      I'd like to lower from a mix of MLIR dialects to CIRCT, but many of the CIRCT
      passes don't support the `math` dialect.
      
      I noticed the content of `convert-math-to-funcs` was limited entirely to
      the `pow` functions, but otherwise provided the needed structure to implement
      this feature with minimal changes.
      
      Highlight of the changes:
      
      - Add a dependence on the SCF dialect for this lower. I could have lowered
        directly to cf, following the pow lowerings in the same pass, but I felt it
        was not necessary given the existing support for lowering scf to cf.
      - Generalize the DenseMap storing op implementations: modify the callback
        function hashmap to be keyed by both OperationType (for me this effectively
        means the name of the op being implemented in software) and the type
        signature of the resulting function.
      - Implement the ctlz function as a loop. I had researched a variety of
        implementations that claimed to be more efficient (such as those based on a
        de Bruijn sequence), but it seems to me that the simplest approach would make
        it easier for later compiler optimizations to do a better (platform-aware)
        job optimizing this than I could do by hand.
      
      Questions I had for the reviewer:
      
      - [edit: found mlir-cpu-runner and added two tests] What would I add to the filecheck invocation to actually run the resulting MLIR on a value and assert the output is correct? I have done this manually with the C implementation but I'm not confident my port to MLIR is correct.
      - Should I add a test for a vectorized version of this lowering? I followed suit with the ` VecOpToScalarOp` but I admit I don't fully understand what it's doing.
      
      Reviewed By: vzakhari
      
      Differential Revision: https://reviews.llvm.org/D146261
      bfbccfa1
    • Tue Ly's avatar
      [libc][math] Update range reduction step for logf and reduce its latency. · bc8e87ef
      Tue Ly authored
      Simplify the range reduction steps by choosing the reduction constants
      carefully so that the reduced arguments v = r*m_x - 1 and v^2 are exact in double
      precision, even without FMA instructions, and -2^-8 <= v < 2^-7. This allows the
      polynomial evaluations to be parallelized more efficiently.
      
      Reviewed By: santoshn, zimmermann6
      
      Differential Revision: https://reviews.llvm.org/D147755
      bc8e87ef
    • Michael Jones's avatar
      [libc] clean up ctype negative handling · 26f1770e
      Michael Jones authored
      The ctype functions will sometimes be passed negative numbers, such as
      EOF. Some of the previous implementations didn't handle these properly.
      Additionally, the tests did not check any negative numbers. These
      problems have been fixed.
      
      This patch fixes https://github.com/llvm/llvm-project/issues/62000
      
      Reviewed By: lntue
      
      Differential Revision: https://reviews.llvm.org/D147813
      26f1770e
    • Aaron Ballman's avatar
      Fix wording in a release note; NFC · 711b70d7
      Aaron Ballman authored
      This change happened due to post-commit feedback on the review.
      711b70d7
    • Frederik Gossen's avatar
      Fix invalid op result access in SparseTensorCodegen · 4a33c679
      Frederik Gossen authored
      This trigges an assertion introduced in https://reviews.llvm.org/D147883
      
      Differential Revision: https://reviews.llvm.org/D147950
      4a33c679
    • Jay Foad's avatar
      [AMDGPU] Fix AddedComplexity for s_buffer_load patterns. NFCI. · f34a1953
      Jay Foad authored
      We set AddedComplexity = 100 for s_load patterns to prefer them over
      global loads, but for s_buffer_load patterns there is no need to do
      this and it was quietly overriding the AddedComplexity of each
      individual GCNPat that is defined inside SMLoad_Pattern (but in practice
      that did not appear to make any difference).
      
      Differential Revision: https://reviews.llvm.org/D145396
      f34a1953
    • Bing1 Yu's avatar
      Change dyn_cast to cast · 87c1ed53
      Bing1 Yu authored
      Reviewed By: pengfei
      
      Differential Revision: https://reviews.llvm.org/D147923
      87c1ed53
  2. Apr 10, 2023