[all-commits] [llvm/llvm-project] ed36bf: [SeparateConstOffsetFromGEP] Perform offset calcul...
Nikita Popov via All-commits
all-commits at lists.llvm.org
Tue Jan 13 02:43:36 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ed36bff24662737c9c7a3b9ab3c0ecaf46587e42
https://github.com/llvm/llvm-project/commit/ed36bff24662737c9c7a3b9ab3c0ecaf46587e42
Author: Nikita Popov <npopov at redhat.com>
Date: 2026-01-13 (Tue, 13 Jan 2026)
Changed paths:
M llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
M llvm/test/Transforms/SeparateConstOffsetFromGEP/negative-i32-offset.ll
Log Message:
-----------
[SeparateConstOffsetFromGEP] Perform offset calculations on APInt (#175732)
In general, GEP offset calculations are allowed to overflow (if no
poison flags are set). Using int64_t for this purpose can result in C
level signed integer overflow, which is UB. It also means that we
incorrectly model whether some offsets are zero, and thus generate
redundant zero-index GEPs.
Change the code to track offsets in APInts of the pointer index size,
like we do in other places (like accumulateConstantOffset etc).
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