12 Commits

Author SHA1 Message Date
Antonio Frighetto
2ae968a0d9
[Instrumentation] Move out to Utils (NFC) (#108532)
Utility functions have been moved out to Utils. Minor opportunity to
drop the header where not needed.
2024-09-15 21:07:40 -07:00
Alexander Shaposhnikov
d23c24f336
[llvm][nsan] Skip function declarations (#105598)
Skip function declarations in the instrumentation pass.
2024-08-21 18:08:31 -07:00
Wu Yingcong
430b90f045
[nsan][NFC] Use cast when dyn_cast is not needed. (#101147)
Use `cast` instead to replace `dyn_cast` when `dyn_cast` is not
needed/not checked.
2024-08-01 11:23:03 +08:00
Alexander Shaposhnikov
70a9535f71
[Instrumentation][nsan] Add support for Freeze instruction (#100490)
Add support for Freeze.

This fixes https://github.com/llvm/llvm-project/issues/98143 .
2024-07-25 21:34:08 -07:00
Dmitry Chestnykh
cd82fee391
[nsan] Fix Wstring-conversion error (#100328)
Fix error: implicit conversion turns string literal into bool: 'const
char[46]' to 'bool' [-Werror,-Wstring-conversion]
2024-07-24 12:35:56 +03:00
Dmitry Chestnykh
ddf5725ef1
[nsan] Emit calls to optimized functions (#98900)
As previously noted in nsan.cpp we can implement
optimized variants of `__nsan_copy_values` and
`__nsan_set_value_unknown` if a memory operation
size is known.
Now the instrumentation creates calls to optimized functions if there is
4, 8 or 16-byte memory operation like
`memset(X, value, 4/8/16)` or `memcpy(dst, src, 4/8/16)`
nsan.cpp provides definitions of the optimized functions.
2024-07-24 11:20:36 +03:00
Simon Pilgrim
d32d20f3a0 NumericalStabilitySanitizer.cpp - fix MSVC "not all control paths return a value" warnings. NFC. 2024-07-01 12:10:36 +01:00
Alexander Shaposhnikov
1710679237 Reapply "[LLVM][Instrumentation] Add numerical sanitizer (#85916)"
This reverts commit 493c384a7d94cce1d18824a6b0e1f9ee20cdc681
and includes a fix for the build breakage.
2024-06-29 09:04:43 +00:00
Alexander Shaposhnikov
493c384a7d Revert "[LLVM][Instrumentation] Add numerical sanitizer (#85916)"
This reverts commit 15ad7919f6dd18b5d7f5a22daad6a5c25ecb8793.
The commit broke the build bot
https://lab.llvm.org/buildbot/#/builders/11/builds/822.
2024-06-29 04:57:50 +00:00
Alexander Shaposhnikov
61cd6bbb51 Revert "[Instrumentation] Fix a warning"
This reverts commit de18ff35caa764998321dc01306b509efe4be431.
The initial commit for nsan needs to be reverted
for now because of the issue detected by
https://lab.llvm.org/buildbot/#/builders/11/builds/822.
2024-06-29 04:55:21 +00:00
Kazu Hirata
de18ff35ca [Instrumentation] Fix a warning
This patch fixes:

  llvm/lib/Transforms/Instrumentation/NumericalStabilitySanitizer.cpp:1528:38:
  error: unused variable 'TableRef' [-Werror,-Wunused-variable]
2024-06-28 16:31:49 -07:00
Alexander Shaposhnikov
15ad7919f6
[LLVM][Instrumentation] Add numerical sanitizer (#85916)
This PR introduces the numerical sanitizer originally proposed by
Clement Courbet on https://reviews.llvm.org/D97854
(https://arxiv.org/abs/2102.12782).

The main additions include:
- Migration to LLVM opaque pointers
- Migration to various updated APIs
- Extended coverage for LLVM instructions/intrinsics
- Code refactoring

The tool is still very experimental, the coverage (e.g. for intrinsics /
library functions) is incomplete.

Link: https://discourse.llvm.org/t/rfc-revival-of-numerical-sanitizer/79601

---------

Co-authored-by: Fangrui Song <i@maskray.me>
2024-06-28 15:41:37 -07:00