1. Jul 28, 2023
    • Craig Topper's avatar
    • Piotr Zegar's avatar
      Revert "[clang-tidy] Sort options in --dump-config" · a8eb7415
      Piotr Zegar authored
      This reverts commit 2cdb8437.
      a8eb7415
    • Craig Topper's avatar
      [RISCV] When using vror.vi for left rotate, mask the inverted immediate to SEW. · a81e1f0f
      Craig Topper authored
      This makes the assembly more readable.
      
      Reviewed By: luke
      
      Differential Revision: https://reviews.llvm.org/D156348
      a81e1f0f
    • Yitzhak Mandelbaum's avatar
      [clang][CFG] Support construction of a weak topological ordering of the CFG. · 26db5e65
      Yitzhak Mandelbaum authored
      This patch adds support for building a weak topological ordering (WTO) of the
      CFG blocks, based on a limit flow graph constructed via (repeated) interval
      partitioning of the CFG.
      
      This patch is part 2 of 2 for adding WTO support.
      
      Differential Revision: https://reviews.llvm.org/D153058
      26db5e65
    • Kelvin Li's avatar
      [flang] Add a subset of PowerPC MMA (Matrix Multiply Accelerate) intrinsics · 2c2d427c
      Kelvin Li authored
      This patch includes the a subset of MMA intrinsics that are included in
      the mma intrinsic module:
      
      mma_assemble_acc
      mma_assemble_pair
      mma_build_acc
      mma_disassemble_acc
      mma_disassemble_pair
      
      Submit on behalf of Daniel Chen <cdchen@ca.ibm.com>
      
      Differential Revision: https://reviews.llvm.org/D155725
      2c2d427c
    • Alexandros Lamprineas's avatar
      [FuncSpec] Add Phi nodes to the InstCostVisitor. · 96ff464d
      Alexandros Lamprineas authored
      This patch allows constant folding of PHIs when estimating the user
      bonus. Phi nodes are a special case since some of their inputs may
      remain unresolved until all the specialization arguments have been
      processed by the InstCostVisitor. Therefore, we keep a list of dead
      basic blocks and then lazily visit the Phi nodes once the user bonus
      has been computed for all the specialization arguments.
      
      In addition to the last revision this one fixes the bug reported on
      Phabricator.
      
      Differential Revision: https://reviews.llvm.org/D154852
      96ff464d
    • Quinn Dawkins's avatar
      [mlir][Transform] Add transform.any_param type · 024ae73f
      Quinn Dawkins authored
      Introduces a generic parameter type intended for transform dialect use
      cases that uses/manipulates the underlying attribute (e.g. op
      annotation). Includes a disclaimer that mixing parameter based and
      attribute based control is discouraged.
      
      Differential Revision: https://reviews.llvm.org/D155980
      024ae73f
    • Teresa Johnson's avatar
      [MemProf] Convert PGO raw profile to text format · ca31f821
      Teresa Johnson authored
      This avoids the need to regenerate the PGO raw profile on version
      changes. Modify the update script to autogenerate new PGO proftext
      inputs.
      
      Differential Revision: https://reviews.llvm.org/D156460
      ca31f821
    • Piotr Zegar's avatar
      [clang-tidy] Sort options in --dump-config · 2cdb8437
      Piotr Zegar authored
      Sort printed options in --dump-config output.
      
      Fixes: #64153
      
      Reviewed By: carlosgalvezp
      
      Differential Revision: https://reviews.llvm.org/D156452
      2cdb8437
    • Wanyi Ye's avatar
      [BSDArchive] NULL check the child object file ptr before accessing its member · 4b9eed9c
      Wanyi Ye authored
      Recently we've observed lldb crashes caused by missing object file linked to a thin archive (.a) files. The crash is due to a missing NULL check in the code when looking for child object file referred by the thin archive. Malformed archive file should not crash LLDB. Instead, it should report the error and continue.
      
      New error message will look like the following
      
      ```
      error: libfoo.a(__objects__/foo/barAppDelegate.mm.o) failed to load objfile for path/to/libfoo.a.
      Debugging will be degraded for this module.
      ```
      
      Test Plan:
      
      llvm-lit test
      ```
      ./bin/llvm-lit -sv ../llvm-project/lldb/test/API/functionalities/archives/TestBSDArchives.py
      ```
      
      Test without code change will error out with LLDB crash
      ```
      --
      Command Output (stderr):
      --
      PASS: LLDB (~/llvm-upstream/Debug/bin/clang-arm64) :: test (TestBSDArchives.BSDArchivesTestCase)
      PASS: LLDB (~/llvm-upstream/Debug/bin/clang-arm64) :: test_frame_var_errors_when_archive_missing (TestBSDArchives.BSDArchivesTestCase)
      FAIL: LLDB (~/llvm-upstream/Debug/bin/clang-arm64) :: test_frame_var_errors_when_mtime_mistmatch_for_object_in_archive (TestBSDArchives.BSDArchivesTestCase)
      PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
      Stack dump:
      0.      HandleCommand(command = "b a")
      1.      HandleCommand(command = "breakpoint set --name 'a'")
      Fatal Python error: Segmentation fault
      
      Current thread 0x00000001f7b99e00 (most recent call first):
        File "~/llvm-upstream/Debug/bin/LLDB.framework/Resources/Python/lldb/__init__.py", line 3270 in HandleCommand
        File "~/llvm-upstream/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2070 in runCmd
        File "~/llvm-upstream/llvm-project/lldb/packages/Python/lldbsuite/test/lldbtest.py", line 2421 in expect
        File "~/llvm-upstream/llvm-project/lldb/test/API/functionalities/archives/TestBSDArchives.py", line 156 in test_frame_var_errors_when_thin_archive_malformed
      ...
      ```
      
      Differential Revision: https://reviews.llvm.org/D156367
      4b9eed9c
    • Sam McCall's avatar
      [clangd] Loose include-cleaner matching for verbatim headers · d97a3419
      Sam McCall authored
      This updates clangd to take advantage of the APIs added in D155819.
      The main difficulties here are around path normalization.
      
      For layering and performance reasons Includes compares paths lexically, and so
      we should have consistent paths that can be compared across addSearchPath() and
      add(): symlinks resolved or not, relative or absolute.
      This patch spells out that requirement, for most tools consistent use of
      FileManager/HeaderSearch is enough.
      
      For clangd this does not work: IncludeStructure doesn't hold FileEntrys due to
      the preamble/main-file split. It records paths, but canonicalizes them first.
      We choose to use this canonical form as our common representation, so we have
      to canonicalize the directory entries too. This is done in preamble-build and
      recorded in IncludeStructure, as canonicalization is quite expensive.
      
      Differential Revision: https://reviews.llvm.org/D155878
      d97a3419
    • Matt Arsenault's avatar
    • Daniel Hoekwater's avatar
      [AArch64] [XRay] Account for XRay event instrs in Branch Relaxation · 3435a6a0
      Daniel Hoekwater authored
      PATCHABLE_TYPED_EVENT_CALL and PATCHABLE_EVENT_CALL are pseudo
      instructions that expand to XRay sleds, so getInstSizeInBytes
      should reflect the size of the sleds, not the pseudo-instructions.
      
      Differential Revision: https://reviews.llvm.org/D156272
      3435a6a0
    • Nico Weber's avatar
      [AArch64] Fix build on Windows after 57329ca9 · ca32bc44
      Nico Weber authored
      57329ca9 added a .inc include within an unnamed namespace,
      creating ::(unnamed namespace)::llvm in addition to ::llvm.
      This confuses things on Windows.
      ca32bc44
    • spupyrev's avatar
      A new code layout algorithm for function reordering [2/3] · bc59faa8
      spupyrev authored
      We are bringing a new algorithm for function layout (reordering) based on the
      call graph (extracted from a profile data). The algorithm is an improvement of
      top of a known heuristic, C^3. It tries to co-locate hot and frequently executed
      together functions in the resulting ordering. Unlike C^3, it explores a larger
      search space and have an objective closely tied to the performance of
      instruction and i-TLB caches. Hence, the name CDS = Cache-Directed Sort.
      The algorithm can be used at the linking or post-linking (e.g., BOLT) stage.
      
      The algorithm shares some similarities with C^3 and an approach for basic block
      reordering (ext-tsp). It works with chains (ordered lists)
      of functions. Initially all chains are isolated functions. On every iteration,
      we pick a pair of chains whose merging yields the biggest increase in the
      objective, which is a weighted combination of frequency-based and distance-based
      locality. That is, we try to co-locate hot functions together (so they can share
      the cache lines) and functions frequently executed together. The merging process
      stops when there is only one chain left, or when merging does not improve the
      objective. In the latter case, the remaining chains are sorted by density in the
      decreasing order.
      
      **Complexity**
      We regularly apply the algorithm for large data-center binaries containing 10K+
      (hot) functions, and the algorithm takes only a few seconds. For some extreme
      cases with 100K-1M nodes, the runtime is within minutes.
      
      **Perf-impact**
      We extensively tested the implementation extensively on a benchmark of isolated
      binaries and prod services. The impact is measurable for "larger" binaries that
      are front-end bound: the cpu time improvement (on top of C^3) is in the range
      of [0% .. 1%], which is a result of a reduced i-TLB miss rate (by up to 20%) and
      i-cache miss rate (up to 5%).
      
      Reviewed By: rahmanl
      
      Differential Revision: https://reviews.llvm.org/D152834
      bc59faa8
    • Sam McCall's avatar
      [include-cleaner] Loose matching for verbatim headers · 16b5e189
      Sam McCall authored
      A verbatim header usually corresponds to a symbol from a header with
      a pragma "IWYU pragma: private, include <foo.h>".
      
      Currently this is only satisfied if the main file contains exactly
        #include <foo.h>
      In practice this is too strict, we also want to allow
        #include "path/to/foo.h"
      so long as they resolve to the same file.
      
      We cannot be 100% sure without doing IO, and we're not willing to do
      that, but we can detect the common cases based on paths.
      
      Differential Revision: https://reviews.llvm.org/D155819
      16b5e189
    • Vitaly Buka's avatar
      Revert "[Fuzzer] SetThreadName implementation for Windows" · f4aa7b5b
      Vitaly Buka authored
      Breaks window bot.
      
      This reverts commit e3f935c7.
      f4aa7b5b
    • Craig Topper's avatar
      [RISCV] Add EmitPriority=0 to Zcb load/store aliases with no immediate offset. · aad360d6
      Craig Topper authored
      We only want to be able to parse a missing offset. We don't want
      to print with no offset.
      
      This matches the non-compressed form of these aliases.
      aad360d6
  2. Jul 27, 2023