[all-commits] [llvm/llvm-project] 774056: [asan] Enable StackSafetyAnalysis by default
Fangrui Song via All-commits
all-commits at lists.llvm.org
Thu Jan 11 14:03:40 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7740565f56ce888f5c60d986476185477c911b25
https://github.com/llvm/llvm-project/commit/7740565f56ce888f5c60d986476185477c911b25
Author: Fangrui Song <i at maskray.me>
Date: 2024-01-11 (Thu, 11 Jan 2024)
Changed paths:
M compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp
M compiler-rt/test/asan/TestCases/scariness_score_test.cpp
M llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
M llvm/test/Instrumentation/AddressSanitizer/asan-stack-safety.ll
M llvm/test/Instrumentation/AddressSanitizer/debug_info.ll
M llvm/test/Instrumentation/AddressSanitizer/lifetime-uar-uas.ll
M llvm/test/Instrumentation/AddressSanitizer/lifetime.ll
M llvm/test/Instrumentation/AddressSanitizer/local_stack_base.ll
M llvm/test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll
M llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll
Log Message:
-----------
[asan] Enable StackSafetyAnalysis by default
StackSafetyAnalysis determines whether stack-allocated variables are
guaranteed to be safe from memory access bugs and enables the removal of
certain unneeded instrumentations.
(hwasan enables StackSafetyAnalysis in https://reviews.llvm.org/D108381)
In a release build of clang, text sections are 9% smaller.
Test updates:
* asan-stack-safety.ll: test the -asan-use-stack-safety=1 default
* lifetime-uar-uas.ll: switch to an indexed store to prevent
StackSafetyAnalysis from optimizing out instrumentation for %c
* alloca_vla_interact.cpp: add a load to prevent StackSafetyAnalysis
from optimizing out `__asan_alloca_poison` for the VLA `array`
* scariness_score_test.cpp: add -asan-use-stack-safety=0 to make a load
of a `__asan_poison_memory_region`-poisoned local variable fail as
intended.
* other .ll tests: add -asan-use-stack-safety=0
Reviewed By: kstoimenov
Pull Request: https://github.com/llvm/llvm-project/pull/77210
More information about the All-commits
mailing list