[clang] [clang] add array bounds constraints using undef for out-of-bounds access (PR #159046)
Sebastian Pop via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 19 10:52:03 PDT 2025
sebpop wrote:
> violating an assume is immediate undefined behavior. It's not a "hint" in the heuristic sense, it encodes a precondition. Of course, the _purpose_ of assumes is to improve optimizations by providing more information, so it is an optimization hint in that sense.
Thank you Nikita for clarifying that part.
> I'm not entirely clear on why using this select form is better than using assume.
My first way to fix this was using an assume. I will follow your recommendation and I will amend the patch with an assume.
Thank you for your valuable advice.
https://github.com/llvm/llvm-project/pull/159046
More information about the cfe-commits
mailing list