[all-commits] [llvm/llvm-project] eac23a: [libc++] Add assumption for align of begin and end...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Thu Jan 16 07:57:24 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: eac23a5b971362cda3c646e018b9f26d0bc1ff3a
https://github.com/llvm/llvm-project/commit/eac23a5b971362cda3c646e018b9f26d0bc1ff3a
Author: Florian Hahn <flo at fhahn.com>
Date: 2025-01-16 (Thu, 16 Jan 2025)
Changed paths:
M libcxx/include/__flat_map/key_value_iterator.h
M libcxx/include/__vector/vector.h
Log Message:
-----------
[libc++] Add assumption for align of begin and end pointers of vector. (#108961)
Missing information about begin and end pointers of std::vector can lead
to missed optimizations in LLVM.
This patch adds alignment assumptions at the point where the begin and
end pointers are loaded. If the pointers would not have the same
alignment, end might never get hit when incrementing begin.
See https://github.com/llvm/llvm-project/issues/101372 for a discussion
of missed range check optimizations in hardened mode.
Once https://github.com/llvm/llvm-project/pull/108958 lands, the created
`llvm.assume` calls for the alignment should be folded into the `load`
instructions, resulting in no extra instructions after InstCombine.
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list