| commit | 6fd229a655f521a9f58d40c671e5cab4ea3ea87b | [log] [tgz] |
|---|---|---|
| author | Miguel Saldivar <miguel.saldivar@hpe.com> | Sat Oct 12 03:28:39 2024 -0700 |
| committer | GitHub <noreply@github.com> | Sat Oct 12 11:28:39 2024 +0100 |
| tree | b61d6492c96673e6e65737cd8a555e3115ec9d2a | |
| parent | b9cae45b63bc9c44521cc28b4a381afec6181f54 [diff] |
[X86] Invert (and X, ~(and ~Y, Z)) back into (and X, (or Y, ~Z)) (#109215)
When `andn` is available, we should avoid switching `s &= ~(z & ~y);` into `s &= ~z | y;`
This patch turns this assembly from:
```
foo:
not rcx
and rsi, rdx
andn rax, rsi, rdi
or rcx, rdx
and rax, rcx
ret
```
into:
```
foo:
and rsi, rdx
andn rcx, rdx, rcx
andn rax, rsi, rdi
andn rax, rcx, rax
ret
```
Fixes #108731Welcome 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.
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.
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.