| commit | fd97dfbb78e3c9aea16873617b6d61b5b8a64474 | [log] [tgz] |
|---|---|---|
| author | Florian Hahn <flo@fhahn.com> | Fri Jun 20 13:05:19 2025 +0100 |
| committer | GitHub <noreply@github.com> | Fri Jun 20 13:05:19 2025 +0100 |
| tree | 0b4f76ae3c1a05137bc20e715c9515d21667232b | |
| parent | 5835f1e0a33afcae46a6ca4854373785eb3e7fd6 [diff] |
[LV] Don't mark ptrs as safe to speculate if fed by UB/poison op. (#143204) Add additional checks before marking pointers safe to load speculatively. If some computations feeding the pointer may trigger UB, we cannot load the pointer speculatively, because we cannot compute the address speculatively. The UB triggering instructions will be predicated, but if the predicated block does not execute the result is poison. Similarly, we also cannot load the pointer speculatively if it may be poison. The patch also checks if any of the operands defined outside the loop may be poison when entering the loop. We *don't* need to check if any operation inside the loop may produce poison due to flags, as those will be dropped if needed. There are some types of instructions inside the loop that can produce poison independent of flags. Currently loads are also checked, not sure if there's a convenient API to check for all such operands. Fixes https://github.com/llvm/llvm-project/issues/142957. PR: https://github.com/llvm/llvm-project/pull/143204
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.