diff options
author | Thurston Dang <thurston@google.com> | 2025-06-25 09:29:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-25 09:29:59 -0700 |
commit | 5a194c1fd97b10fdbdbd8ada85372d978c9ff3c4 (patch) | |
tree | 6d53046c1cb4b6f9248092eccbe98fb671aad7eb /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 9b307ebdd051524f97b59e30e001e4dd5c193b78 (diff) | |
download | llvm-5a194c1fd97b10fdbdbd8ada85372d978c9ff3c4.zip llvm-5a194c1fd97b10fdbdbd8ada85372d978c9ff3c4.tar.gz llvm-5a194c1fd97b10fdbdbd8ada85372d978c9ff3c4.tar.bz2 |
[msan] Sharpen instrumentation of Intrinsic::{ctlz,cttz} (#145609)
The current instrumentation of Intrinsic::{ctlz,cttz} has false positives. For example, consider `ctlz(0001 11??)` whereby `0` and `1` denotes initialized bits (with concrete values of 0 and 1 respectively) and `?` denotes an uninitialized bit. The result (of 3) is well-defined and the shadow ought to be fully initialized, but the current instrumentation marks it as fully uninitialized.
This patch improves the fidelity of the instrumentation by comparing the number of leading (for ctlz; trailing for cttz) zeros in the concrete value and the shadow.
This patch also renames the function from 'handleCountZeroes' to 'handleLeadingTrailingCountZeros', to clarify that the intrinsics handled do not count all the zeros (unlike `llvm.ctpop`, which counts all the 1s).
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions