[asan] rewrite asan's stack frame layout

Summary:
Rewrite asan's stack frame layout.
First, most of the stack layout logic is moved into a separte file
to make it more testable and (potentially) useful for other projects.
Second, make the frames more compact by using adaptive redzones
(smaller for small objects, larger for large objects).
Third, try to minimized gaps due to large alignments (this is hypothetical since
today we don't see many stack vars aligned by more than 32).

The frames indeed become more compact, but I'll still need to run more benchmarks
before committing, but I am sking for review now to get early feedback.

This change will be accompanied by a trivial change in compiler-rt tests
to match the new frame sizes.

Reviewers: samsonov, dvyukov

Reviewed By: samsonov

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2324

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196568 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kostya Serebryany
2013-12-06 09:00:17 +00:00
parent 21c34931e8
commit daa1bf3b74
8 changed files with 398 additions and 164 deletions

View File

@@ -89,25 +89,6 @@ entry:
; CHECK-NOT: = alloca
; CHECK: ret void
; Check that asan does not touch allocas with alignment > 32.
define void @alloca_alignment_test() sanitize_address {
entry:
%x = alloca [10 x i8], align 64
%y = alloca [10 x i8], align 128
%z = alloca [10 x i8], align 256
call void @alloca_test_use([10 x i8]* %x)
call void @alloca_test_use([10 x i8]* %y)
call void @alloca_test_use([10 x i8]* %z)
ret void
}
; CHECK: define void @alloca_alignment_test()
; CHECK: = alloca{{.*}} align 64
; CHECK: = alloca{{.*}} align 128
; CHECK: = alloca{{.*}} align 256
; CHECK: ret void
define void @LongDoubleTest(x86_fp80* nocapture %a) nounwind uwtable sanitize_address {
entry:
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %a, align 16