| commit | ef1539c1d4e205b05bd8662c9d4e90382d2381a5 | [log] [tgz] |
|---|---|---|
| author | Aethezz <64500703+Aethezz@users.noreply.github.com> | Fri Sep 05 10:48:57 2025 -0400 |
| committer | GitHub <noreply@github.com> | Fri Sep 05 16:48:57 2025 +0200 |
| tree | 8ba2a620537746f98991b9f1d4928a73d54dbc77 | |
| parent | caf5fb1c400bb825c90193719806ac373e94a981 [diff] |
[InstCombine] Fold out-of-range bits for squaring signed integers (#153484) Fixes an issue where bits next to the sign bit were not constant-folded when squaring a sign- or zero-extended small integer. Added logic to detect when both operands of a multiplication are the same extended value, allowing InstCombine to mark bits above the maximum possible square as known zero. This enables correct folding of (x * x) & (1 << N) to 0 when N is out of range. Proof: https://alive2.llvm.org/ce/z/YGou44 Fixes #152061
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.