llvm with tablegen backend for capstone disassembler
Go to file
Noah Goldstein 47c642f9a0 [DAGCombiner] Fold IEEE fmul/fdiv by Pow2 to add/sub of exp
Note: This is moving D154678 which previously implemented this in
InstCombine. Concerns where brought up that this was de-canonicalizing
and really targeting a codegen improvement, so placing in DAGCombiner.

This implements:

```
(fmul C, (uitofp Pow2))
    -> (bitcast_to_FP (add (bitcast_to_INT C), Log2(Pow2) << mantissa))
(fdiv C, (uitofp Pow2))
    -> (bitcast_to_FP (sub (bitcast_to_INT C), Log2(Pow2) << mantissa))
```
The motivation is mostly fdiv where 2^(-p) is a fairly common
expression.

The patch is intentionally conservative about the transform, only
doing so if we:
    1) have IEEE floats
    2) C is normal
    3) add/sub of max(Log2(Pow2)) stays in the min/max exponent
       bounds.

Alive2 can't realistically prove this, but did test float16/float32
cases (within the bounds of the above rules) exhaustively.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D154805
2023-09-20 13:28:24 -05:00
.ci [ci] builkite don't escape windows targets (#66192) 2023-09-13 13:02:55 +02:00
.github Revert "[Workflow] Add new code format helper. (#66684)" 2023-09-20 10:01:37 +02:00
bolt [BOLT][runtime] Test for outline-atomics support 2023-09-19 23:29:05 +04:00
clang [Clang][C] Fixed a bug where we reject an _Atomic qualified integer in a switch statment 2023-09-20 19:19:02 +02:00
clang-tools-extra [clang] [C23] Fix crash with _BitInt running clang-tidy (#65889) 2023-09-20 05:06:45 -05:00
cmake [CMake] Switch the CMP0091 policy (MSVC_RUNTIME_LIBRARY) to the new behaviour 2023-07-17 09:59:05 +03:00
compiler-rt [NFC][hwasan] Collect heap allocations early (#66682) 2023-09-19 19:29:33 -07:00
cross-project-tests [Dexter] Associate parser errors with correct file (#66765) 2023-09-19 14:16:17 +01:00
flang [flang][hlfir] Fixed cleanup code placement indeterminism in OrderedAssignments. (#66811) 2023-09-20 08:34:11 -07:00
libc [libc][Obvious] Fix incorrect RPC opcode for clearerr 2023-09-20 11:54:35 -05:00
libclc libclc: Fix signed integer underflow in abs_diff 2023-08-31 14:28:16 +01:00
libcxx [libc++] Sort available features before printing them 2023-09-20 09:53:07 -04:00
libcxxabi [libc++abi][test][VE] Add UNSUPPORTED to pass tests on VE 2023-09-14 08:13:02 +09:00
libunwind [libunwind][AIX] Fix up TOC register if unw_getcontext is called from a different module (#66549) 2023-09-19 10:37:30 -04:00
lld [ELF] Postpone "unable to move location counter backward" error (#66854) 2023-09-20 09:06:45 -07:00
lldb [lldb][AArch64] Invalidate cached VG value before reconfiguring SVE registers 2023-09-20 16:05:34 +01:00
llvm [DAGCombiner] Fold IEEE fmul/fdiv by Pow2 to add/sub of exp 2023-09-20 13:28:24 -05:00
llvm-libgcc [llvm-libgcc][CMake] Refactor llvm-libgcc (#65455) 2023-09-18 22:56:03 -07:00
mlir [mlir] regenerate linalg named ops yaml (#65475) 2023-09-20 18:53:29 +02:00
openmp [OpenMP][VE] Limit the number of threads to create (#66729) 2023-09-20 17:44:24 +09:00
polly Move CallInst::CreateFree to IRBuilderBase 2023-09-19 12:04:17 +02:00
pstl Clear release notes for 18.x 2023-07-25 13:58:49 +02:00
runtimes [llvm-libgcc][CMake] Refactor llvm-libgcc (#65455) 2023-09-18 22:56:03 -07:00
third-party Reland "Update GoogleTest to v1.14.0 (#65823)" 2023-09-13 14:17:24 -07:00
utils [bazel] Port 4fbb5f9350 2023-09-20 10:22:26 -07: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 Revert "[mlir][spirv] Add D155747 to .git-blame-ignore-revs" 2023-07-21 10:59:16 -04:00
.gitignore Revert accidental .gitignore change from 9b7763821a 2023-09-07 22:42:05 -07:00
.mailmap Add entry to mailmap 2023-04-25 23:15:07 -07: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 [docs] Add LICENSE.txt to the root of the mono-repo 2022-08-24 09:35:00 +02:00
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.