llvm with tablegen backend for capstone disassembler
Go to file
Sander de Smalen 27139bceb2 [SME] Stop RA from coalescing COPY instructions that transcend beyond smstart/smstop. (#78294)
This patch introduces a 'COALESCER_BARRIER' which is a pseudo node that
expands to
a 'nop', but which stops the register allocator from coalescing a COPY
node when
its use/def crosses a SMSTART or SMSTOP instruction.

For example:

    %0:fpr64 = COPY killed $d0
    undef %2.dsub:zpr = COPY %0       // <- Do not coalesce this COPY
    ADJCALLSTACKDOWN 0, 0
MSRpstatesvcrImm1 1, 0, csr_aarch64_smstartstop, implicit-def dead $d0
    $d0 = COPY killed %0
    BL @use_f64, csr_aarch64_aapcs

If the COPY would be coalesced, that would lead to:

    $d0 = COPY killed %0

being replaced by:

    $d0 = COPY killed %2.dsub

which means the whole ZPR reg would be live upto the call, causing the
MSRpstatesvcrImm1 (smstop) to spill/reload the ZPR register:

    str     q0, [sp]   // 16-byte Folded Spill
    smstop  sm
    ldr     z0, [sp]   // 16-byte Folded Reload
    bl      use_f64

which would be incorrect for two reasons:
1. The program may load more data than it has allocated.
2. If there are other SVE objects on the stack, the compiler might use
the
   'mul vl' addressing modes to access the spill location.

By disabling the coalescing, we get the desired results:

    str     d0, [sp, #8]  // 8-byte Folded Spill
    smstop  sm
    ldr     d0, [sp, #8]  // 8-byte Folded Reload
    bl      use_f64

(cherry picked from commit dd736661826e215ac70ff3a4a4ccd75bda0c5ccd)
2024-01-31 15:41:15 +00:00
.ci [🍒][ci] Fix the base branch we use to determine changes (#79503) (#79506) 2024-01-25 13:57:41 -08:00
.github [workflows] Fix argument passing in abi-dump jobs (#79658) (#79836) 2024-01-29 10:15:50 -08:00
bolt [BOLT] Fix unconditional output of boltedcollection in merge-fdata (#78653) 2024-01-18 20:00:47 -08:00
clang Backport [RISCV] Graduate Zicond to non-experimental (#79811) (#80018) 2024-01-30 15:31:38 -08:00
clang-tools-extra [misc-coroutine-hostile-raii] Use getOperand instead of getCommonExpr. (#79206) 2024-01-23 23:07:00 +01:00
cmake
compiler-rt [sanitizer] Handle Gentoo's libstdc++ path 2024-01-30 15:47:38 -08:00
cross-project-tests [AMDGPU] Add GFX12 WMMA and SWMMAC instructions (#77795) 2024-01-26 20:01:08 -08:00
flang Apply kind code check on exitstat and cmdstat (#78286) 2024-01-30 16:45:35 +00:00
libc [libc] remove redundant call_once (#79226) 2024-01-23 15:38:12 -08:00
libclc libclc: add missing AMD gfx symlinks (#78884) 2024-01-22 15:32:13 +07:00
libcxx Revert "[SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (#77768)" 2024-01-29 14:57:23 -08:00
libcxxabi [libc++] Fix the behavior of throwing operator new under -fno-exceptions (#69498) 2024-01-22 22:33:04 -05:00
libunwind [libunwind] Move errno.h and signal.h includes under the block where they're needed (#78054) 2024-01-16 10:31:01 -05:00
lld [ELF] Implement R_RISCV_TLSDESC for RISC-V 2024-01-26 21:34:49 -08:00
lldb [lldb] Improve maintainability and readability for ValueObject methods (#75865) 2024-01-23 16:07:52 -08:00
llvm [SME] Stop RA from coalescing COPY instructions that transcend beyond smstart/smstop. (#78294) 2024-01-31 15:41:15 +00:00
llvm-libgcc [llvm-libgcc][CMake] Refactor llvm-libgcc (#65455) 2023-09-18 22:56:03 -07:00
mlir [mlir] Revert to old fold logic in IR::Dialect::add{Types, Attributes}() (#79582) 2024-01-29 15:10:47 -08:00
openmp Re-land [openmp] Fix warnings when building on Windows with latest MSVC or Clang ToT (#77853) 2024-01-23 12:48:38 -05:00
polly [AST] Don't merge memory locations in AliasSetTracker (#65731) 2024-01-17 15:59:13 +01:00
pstl
runtimes [CMake] Always define runtimes-test-depends (#73629) 2023-11-28 15:30:52 -08:00
third-party [third-party] Silence warning on benchmark when building with Clang ToT 2024-01-17 07:23:56 -05:00
utils [Blaze] Fix build file 2024-01-22 15:45:04 -08:00
.arcconfig
.arclint
.clang-format
.clang-tidy
.git-blame-ignore-revs [libc++] Add libc++ clang-formatting commit to git-blame-ignore-revs file 2023-12-18 14:04:41 -05:00
.gitattributes [libc++] Format the code base (#74334) 2023-12-18 14:01:33 -05:00
.gitignore Revert accidental .gitignore change from 9b7763821a 2023-09-07 22:42:05 -07:00
.mailmap .mailmap: add second entry for self 2023-12-19 11:13:19 +00:00
CODE_OF_CONDUCT.md [llvm] Add CODE_OF_CONDUCT.md (#65816) 2023-09-09 10:55:31 -07:00
CONTRIBUTING.md Update CONTRIBUTING.md to remove the not about not accepting PR 2023-09-10 15:21:06 -07:00
LICENSE.TXT
README.md Add OpenSSF Best Practice Badge (#77398) 2024-01-13 07:43:11 -08:00
SECURITY.md

The LLVM Compiler Infrastructure

OpenSSF Scorecard OpenSSF Best Practices libc++

Welcome to the LLVM project!

This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.

The LLVM project has multiple components. The core of the project is itself called "LLVM". This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.

C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.

Other components include: the libc++ C++ standard library, the LLD linker, and more.

Getting the Source Code and Building LLVM

Consult the Getting Started with LLVM page for information on building and running LLVM.

For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.

Getting in touch

Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.

The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.