1. Oct 07, 2023
    • Aaron Ballman's avatar
      Fix Clang Sphinx build · 116a1aef
      Aaron Ballman authored
      116a1aef
    • Job Noorman's avatar
      [BOLT][RISCV] Fix reloc-tls tests · 7b936112
      Job Noorman authored
      Was broken after ff5e2bab.
      7b936112
    • Ralf Jung's avatar
      LangRef: add missing punctuation (#68471) · 807e7451
      Ralf Jung authored
      807e7451
    • Benjamin Kramer's avatar
      2fc5649c
    • Jie Fu's avatar
      [clang] Fix -Wreorder-ctor of DependentFunctionTemplateSpecializationInfo (NFC) · 3a158cc8
      Jie Fu authored
      /llvm-project/clang/lib/AST/Decl.cpp:4182:7: error: field 'TemplateArgumentsAsWritten' will be initialized after field 'NumCandidates' [-Werror,-Wreorder-ctor]
          : TemplateArgumentsAsWritten(TemplateArgsWritten),
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            NumCandidates(Candidates.size())
      1 error generated.
      3a158cc8
    • Krystian Stasiowski's avatar
      [clang] remove ClassScopeFunctionSpecializationDecl (#66636) · 3a3b84b1
      Krystian Stasiowski authored
      This removes the `ClassScopeFunctionSpecializationDecl` `Decl` node, and
      instead uses `DependentFunctionTemplateSpecializationInfo` to handle
      such declarations. `DependentFunctionTemplateSpecializationInfo` is also
      changed to store a `const ASTTemplateArgumentListInfo*` to be more in
      line with `FunctionTemplateSpecializationInfo`.
      
      This also changes `FunctionDecl::isFunctionTemplateSpecialization` to
      return `true` for dependent specializations, and
      `FunctionDecl::getTemplateSpecializationKind`/`FunctionDecl::getTemplateSpecializationKindForInstantiation`
      to return `TSK_ExplicitSpecialization` for non-friend dependent
      specializations (the same behavior as dependent class scope
      `ClassTemplateSepcializationDecl` & `VarTemplateSepcializationDecl`).
      3a3b84b1
    • Caroline Tice's avatar
    • Craig Topper's avatar
      [RISCV][GISel] Add FPR register bank. · ee9f96bd
      Craig Topper authored
      We need this so isel can use getRegBankFromRegClass to disambiguate
      FSW and SW patterns without depending on pattern order in the tablegen
      source files.
      
      While there, add a few missing GPR register classes and sort them
      in the order they appear in the tblgen output file.
      ee9f96bd
    • Timm Bäder's avatar
      c654193c
    • Kunwar Grover's avatar
    • Mircea Trofin's avatar
      Fix machine-sink-cache-invalidation post - 8abb2ace · be383de0
      Mircea Trofin authored
      The test was added after a9d0ab2e, which is what 8abb2ace reverted. The
      test is sensitive to the exact instruction sequence in the output, which
      has changed.
      
      Re-gen-ed the test with update_llc_test_checks.py
      be383de0
    • Caroline Tice's avatar
      Revert "Re-apply "[AArch64] Enable "sink-and-fold" in MachineSink by default (#67432)"" · 8abb2ace
      Caroline Tice authored
      This reverts commit a9d0ab2e.
      That commit is causing clang crashes.
      8abb2ace
    • Joseph Huber's avatar
      [libc] Fix linking of AMDGPU device runtime control constants for math (#65676) · fa23a239
      Joseph Huber authored
      Summary:
      Currently, `libc` temporarily provides math by linking against existing
      vendor implementations. To use the AMDGPU DeviceRTL we need to define a
      handful of control constants that alter behaviour for architecture
      specific things. Previously these were marked `extern const` because
      they must be present when we link-in the vendor bitcode library.
      However, this causes linker errors if more than one math function was
      used.
      
      This patch fixes the issue by marking these functions as used and inline
      on top of being external. This means that they are linkable, but it
      gives us `linkonce_odr` semantics. The downside is that these globals
      won't be optimized out, but it allows us to perform constant propagation
      on them unlike using `weak`.
      fa23a239
    • Qizhi Hu's avatar
      [clang][ASTImporter] Fix crash when import `VarTemplateDecl` in record (#67522) · 869d1680
      Qizhi Hu authored
      
      
      [clang][ASTImporter] Fix crash when import `VarTemplateDecl` in record
      static VarTemplateDecl in record isn't a definition, when imported
      before, it will crash in `ASTContext::setTemplateOrSpecializationInfo`
      due to setting specialization while it already exists. This patch skip
      this specific case.
      
      Co-authored-by: default avatarhuqizhi <836744285@qq.com>
      869d1680
    • Jeffrey Byrnes's avatar
      [AMDGPU][IGLP] SingleWaveOpt: Cache DSW Counters from PreRA (#67759) · 6afceba5
      Jeffrey Byrnes authored
      Save the DSW counters from PreRA scheduling. While this avoids recalculation in the postRA pass, that isn't the main purpose.
      
      This is required because of physical register dependencies in PostRA scheduling -- they alter the DAG s.t. our counters may become incorrect -- which alters the layout of the pipeline. By preserving the values from PreRA, we can be sure that we accurately construct the pipeline.
      
      Additionally, remove a bad assert in SharesPredWithPrevNthGroup -- it is possible that we will have an empty cache if OtherGroup has no elements which have a V_PERM pred (possible if the V_PERM SG is empty).
      6afceba5
    • Caroline Tice's avatar
      [libcxxabi] Add missing include statement. · a9e97278
      Caroline Tice authored
      Change aade7467 updated exception
      handling in parts of libc++, but forgot to include <exceptions> in
      cxa_demangle.cpp.  This commit corrects that issue.
      a9e97278
    • Jack Frankland's avatar
      [mlir][tosa][linalg] Apply direct tosa -> linalg Conv2D lowering (#68304) · e29a253c
      Jack Frankland authored
      
      
      TOSA defines the filter channel ordering for 2D convolution operation
      `tosa.conv2d` as `[OC, KH, KW, IC]`. The LinAlg dialect supports `[F, H,
      W, C]` and `[H, W, C, F]` orderings via the `linalg.conv_2d_nhwc_fhwc`
      and `linalg.conv_2d_nhwc_hwcf` operations respectively. Where `F == OC`,
      `KH == H`, `KW == W` and `C == IC`.
      
      Currently `tosa.conv2d` is lowered to `linalg.conv2d_nhwc_hwcf` meaning
      we need to insert a transposition operation to permute the filter
      channels before they can be passed as weights to the linalg op, that is
      `[F, H, W, C]` -> `[H, W, C, F]`. An analogous transformation needs to
      be applied to the quantized operation that lowers to
      `linalg.conv_2d_nhwc_hwcf_q`.
      
      This commit updates the TOSA->LinAlg lowering so that `tosa.conv2d` is
      lowered to `linalg.conv2d_nhwc_fhwc` removing the need for the
      introduction of a transposition operation and making the mapping 1-1. It
      also adds a `linalg.conv_2d_nhwc_fhwc_q` quantized operation to the
      LinAlg dialect so the same direct 1-1 mapping can be applied to the
      quantized variant.
      
      This commit does not add any new lit tests but repurposes the current
      TosaToLinalgNamed tests by removing the checks for transpositions and
      updating the targeted LinAlg operations from `linalg.conv2d_nhwc_hwcf`
      to linalg.conv2d_nhwc_fhwc`.
      
      Signed-off-by: default avatarJack Frankland <jack.frankland@arm.com>
      e29a253c
    • Alexander Yermolovich's avatar
      [DWARF] Change to consistently print out abbrev code in .debug_names (#68353) · 78502251
      Alexander Yermolovich authored
      Changed so that when Abbrev code is printed out for entry it is done in
      the same
      way as in Abbrev table.
      Once letters are present in a hex number in abbrev table they will be
      lower case,
      and in the Entry upper case. Which makes FIleCheck Pattern recognition
      fail.
      Example in: llvm/test/tools/llvm-dwarfdump/X86/debug-names-misaligned.s
      78502251
    • LLVM GN Syncbot's avatar
      [gn build] Port d07c3cf6 · 2cbdeb7b
      LLVM GN Syncbot authored
      2cbdeb7b
    • LLVM GN Syncbot's avatar
      [gn build] Port aade7467 · 8e475711
      LLVM GN Syncbot authored
      8e475711
    • LLVM GN Syncbot's avatar
      [gn build] Port 5d2a7101 · 9c2bdb6f
      LLVM GN Syncbot authored
      9c2bdb6f
    • Jan Svoboda's avatar
      [clang] Fix tests build after 537344fc · 285ab3e9
      Jan Svoboda authored
      285ab3e9
    • Paul Kirth's avatar
      Fix non-determinism in debuginfo (#68332) · 5619e1b8
      Paul Kirth authored
      Assignment tracking iterates over a SmallSet when adding metadata, which
      eventually results in debug metadata being added to the module in
      non-deterministic order.
      
      As reported in #63921, we saw some cases where DWARF DebugLoc entries
      could have their order reversed, even though there was no functional
      difference.
      
      This patch replaces the `SmallSet` with a `SmallVector`, and adds the
      required `DenseMapInfo` specialization to make the ordering
      deterministic.
      
      Fixes #63921
      5619e1b8
    • Jan Svoboda's avatar
      [clang] Fix build after 537344fc · 28e8ade0
      Jan Svoboda authored
      This fixes the following build failure on lldb-x86_64-debian:
      
      /llvm-project/clang/lib/Serialization/ASTReader.cpp:1453:12: error: call to deleted constructor of 'llvm::Error'
          return Err;
                 ^~~
      /llvm-project/llvm/include/llvm/Support/Error.h:189:3: note: 'Error' has been explicitly marked deleted here
        Error(const Error &Other) = delete;
        ^
      /llvm-project/llvm/include/llvm/Support/Error.h:496:18: note: passing argument to parameter 'Err' here
        Expected(Error Err)
                       ^
      28e8ade0
    • Amara Emerson's avatar
      [MachineSink] Fix crash due to use-after-free in a MachineInstr* cache. · 7510f32f
      Amara Emerson authored
      After the SinkAndFold optimization was enabled, we saw some crashes with
      GISel due to SinkAndFold erasing an MI while a reference was being held in a
      cache.
      7510f32f
    • Haowei Wu's avatar
      Revert "add support for riscv64" · 531233d4
      Haowei Wu authored
      This reverts commit cd0a8245, which
      breaks the build of compiler-rt for riscv64.
      531233d4
    • Jan Svoboda's avatar
      [clang][modules] Move `SLocEntry` search into `ASTReader` (#66966) · 537344fc
      Jan Svoboda authored
      In `SourceManager::getFileID()`, Clang performs binary search over its
      buffer of `SLocEntries`. For modules, this binary search fully
      deserializes the entire `SLocEntry` block for each visited entry. For
      some entries, that includes decompressing the associated buffer (e.g.
      the predefines buffer, macro expansion buffers, contents of volatile
      files), which shows up in profiles of the dependency scanner.
      
      This patch moves the binary search over loaded entries into `ASTReader`,
      which can perform cheaper partial deserialization during the binary
      search, reducing the wall time of dependency scans by ~3%. This also
      reduces the number of retired instructions by ~1.4% on regular
      (implicit) modules compilation.
      
      Note that this patch drops the optimizations based on the last lookup ID
      (pruning the search space and performing linear search before resorting
      to the full binary search). Instead, it reduces the search space by
      asking `ASTReader::GlobalSLocOffsetMap` for the containing `ModuleFile`
      and only does binary search over entries of single module file.
      537344fc
    • Douglas Yung's avatar
      Add '-p' argument to mkdir in test so that it does not give an error if the... · 8eff5e4b
      Douglas Yung authored
      Add '-p' argument to mkdir in test so that it does not give an error if the directory already exists.
      8eff5e4b
    • Maksim Levental's avatar
      [llvm][Support] fix convertToSnakeFromCamelCase (#68375) · 767dcc5f
      Maksim Levental authored
      Currently runs of caps aren't handled correctly so e.g. something like
      `Intel_OCL_BI` is snake cased to `intel_o_c_l_b_i` (previously discussed
      on this [phabricator
      patch](https://reviews.llvm.org/rG92233062c17590d3157bdc6db430fcdfc54312fe)).
      767dcc5f
    • ChiaHungDuan's avatar
      [scudo] Improve the message of region exhaustion (#68444) · b53ff43d
      ChiaHungDuan authored
      In this CL, we move the printing of allocator stats from primary.h to
      combined.h. This will also dump the secondary stats and reduce the log
      spam when an OOM happens
      
      Also change the symbol `F` to `E` to indicate region pages exhausted. It
      means the region can't map more pages for blocks but it may still have
      free blocks to allocate. `F` may hint the failure of fatel error in the
      region. Also update the related comments.
      b53ff43d
    • Peiming Liu's avatar
      06374400
    • michaelrj-google's avatar
      [clang-tidy][libc] Fix namespace check with macro (#68134) · daca9721
      michaelrj-google authored
      The name of the namespace for LLVM's libc is now provided by a macro.
      The ImplementationNamespaceCheck was updated to handle this, but the
      CalleeNamespaceCheck was missed. This patch updates the
      CalleeNamespaceCheck to handle the macro.
      daca9721
    • Nikolas Klauser's avatar
      [libc++][PSTL] Overhaul exceptions handling · aade7467
      Nikolas Klauser authored
      This makes exception handling a lot simpler, since we don't have to convert any exceptions this way. Is also properly handles all the user-thrown exceptions.
      
      Reviewed By: ldionne, #libc
      
      Spies: arichardson, mstorsjo, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D154238
      aade7467
    • Nikolas Klauser's avatar
      [libc++] Optimize ranges::count for __bit_iterators · a9138cdb
      Nikolas Klauser authored
      ```
      ---------------------------------------------------------------
      Benchmark                                    old            new
      ---------------------------------------------------------------
      bm_vector_bool_count/1                   1.92 ns        1.92 ns
      bm_vector_bool_count/2                   1.92 ns        1.92 ns
      bm_vector_bool_count/3                   1.92 ns        1.92 ns
      bm_vector_bool_count/4                   1.92 ns        1.92 ns
      bm_vector_bool_count/5                   1.92 ns        1.92 ns
      bm_vector_bool_count/6                   1.92 ns        1.92 ns
      bm_vector_bool_count/7                   1.92 ns        1.92 ns
      bm_vector_bool_count/8                   1.92 ns        1.92 ns
      bm_vector_bool_count/16                  1.92 ns        1.92 ns
      bm_vector_bool_count/64                  2.24 ns        2.25 ns
      bm_vector_bool_count/512                 3.19 ns        3.20 ns
      bm_vector_bool_count/4096                14.1 ns        12.3 ns
      bm_vector_bool_count/32768               84.0 ns        83.6 ns
      bm_vector_bool_count/262144               664 ns         661 ns
      bm_vector_bool_count/1048576             2623 ns        2628 ns
      bm_vector_bool_ranges_count/1            1.07 ns        1.92 ns
      bm_vector_bool_ranges_count/2            1.65 ns        1.92 ns
      bm_vector_bool_ranges_count/3            2.27 ns        1.92 ns
      bm_vector_bool_ranges_count/4            2.68 ns        1.92 ns
      bm_vector_bool_ranges_count/5            3.33 ns        1.92 ns
      bm_vector_bool_ranges_count/6            3.99 ns        1.92 ns
      bm_vector_bool_ranges_count/7            4.67 ns        1.92 ns
      bm_vector_bool_ranges_count/8            5.19 ns        1.92 ns
      bm_vector_bool_ranges_count/16           11.1 ns        1.92 ns
      bm_vector_bool_ranges_count/64           52.2 ns        2.24 ns
      bm_vector_bool_ranges_count/512           452 ns        3.20 ns
      bm_vector_bool_ranges_count/4096         3577 ns        12.1 ns
      bm_vector_bool_ranges_count/32768       28725 ns        83.7 ns
      bm_vector_bool_ranges_count/262144     229676 ns         662 ns
      bm_vector_bool_ranges_count/1048576    905574 ns        2625 ns
      ```
      
      Reviewed By: #libc, ldionne
      
      Spies: arichardson, ldionne, libcxx-commits
      
      Differential Revision: https://reviews.llvm.org/D156956
      a9138cdb
    • Steven Wu's avatar
      [ADT] Introduce LazyAtomicPointer · 5d2a7101
      Steven Wu authored
      LazyAtomicPointer is a lock-free pointer that can coordinate concurrent
      writes to a pointer using a generator.
      
      Reviewed By: benlangmuir
      
      Differential Revision: https://reviews.llvm.org/D133714
      5d2a7101
    • Steven Wu's avatar
      [Support] Introduce ThreadSafeAllocator · d07c3cf6
      Steven Wu authored
      Add support for ThreadSafeAllocator, which is needed for a CAS
      implementation, which requires thread safe allocation for data storage.
      
      Reviewed By: dblaikie
      
      Differential Revision: https://reviews.llvm.org/D133713
      d07c3cf6
    • Steven Wu's avatar
      [ADT] Add more ArrayRef <-> StringRef conversion functions · 4c94aff5
      Steven Wu authored
      Add new functions in StringExtras to convert byte size type array to
      StringRef and vice versa.
      
      Reviewed By: benlangmuir, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D139035
      4c94aff5
    • AdityaK's avatar
      Revert Wframe-larger-than to 530 · ce8ed000
      AdityaK authored
      I missed reverting this change committed in cd0a8245.
      ce8ed000
    • Alex Fan's avatar
      add support for riscv64 · cd0a8245
      Alex Fan authored
      Implements for sv39 and sv48 VMA layout.
      
      Userspace only has access to the bottom half of vma range. The top half is used by kernel.
      There is no dedicated vsyscall or heap segment.
      PIE program is allocated to start at TASK_SIZE/3*2. Maximum ASLR is ARCH_MMAP_RND_BITS_MAX+PAGE_SHIFT=24+12=36
      Loader, vdso and other libraries are allocated below stack from the top.
      
      Also change RestoreAddr to use 4 bits to accommodate MappingRiscv64_48
      
      Reviewed by: MaskRay, dvyukov, asb, StephenFan, luismarques, jrtc27, hiraditya, vitalybuka
      
      Differential Revision: https://reviews.llvm.org/D145214
      cd0a8245
    • Aart Bik's avatar
      [mlir][sparse] introduce MapRef, unify conversion/codegen for reader (#68360) · d3af6535
      Aart Bik authored
      This revision introduces a MapRef, which will support a future
      generalization beyond permutations (e.g. block sparsity). This revision
      also unifies the conversion/codegen paths for the sparse_tensor.new
      operation from file (eg. the readers). Note that more unification is
      planned as well as general affine dim2lvl and lvl2dim (all marked with
      TODOs).
      d3af6535