diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-12-09 00:21:41 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2017-12-09 00:21:41 +0000 |
commit | c667c1f47a8ec1acfd6eceb999f8f05793218ca1 (patch) | |
tree | 90e81b64ba0ee0c00b7339818de00ac1cd486026 /llvm/test/Transforms/GVN | |
parent | 8bd9d6ad838dd6a030f4cfcf691fb54162976e48 (diff) | |
download | bcm5719-llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.tar.gz bcm5719-llvm-c667c1f47a8ec1acfd6eceb999f8f05793218ca1.zip |
Hardware-assisted AddressSanitizer (llvm part).
Summary:
This is LLVM instrumentation for the new HWASan tool. It is basically
a stripped down copy of ASan at this point, w/o stack or global
support. Instrumenation adds a global constructor + runtime callbacks
for every load and store.
HWASan comes with its own IR attribute.
A brief design document can be found in
clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier).
Reviewers: kcc, pcc, alekseyshl
Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya
Differential Revision: https://reviews.llvm.org/D40932
llvm-svn: 320217
Diffstat (limited to 'llvm/test/Transforms/GVN')
-rw-r--r-- | llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll b/llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll index a83d7b62d39..72e0b4e9a3c 100644 --- a/llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll +++ b/llvm/test/Transforms/GVN/no_speculative_loads_with_asan.ll @@ -53,3 +53,30 @@ define i32 @TestAsan() sanitize_address { ; CHECK-NOT: %[[LOAD:[^ ]+]] = load i32 ; CHECK: {{.*}} = phi + +define i32 @TestHWAsan() sanitize_hwaddress { + %1 = tail call noalias i8* @_Znam(i64 2) + %2 = getelementptr inbounds i8, i8* %1, i64 1 + store i8 0, i8* %2, align 1 + store i8 0, i8* %1, align 1 + %3 = bitcast i8* %1 to i16* + %4 = load i16, i16* %3, align 4 + %5 = icmp eq i16 %4, 0 + br i1 %5, label %11, label %6 + +; <label>:6 ; preds = %0 + %7 = getelementptr inbounds i8, i8* %1, i64 2 + %8 = bitcast i8* %7 to i16* + %9 = load i16, i16* %8, align 2 + %10 = sext i16 %9 to i32 + br label %11 + +; <label>:11 ; preds = %0, %6 + %12 = phi i32 [ %10, %6 ], [ 0, %0 ] + ret i32 %12 +} + +; CHECK-LABEL: @TestHWAsan +; CHECK-NOT: %[[LOAD:[^ ]+]] = load i32 +; CHECK: {{.*}} = phi + |