[all-commits] [llvm/llvm-project] ae2e61: [SCEV] Fix sign bits of pointers wider than their ...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Wed Sep 23 09:03:50 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ae2e61a2b21e38fd8356931aa75baf78a64da365
https://github.com/llvm/llvm-project/commit/ae2e61a2b21e38fd8356931aa75baf78a64da365
Author: Florian Hahn <flo at fhahn.com>
Date: 2026-09-23 (Wed, 23 Sep 2026)
Changed paths:
M llvm/lib/Analysis/ScalarEvolution.cpp
M llvm/test/Analysis/ScalarEvolution/ptrtoaddr-i32-index-width.ll
Log Message:
-----------
[SCEV] Fix sign bits of pointers wider than their index type. (#225786)
ComputeNumSignBits counts bits over the full pointer width. If all sign
bits are in the high bits, the code previously did not adjust the number
of signed bits. For narrow index types, this could result in the number
of sign bits > than the narrow bitwidth triggering an assert in APInt
(test example has 64 bit pointer with 16 bit index width.
If all sign bits are in the high bits outside the index width, they do
not add any information for the index, just use 1 in that case.
Fixes a crash in the added tests.
PR: https://github.com/llvm/llvm-project/pull/225786
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