llvm with tablegen backend for capstone disassembler
Go to file
Weining Lu 47601815ec [LoongArch] Define ual feature and override allowsMisalignedMemoryAccesses
Some CPUs do not allow memory accesses to be unaligned, e.g. 2k1000la
who uses the la264 core on which misaligned access will trigger an
exception.

In this patch, a backend feature called `ual` is defined to decribe
whether the CPU supports unaligned memroy accesses. And this feature
can be toggled by clang options `-m[no-]unaligned-access` or the
aliases `-m[no-]strict-align`. When this feature is on,
`allowsMisalignedMemoryAccesses` sets the speed number to 1 and returns
true that allows the codegen to generate unaligned memory access insns.

Clang options `-m[no-]unaligned-access` are moved from `m_arm_Features_Group`
to `m_Group` because now more than one targets use them. And a test
is added to show that they remain unused on a target that does not
support them. In addition, to keep compatible with gcc, a new alias
`-mno-strict-align` is added which is equal to `-munaligned-access`.

The feature name `ual` is consistent with linux kernel [1] and the
output of `lscpu` or `/proc/cpuinfo` [2].

There is an `LLT` variant of `allowsMisalignedMemoryAccesses`, but
seems that curently it is only used in GlobalISel which LoongArch
doesn't support yet. So this variant is not implemented in this patch.

[1]: https://github.com/torvalds/linux/blob/master/arch/loongarch/include/asm/cpu.h#L77
[2]: https://github.com/torvalds/linux/blob/master/arch/loongarch/kernel/proc.c#L75

Reviewed By: xen0n

Differential Revision: https://reviews.llvm.org/D149946
2023-06-07 13:40:58 +08:00
.github/workflows workflows/release-tasks: Upload lit releases to pypi 2023-05-31 09:25:19 -07:00
bolt [BOLT][NFC] Fix debug messages 2023-06-06 15:50:58 -07:00
clang [LoongArch] Define ual feature and override allowsMisalignedMemoryAccesses 2023-06-07 13:40:58 +08:00
clang-tools-extra [clangd] Move completion signatures and labelDetails 2023-06-05 18:05:18 +02:00
cmake [CMake] Ensure CLANG_RESOURCE_DIR is respected. 2023-06-03 04:21:35 -07:00
compiler-rt Revert "[Sanitizers] Remove BuildId from sanitizers stacktrace on 2023-06-06 17:25:55 -07:00
cross-project-tests [Dexter] XFAIL Dexter tests for Apple Silicon (arm64) 2023-05-26 15:43:20 -07:00
flang [flang][hlfir] Enable assignments with allocatable components. 2023-06-06 20:25:07 -07:00
libc [libc] Fix undefined behavior of left shifting signed integer in exp2f.cpp. 2023-06-07 01:15:18 -04:00
libclc Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
libcxx [libc++] Refactor __less 2023-06-06 13:58:52 -07:00
libcxxabi remove Demangle/StringView.h 2023-06-01 10:13:33 -07:00
libunwind [libunwind] Removes CMake work-arounds. 2023-06-05 17:42:37 +02:00
lld [NFC][lld][COFF] Rename findFile* methods 2023-06-06 13:15:09 -07:00
lldb [NFC] Remove unneeded semicolon after function definition 2023-06-07 09:29:49 +08:00
llvm [LoongArch] Define ual feature and override allowsMisalignedMemoryAccesses 2023-06-07 13:40:58 +08:00
llvm-libgcc Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
mlir [mlir][sparse][gpu] add sm8.0+ tensor core 2:4 sparsity support 2023-06-06 23:13:21 +00:00
openmp [Attributor] Identify and remove no-op fences 2023-06-05 17:14:00 -07:00
polly [SCEV] Compute AddRec range computations using different type BECount 2023-05-31 21:05:17 -07:00
pstl Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
runtimes Reland "[CMake] Bumps minimum version to 3.20.0. 2023-05-27 12:51:21 +02:00
third-party [NFC][Py Reformat] Reformat python files in the rest of the dirs 2023-05-25 11:17:05 +02:00
utils [mlir][sparse][gpu] add sm8.0+ tensor core 2:4 sparsity support 2023-06-06 23:13:21 +00:00
.arcconfig
.arclint
.clang-format
.clang-tidy Add -misc-use-anonymous-namespace to .clang-tidy 2023-05-06 02:33:20 +03:00
.git-blame-ignore-revs [NFC] Add mlir python reformat SHA to .git-blame-ignore-revs 2023-05-26 08:06:03 +02:00
.gitignore
.mailmap Add entry to mailmap 2023-04-25 23:15:07 -07:00
CONTRIBUTING.md Added instruction to join the llvm discourse and discord group. 2023-03-27 17:02:07 -07:00
LICENSE.TXT
README.md [docs] Update README and GettingStarted 2023-03-08 12:55:59 -08:00
SECURITY.md

The LLVM Compiler Infrastructure

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, or #llvm IRC channel on OFTC.

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