| commit | 05dd957cda663273ae0e5739656ffe701404f37c | [log] [tgz] |
|---|---|---|
| author | Ryotaro Kasuga <kasuga.ryotaro@fujitsu.com> | Fri Aug 08 10:58:13 2025 +0900 |
| committer | GitHub <noreply@github.com> | Fri Aug 08 10:58:13 2025 +0900 |
| tree | d892db99e3fe84474e3ed2afe4f7676d2a8a8d86 | |
| parent | 1458eb206fb652358b3ee7e75d95b52f3f4ac333 [diff] |
[DA] Fix the check between Subscript and Size after delinearization (#151326) Delinearization provides two values: the size of the array, and the subscript of the access. DA checks their validity (`0 <= subscript < size`), with some special handling. In particular, to ensure `subscript < size`, calculate the maximum value of `subscript - size` and check if it is negative. There was an issue in its process: when `subscript - size` is expressed as an affine format like `init + step * i`, the value in the last iteration (`start + step * (num_iterations - 1)`) was assumed to be the maximum value. This assumption is incorrect in the following cases: - When `step` is negative - When the AddRec wraps This patch introduces extra checks to ensure the sign of `step` and verify the existence of nsw/nuw flags. Also, `isKnownNonNegative(S - smax(1, Size))` was used as a regular check, which is incorrect when `Size` is negative. This patch also replace it with `isKnownNonNegative(S - Size)`, although it's still unclear whether using `isKnownNonNegative` is appropriate in the first place. Fix #150604
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, 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.