commit | 027a4c8b96c7f97df8e98b1dac069b956810ab94 | [log] [tgz] |
---|---|---|
author | Joshua Cao <cao.joshua@yahoo.com> | Mon Apr 10 23:52:06 2023 -0700 |
committer | Joshua Cao <cao.joshua@yahoo.com> | Mon Apr 24 00:21:59 2023 -0700 |
tree | 479b155f6b16fa8840b501adbdc07741f9b963f9 | |
parent | da36d1f09901fa5c0e9c0102bbefecbdeedd4ef2 [diff] |
[SCEV] Precise trip multiples We currently have getMinTrailingZeros(), from which we can get a SCEV's multiple by computing 1 << MinTrailingZeroes. However, this only gets us multiples that are a power of 2. This patch introduces a way to get max constant multiples that are not just a power of 2. The logic is similar to that of getMinTrailingZeros. getMinTrailingZeros is replaced by computing the max constant multiple, and counting the number of trailing bits. This is applied in two places: 1) Computing unsigned constant ranges. For example, if we have i8 {10,+,10}<nuw>, we know the max constant it can be is 250. 2) Computing trip multiples as shown in SCEV output. This is useful if for example, we are unrolling a loop by a factor of 5, and we know the trip multiple is 5, then we don't need a loop epilog. If the code sees that a SCEV does not have <nuw>, it will fall back to finding the max multiple that is a power of 2. Multiples that are a power of 2 will still be a multiple even after the SCEV overflows. Differential Revision: https://reviews.llvm.org/D141823
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.
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, 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.