Files
TheRock/compiler/amd-llvm/llvm/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

62 lines
2.3 KiB
LLVM

; This test checks that we are not instrumenting unwanted acesses to globals:
; - Instructions with the !nosanitize metadata (e.g. -fprofile-arcs instrumented counter accesses)
; - Instruction profiler counter instrumentation has known intended races.
;
; RUN: opt < %s -passes='function(tsan),module(tsan-module)' -S | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.9"
@__profc_test_gep = private global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
@__profc_test_bitcast = private global [2 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
@__profc_test_bitcast_foo = private global [1 x i64] zeroinitializer, section "__DATA,__llvm_prf_cnts", align 8
@__llvm_gcov_ctr = internal global [1 x i64] zeroinitializer
@__llvm_gcov_ctr.1 = internal global [1 x i64] zeroinitializer
@__llvm_gcov_global_state_pred = internal global i32 0
@__llvm_gcda_foo = internal global i32 0
define i32 @test_gep() sanitize_thread {
entry:
%pgocount = load i64, ptr @__profc_test_gep, !nosanitize !0
%0 = add i64 %pgocount, 1
store i64 %0, ptr @__profc_test_gep, !nosanitize !0
%gcovcount = load i64, ptr @__llvm_gcov_ctr, !nosanitize !0
%1 = add i64 %gcovcount, 1
store i64 %1, ptr @__llvm_gcov_ctr, !nosanitize !0
%gcovcount.1 = load i64, ptr @__llvm_gcov_ctr.1, !nosanitize !0
%2 = add i64 %gcovcount.1, 1
store i64 %2, ptr @__llvm_gcov_ctr.1, !nosanitize !0
ret i32 1
}
define i32 @test_bitcast() sanitize_thread {
entry:
%0 = load <2 x i64>, ptr @__profc_test_bitcast, align 8, !nosanitize !0
%.promoted5 = load i64, ptr @__profc_test_bitcast_foo, align 8, !nosanitize !0
%1 = add i64 %.promoted5, 10
%2 = add <2 x i64> %0, <i64 1, i64 10>
store <2 x i64> %2, ptr @__profc_test_bitcast, align 8, !nosanitize !0
store i64 %1, ptr @__profc_test_bitcast_foo, align 8, !nosanitize !0
ret i32 undef
}
define void @test_load() sanitize_thread {
entry:
%0 = load i32, ptr @__llvm_gcov_global_state_pred, !nosanitize !0
store i32 1, ptr @__llvm_gcov_global_state_pred, !nosanitize !0
%1 = load i32, ptr @__llvm_gcda_foo, !nosanitize !0
store i32 1, ptr @__llvm_gcda_foo, !nosanitize !0
ret void
}
!0 = !{}
; CHECK-NOT: {{call void @__tsan_write}}
; CHECK: __tsan_init