diff --git a/clang/docs/DataFlowSanitizerDesign.rst b/clang/docs/DataFlowSanitizerDesign.rst --- a/clang/docs/DataFlowSanitizerDesign.rst +++ b/clang/docs/DataFlowSanitizerDesign.rst @@ -171,8 +171,8 @@ DFSan changes the ABI of each function in the module. This makes it possible for a function with the native ABI to be called with the instrumented ABI, or vice versa, thus possibly invoking undefined behavior. A simple way -of statically detecting instances of this problem is to prepend the prefix -"dfs$" to the name of each instrumented-ABI function. +of statically detecting instances of this problem is to append the suffix +".dfsan" to the name of each instrumented-ABI function. This will not catch every such problem; in particular function pointers passed across the instrumented-native barrier cannot be used on the other side. diff --git a/compiler-rt/test/dfsan/origin_memcpy.c b/compiler-rt/test/dfsan/origin_memcpy.c --- a/compiler-rt/test/dfsan/origin_memcpy.c +++ b/compiler-rt/test/dfsan/origin_memcpy.c @@ -44,12 +44,12 @@ // CHECK0: Taint value 0x8 {{.*}} origin tracking () // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_h {{.*}}origin_memcpy.c:[[@LINE-16]] +// CHECK0: #0 {{.*}} in fn_h.dfsan {{.*}}origin_memcpy.c:[[@LINE-16]] // CHECK0: #1 {{.*}} in main {{.*}}origin_memcpy.c:[[@LINE-8]] // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_g {{.*}}origin_memcpy.c:[[@LINE-30]] -// CHECK0: #1 {{.*}} in dfs$fn_f {{.*}}origin_memcpy.c:[[@LINE-26]] +// CHECK0: #0 {{.*}} in fn_g.dfsan {{.*}}origin_memcpy.c:[[@LINE-30]] +// CHECK0: #1 {{.*}} in fn_f.dfsan {{.*}}origin_memcpy.c:[[@LINE-26]] // CHECK0: #2 {{.*}} in main {{.*}}origin_memcpy.c:[[@LINE-14]] // CHECK0: Origin value: {{.*}}, Taint value was created at @@ -57,12 +57,12 @@ // CHECK10: Taint value 0x10 {{.*}} origin tracking () // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_h {{.*}}origin_memcpy.c:[[@LINE-29]] +// CHECK10: #0 {{.*}} in fn_h.dfsan {{.*}}origin_memcpy.c:[[@LINE-29]] // CHECK10: #1 {{.*}} in main {{.*}}origin_memcpy.c:[[@LINE-21]] // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_g {{.*}}origin_memcpy.c:[[@LINE-43]] -// CHECK10: #1 {{.*}} in dfs$fn_f {{.*}}origin_memcpy.c:[[@LINE-39]] +// CHECK10: #0 {{.*}} in fn_g.dfsan {{.*}}origin_memcpy.c:[[@LINE-43]] +// CHECK10: #1 {{.*}} in fn_f.dfsan {{.*}}origin_memcpy.c:[[@LINE-39]] // CHECK10: #2 {{.*}} in main {{.*}}origin_memcpy.c:[[@LINE-27]] // CHECK10: Origin value: {{.*}}, Taint value was created at diff --git a/compiler-rt/test/dfsan/origin_memmove.c b/compiler-rt/test/dfsan/origin_memmove.c --- a/compiler-rt/test/dfsan/origin_memmove.c +++ b/compiler-rt/test/dfsan/origin_memmove.c @@ -44,12 +44,12 @@ // CHECK0: Taint value 0x8 {{.*}} origin tracking () // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_h {{.*}}origin_memmove.c:[[@LINE-16]] +// CHECK0: #0 {{.*}} in fn_h.dfsan {{.*}}origin_memmove.c:[[@LINE-16]] // CHECK0: #1 {{.*}} in main {{.*}}origin_memmove.c:[[@LINE-8]] // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_g {{.*}}origin_memmove.c:[[@LINE-30]] -// CHECK0: #1 {{.*}} in dfs$fn_f {{.*}}origin_memmove.c:[[@LINE-26]] +// CHECK0: #0 {{.*}} in fn_g.dfsan {{.*}}origin_memmove.c:[[@LINE-30]] +// CHECK0: #1 {{.*}} in fn_f.dfsan {{.*}}origin_memmove.c:[[@LINE-26]] // CHECK0: #2 {{.*}} in main {{.*}}origin_memmove.c:[[@LINE-14]] // CHECK0: Origin value: {{.*}}, Taint value was created at @@ -57,12 +57,12 @@ // CHECK10: Taint value 0x10 {{.*}} origin tracking () // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_h {{.*}}origin_memmove.c:[[@LINE-29]] +// CHECK10: #0 {{.*}} in fn_h.dfsan {{.*}}origin_memmove.c:[[@LINE-29]] // CHECK10: #1 {{.*}} in main {{.*}}origin_memmove.c:[[@LINE-21]] // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_g {{.*}}origin_memmove.c:[[@LINE-43]] -// CHECK10: #1 {{.*}} in dfs$fn_f {{.*}}origin_memmove.c:[[@LINE-39]] +// CHECK10: #0 {{.*}} in fn_g.dfsan {{.*}}origin_memmove.c:[[@LINE-43]] +// CHECK10: #1 {{.*}} in fn_f.dfsan {{.*}}origin_memmove.c:[[@LINE-39]] // CHECK10: #2 {{.*}} in main {{.*}}origin_memmove.c:[[@LINE-27]] // CHECK10: Origin value: {{.*}}, Taint value was created at diff --git a/compiler-rt/test/dfsan/origin_stack_trace.c b/compiler-rt/test/dfsan/origin_stack_trace.c --- a/compiler-rt/test/dfsan/origin_stack_trace.c +++ b/compiler-rt/test/dfsan/origin_stack_trace.c @@ -39,9 +39,9 @@ // CHECK: #0 {{.*}} in main {{.*}}origin_stack_trace.c:[[@LINE-4]] // CHECK: Origin value: {{.*}}, Taint value was created at - // CHECK: #0 {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-19]] - // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-22]] - // CHECK: #9 {{.*}} in dfs$baz {{.*}}origin_stack_trace.c:[[@LINE-16]] + // CHECK: #0 {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-19]] + // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-22]] + // CHECK: #9 {{.*}} in baz.dfsan {{.*}}origin_stack_trace.c:[[@LINE-16]] char buf[3000]; size_t length = dfsan_sprint_origin_trace(&c, NULL, buf, sizeof(buf)); @@ -53,9 +53,9 @@ // CHECK: #0 {{.*}} in main {{.*}}origin_stack_trace.c:[[@LINE-18]] // CHECK: Origin value: {{.*}}, Taint value was created at - // CHECK: #0 {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-33]] - // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-36]] - // CHECK: #9 {{.*}} in dfs$baz {{.*}}origin_stack_trace.c:[[@LINE-30]] + // CHECK: #0 {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-33]] + // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-36]] + // CHECK: #9 {{.*}} in baz.dfsan {{.*}}origin_stack_trace.c:[[@LINE-30]] // CHECK: ==EOS== char tinybuf[18]; @@ -82,9 +82,9 @@ // CHECK: #0 {{.*}} in main {{.*}}origin_stack_trace.c:[[@LINE-47]] // CHECK: Origin value: {{.*}}, Taint value was created at - // CHECK: #0 {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-62]] - // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in dfs$bar {{.*}}origin_stack_trace.c:[[@LINE-65]] - // CHECK: #9 {{.*}} in dfs$baz {{.*}}origin_stack_trace.c:[[@LINE-59]] + // CHECK: #0 {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-62]] + // CHECK-COUNT-8: #{{[0-9]+}} {{.*}} in bar.dfsan {{.*}}origin_stack_trace.c:[[@LINE-65]] + // CHECK: #9 {{.*}} in baz.dfsan {{.*}}origin_stack_trace.c:[[@LINE-59]] // CHECK: ==EOS== printf("Returned length: %zu\n", length_with_desc); diff --git a/compiler-rt/test/dfsan/origin_track_ld.c b/compiler-rt/test/dfsan/origin_track_ld.c --- a/compiler-rt/test/dfsan/origin_track_ld.c +++ b/compiler-rt/test/dfsan/origin_track_ld.c @@ -21,7 +21,7 @@ // CHECK: #0 {{.*}} in main {{.*}}origin_track_ld.c:[[@LINE-6]] // CHECK: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK: #0 {{.*}} in dfs$foo {{.*}}origin_track_ld.c:[[@LINE-15]] +// CHECK: #0 {{.*}} in foo.dfsan {{.*}}origin_track_ld.c:[[@LINE-15]] // CHECK: #1 {{.*}} in main {{.*}}origin_track_ld.c:[[@LINE-10]] // CHECK: Origin value: {{.*}}, Taint value was stored to memory at diff --git a/compiler-rt/test/dfsan/origin_unaligned_memtrans.c b/compiler-rt/test/dfsan/origin_unaligned_memtrans.c --- a/compiler-rt/test/dfsan/origin_unaligned_memtrans.c +++ b/compiler-rt/test/dfsan/origin_unaligned_memtrans.c @@ -47,16 +47,16 @@ // CHECK0: Taint value 0x8 {{.*}} origin tracking () // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_i {{.*}}origin_unaligned_memtrans.c:[[@LINE-18]] +// CHECK0: #0 {{.*}} in fn_i.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-18]] // CHECK0: #1 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-8]] // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_h {{.*}}origin_unaligned_memtrans.c:[[@LINE-26]] +// CHECK0: #0 {{.*}} in fn_h.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-26]] // CHECK0: #1 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-13]] // CHECK0: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK0: #0 {{.*}} in dfs$fn_g {{.*}}origin_unaligned_memtrans.c:[[@LINE-38]] -// CHECK0: #1 {{.*}} in dfs$fn_f {{.*}}origin_unaligned_memtrans.c:[[@LINE-35]] +// CHECK0: #0 {{.*}} in fn_g.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-38]] +// CHECK0: #1 {{.*}} in fn_f.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-35]] // CHECK0: #2 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-19]] // CHECK0: Origin value: {{.*}}, Taint value was created at @@ -64,16 +64,16 @@ // CHECK10: Taint value 0x10 {{.*}} origin tracking // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_i {{.*}}origin_unaligned_memtrans.c:[[@LINE-35]] +// CHECK10: #0 {{.*}} in fn_i.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-35]] // CHECK10: #1 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-25]] // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_h {{.*}}origin_unaligned_memtrans.c:[[@LINE-43]] +// CHECK10: #0 {{.*}} in fn_h.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-43]] // CHECK10: #1 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-30]] // CHECK10: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK10: #0 {{.*}} in dfs$fn_g {{.*}}origin_unaligned_memtrans.c:[[@LINE-55]] -// CHECK10: #1 {{.*}} in dfs$fn_f {{.*}}origin_unaligned_memtrans.c:[[@LINE-52]] +// CHECK10: #0 {{.*}} in fn_g.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-55]] +// CHECK10: #1 {{.*}} in fn_f.dfsan {{.*}}origin_unaligned_memtrans.c:[[@LINE-52]] // CHECK10: #2 {{.*}} in main {{.*}}origin_unaligned_memtrans.c:[[@LINE-36]] // CHECK10: Origin value: {{.*}}, Taint value was created at diff --git a/compiler-rt/test/dfsan/origin_with_sigactions.c b/compiler-rt/test/dfsan/origin_with_sigactions.c --- a/compiler-rt/test/dfsan/origin_with_sigactions.c +++ b/compiler-rt/test/dfsan/origin_with_sigactions.c @@ -71,7 +71,7 @@ // CHECK: Taint value 0x8 {{.*}} origin tracking () // CHECK: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK-NOT: {{.*}} in dfs$CopyXtoYtoU {{.*}}origin_with_sigactions.c{{.*}} +// CHECK-NOT: {{.*}} in CopyXtoYtoU.dfsan {{.*}}origin_with_sigactions.c{{.*}} // CHECK: #0 {{.*}} in main {{.*}}origin_with_sigactions.c:[[@LINE-26]] diff --git a/compiler-rt/test/dfsan/origin_with_signals.cpp b/compiler-rt/test/dfsan/origin_with_signals.cpp --- a/compiler-rt/test/dfsan/origin_with_signals.cpp +++ b/compiler-rt/test/dfsan/origin_with_signals.cpp @@ -42,7 +42,7 @@ // CHECK: Taint value 0x8 {{.*}} origin tracking () // CHECK: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK-NOT: {{.*}} in dfs$SignalHandler {{.*}}origin_with_signals.cpp{{.*}} +// CHECK-NOT: {{.*}} in SignalHandler.dfsan {{.*}}origin_with_signals.cpp{{.*}} // CHECK: #0 {{.*}} in main {{.*}}origin_with_signals.cpp:[[@LINE-14]] diff --git a/compiler-rt/test/dfsan/pthread.c b/compiler-rt/test/dfsan/pthread.c --- a/compiler-rt/test/dfsan/pthread.c +++ b/compiler-rt/test/dfsan/pthread.c @@ -44,10 +44,10 @@ // CHECK: Taint value 0x8 {{.*}} origin tracking () // CHECK: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK: #0 {{.*}} in dfs$ThreadFn {{.*}}pthread.c:[[@LINE-21]] +// CHECK: #0 {{.*}} in ThreadFn.dfsan {{.*}}pthread.c:[[@LINE-21]] // CHECK: Origin value: {{.*}}, Taint value was stored to memory at -// CHECK: #0 {{.*}} in dfs$ThreadFn {{.*}}pthread.c:[[@LINE-26]] +// CHECK: #0 {{.*}} in ThreadFn.dfsan {{.*}}pthread.c:[[@LINE-26]] // CHECK: Origin value: {{.*}}, Taint value was created at // CHECK: #0 {{.*}} in main {{.*}}pthread.c:[[@LINE-20]] diff --git a/compiler-rt/test/dfsan/stack_trace.c b/compiler-rt/test/dfsan/stack_trace.c --- a/compiler-rt/test/dfsan/stack_trace.c +++ b/compiler-rt/test/dfsan/stack_trace.c @@ -36,9 +36,9 @@ printf("==OUTPUT==\n%s==EOS==\n", buf); // CHECK: ==OUTPUT== - // CHECK: #0 {{.*}} in dfs$bar [[FILEPATH]]/stack_trace.c:15 - // CHECK-COUNT-8: #{{[1-9]+}} {{.*}} in dfs$bar [[FILEPATH]]/stack_trace.c:18 - // CHECK: #9 {{.*}} in dfs$baz [[FILEPATH]]/stack_trace.c:22 + // CHECK: #0 {{.*}} in bar.dfsan [[FILEPATH]]/stack_trace.c:15 + // CHECK-COUNT-8: #{{[1-9]+}} {{.*}} in bar.dfsan [[FILEPATH]]/stack_trace.c:18 + // CHECK: #9 {{.*}} in baz.dfsan [[FILEPATH]]/stack_trace.c:22 // CHECK: #10 {{.*}} in main [[FILEPATH]]/stack_trace.c:[[# @LINE - 7 ]] // CHECK: ==EOS== diff --git a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp --- a/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp @@ -451,7 +451,7 @@ TransformedFunction getCustomFunctionType(FunctionType *T); InstrumentedABI getInstrumentedABI(); WrapperKind getWrapperKind(Function *F); - void addGlobalNamePrefix(GlobalValue *GV); + void addGlobalNameSuffix(GlobalValue *GV); Function *buildWrapperFunction(Function *F, StringRef NewFName, GlobalValue::LinkageTypes NewFLink, FunctionType *NewFT); @@ -1114,9 +1114,9 @@ return WK_Warning; } -void DataFlowSanitizer::addGlobalNamePrefix(GlobalValue *GV) { - std::string GVName = std::string(GV->getName()), Prefix = "dfs$"; - GV->setName(Prefix + GVName); +void DataFlowSanitizer::addGlobalNameSuffix(GlobalValue *GV) { + std::string GVName = std::string(GV->getName()), Suffix = ".dfsan"; + GV->setName(GVName + Suffix); // Try to change the name of the function in module inline asm. We only do // this for specific asm directives, currently only ".symver", to try to avoid @@ -1127,8 +1127,13 @@ std::string SearchStr = ".symver " + GVName + ","; size_t Pos = Asm.find(SearchStr); if (Pos != std::string::npos) { - Asm.replace(Pos, SearchStr.size(), - ".symver " + Prefix + GVName + "," + Prefix); + Asm.replace(Pos, SearchStr.size(), ".symver " + GVName + Suffix + ","); + Pos = Asm.find("@"); + + if (Pos == std::string::npos) + report_fatal_error("unsupported .symver: " + Asm); + + Asm.replace(Pos, 1, Suffix + "@"); GV->getParent()->setModuleInlineAsm(Asm); } } @@ -1416,7 +1421,7 @@ bool GAInst = isInstrumented(GA), FInst = isInstrumented(F); if (GAInst && FInst) { - addGlobalNamePrefix(GA); + addGlobalNameSuffix(GA); } else if (GAInst != FInst) { // Non-instrumented alias of an instrumented function, or vice versa. // Replace the alias with a native-ABI wrapper of the aliasee. The pass @@ -1445,8 +1450,9 @@ FT->getReturnType()->isVoidTy()); if (isInstrumented(&F)) { - // Instrumented functions get a 'dfs$' prefix. This allows us to more - // easily identify cases of mismatching ABIs. + // Instrumented functions get a '.dfsan' suffix. This allows us to more + // easily identify cases of mismatching ABIs. This naming scheme is + // mangling-compatible (see Itanium ABI), using a vendor-specific suffix. if (getInstrumentedABI() == IA_Args && !IsZeroArgsVoidRet) { FunctionType *NewFT = getArgsFunctionType(FT); Function *NewF = Function::Create(NewFT, F.getLinkage(), @@ -1478,9 +1484,9 @@ NewF->takeName(&F); F.eraseFromParent(); *FI = NewF; - addGlobalNamePrefix(NewF); + addGlobalNameSuffix(NewF); } else { - addGlobalNamePrefix(&F); + addGlobalNameSuffix(&F); } } else if (!IsZeroArgsVoidRet || getWrapperKind(&F) == WK_Custom) { // Build a wrapper function for F. The wrapper simply calls F, and is diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll b/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/abilist.ll @@ -17,7 +17,7 @@ } ; CHECK: define i32 (i32, i32)* @discardg(i32 %0) -; CHECK: %[[CALL:.*]] = call { i32 (i32, i32)*, i[[#SBITS]] } @"dfs$g"(i32 %0, i[[#SBITS]] 0) +; CHECK: %[[CALL:.*]] = call { i32 (i32, i32)*, i[[#SBITS]] } @g.dfsan(i32 %0, i[[#SBITS]] 0) ; CHECK: %[[XVAL:.*]] = extractvalue { i32 (i32, i32)*, i[[#SBITS]] } %[[CALL]], 0 ; CHECK: ret {{.*}} %[[XVAL]] @discardg = alias i32 (i32, i32)* (i32), i32 (i32, i32)* (i32)* @g @@ -44,7 +44,7 @@ declare i32 @cb(i32) -; CHECK: @"dfs$f" +; CHECK: @f.dfsan define void @f(i32 %x) { ; CHECK: %[[LABELVA2:.*]] = alloca [2 x i[[#SBITS]]] ; CHECK: %[[LABELVA1:.*]] = alloca [2 x i[[#SBITS]]] @@ -56,7 +56,7 @@ ; CHECK: call i32 @__dfsw_custom2(i32 1, i32 2, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext 0, i[[#SBITS]]* %[[LABELRETURN]]) call i32 @custom2(i32 1, i32 2) - ; CHECK: call void @__dfsw_customcb({{.*}} @"dfst0$customcb", i8* bitcast ({{.*}} @"dfs$cb" to i8*), i[[#SBITS]] zeroext 0) + ; CHECK: call void @__dfsw_customcb({{.*}} @"dfst0$customcb", i8* bitcast ({{.*}} @cb.dfsan to i8*), i[[#SBITS]] zeroext 0) call void @customcb(i32 (i32)* @cb) ; CHECK: %[[LABELVA1_0:.*]] = getelementptr inbounds [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* %[[LABELVA1]], i32 0, i32 0 @@ -75,13 +75,13 @@ ret void } -; CHECK: @"dfs$g" +; CHECK: @g.dfsan define i32 (i32, i32)* @g(i32) { ; CHECK: ret {{.*}} @"dfsw$custom2" ret i32 (i32, i32)* @custom2 } -; CHECK: define { i32, i[[#SBITS]] } @"dfs$adiscard"(i32 %0, i32 %1, i[[#SBITS]] %2, i[[#SBITS]] %3) +; CHECK: define { i32, i[[#SBITS]] } @adiscard.dfsan(i32 %0, i32 %1, i[[#SBITS]] %2, i[[#SBITS]] %3) ; CHECK: %[[CALL:.*]] = call i32 @discard(i32 %0, i32 %1) ; CHECK: %[[IVAL0:.*]] = insertvalue { i32, i[[#SBITS]] } undef, i32 %[[CALL]], 0 ; CHECK: %[[IVAL1:.*]] = insertvalue { i32, i[[#SBITS]] } %[[IVAL0]], i[[#SBITS]] 0, 1 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/abilist_aggregate.ll b/llvm/test/Instrumentation/DataFlowSanitizer/abilist_aggregate.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/abilist_aggregate.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/abilist_aggregate.ll @@ -17,7 +17,7 @@ } define {i1, i7} @call_functional({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI-LABEL: @"dfs$call_functional" + ; TLS_ABI-LABEL: @call_functional.dfsan ; TLS_ABI-NEXT: %[[#REG:]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI-NEXT: %[[#REG+1]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; TLS_ABI-NEXT: %[[#REG+2]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } %[[#REG+1]], 0 @@ -31,7 +31,7 @@ ; TLS_ABI-NEXT: %[[#REG+10]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } %[[#REG+9]], i[[#SBITS]] %[[#REG+8]], 1 ; TLS_ABI: store { i[[#SBITS]], i[[#SBITS]] } %[[#REG+10]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] - ; ARGS_ABI: @"dfs$call_functional"({ i32, i1 } %0, [2 x i7] %1, i[[#SBITS]] %2, i[[#SBITS]] %3) + ; ARGS_ABI: @call_functional.dfsan({ i32, i1 } %0, [2 x i7] %1, i[[#SBITS]] %2, i[[#SBITS]] %3) ; ARGS_ABI: %[[#U:]] = or i[[#SBITS]] %2, %3 ; ARGS_ABI: %r = call { i1, i7 } @functional({ i32, i1 } %0, [2 x i7] %1) ; ARGS_ABI: %[[#R:]] = insertvalue { { i1, i7 }, i[[#SBITS]] } undef, { i1, i7 } %r, 0 @@ -52,10 +52,10 @@ } define {i1, i7} @call_discard({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: @"dfs$call_discard" + ; TLS_ABI: @call_discard.dfsan ; TLS_ABI: store { i[[#SBITS]], i[[#SBITS]] } zeroinitializer, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align 2 - ; ARGS_ABI: @"dfs$call_discard" + ; ARGS_ABI: @call_discard.dfsan ; ARGS_ABI: %r = call { i1, i7 } @discard({ i32, i1 } %0, [2 x i7] %1) ; ARGS_ABI: [[R0:%.*]] = insertvalue { { i1, i7 }, i[[#SBITS]] } undef, { i1, i7 } %r, 0 ; ARGS_ABI: [[R1:%.*]] = insertvalue { { i1, i7 }, i[[#SBITS]] } [[R0]], i[[#SBITS]] 0, 1 @@ -75,11 +75,11 @@ } define {i1, i7} @call_uninstrumented({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: @"dfs$call_uninstrumented" + ; TLS_ABI: @call_uninstrumented.dfsan ; TLS_ABI: call void @__dfsan_unimplemented ; TLS_ABI: store { i[[#SBITS]], i[[#SBITS]] } zeroinitializer, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align 2 - ; ARGS_ABI: @"dfs$call_uninstrumented" + ; ARGS_ABI: @call_uninstrumented.dfsan ; ARGS_ABI: call void @__dfsan_unimplemented ; ARGS_ABI: %r = call { i1, i7 } @uninstrumented({ i32, i1 } %0, [2 x i7] %1) ; ARGS_ABI: [[R0:%.*]] = insertvalue { { i1, i7 }, i[[#SBITS]] } undef, { i1, i7 } %r, 0 @@ -91,7 +91,7 @@ } define {i1, i7} @call_custom_with_ret({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: @"dfs$call_custom_with_ret" + ; TLS_ABI: @call_custom_with_ret.dfsan ; TLS_ABI: %labelreturn = alloca i[[#SBITS]], align [[#SBYTES]] ; TLS_ABI: [[B:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI: [[A:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] @@ -113,7 +113,7 @@ } define void @call_custom_without_ret({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: @"dfs$call_custom_without_ret" + ; TLS_ABI: @call_custom_without_ret.dfsan ; TLS_ABI: [[B:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI: [[A:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; TLS_ABI: [[A0:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[A]], 0 @@ -129,7 +129,7 @@ } define void @call_custom_varg({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: @"dfs$call_custom_varg" + ; TLS_ABI: @call_custom_varg.dfsan ; TLS_ABI: [[B:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI: %labelva = alloca [1 x i[[#SBITS]]], align [[#SBYTES]] ; TLS_ABI: [[A:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] @@ -149,7 +149,7 @@ } define {i1, i7} @call_custom_cb({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: define { i1, i7 } @"dfs$call_custom_cb"({ i32, i1 } %a, [2 x i7] %b) { + ; TLS_ABI: define { i1, i7 } @call_custom_cb.dfsan({ i32, i1 } %a, [2 x i7] %b) { ; TLS_ABI: %labelreturn = alloca i[[#SBITS]], align [[#SBYTES]] ; TLS_ABI: [[B:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI: [[A:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] @@ -159,7 +159,7 @@ ; TLS_ABI: [[B0:%.*]] = extractvalue [2 x i[[#SBITS]]] [[B]], 0 ; TLS_ABI: [[B1:%.*]] = extractvalue [2 x i[[#SBITS]]] [[B]], 1 ; TLS_ABI: [[B01:%.*]] = or i[[#SBITS]] [[B0]], [[B1]] - ; TLS_ABI: [[R:%.*]] = call { i1, i7 } @__dfsw_custom_cb({ i1, i7 } ({ i1, i7 } ({ i32, i1 }, [2 x i7])*, { i32, i1 }, [2 x i7], i[[#SBITS]], i[[#SBITS]], i[[#SBITS]]*)* @"dfst0$custom_cb", i8* bitcast ({ i1, i7 } ({ i32, i1 }, [2 x i7])* @"dfs$cb" to i8*), { i32, i1 } %a, [2 x i7] %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[A01]], i[[#SBITS]] zeroext [[B01]], i[[#SBITS]]* %labelreturn) + ; TLS_ABI: [[R:%.*]] = call { i1, i7 } @__dfsw_custom_cb({ i1, i7 } ({ i1, i7 } ({ i32, i1 }, [2 x i7])*, { i32, i1 }, [2 x i7], i[[#SBITS]], i[[#SBITS]], i[[#SBITS]]*)* @"dfst0$custom_cb", i8* bitcast ({ i1, i7 } ({ i32, i1 }, [2 x i7])* @cb.dfsan to i8*), { i32, i1 } %a, [2 x i7] %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[A01]], i[[#SBITS]] zeroext [[B01]], i[[#SBITS]]* %labelreturn) ; TLS_ABI: [[RE:%.*]] = load i[[#SBITS]], i[[#SBITS]]* %labelreturn, align [[#SBYTES]] ; TLS_ABI: [[RS0:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } undef, i[[#SBITS]] [[RE]], 0 ; TLS_ABI: [[RS1:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } [[RS0]], i[[#SBITS]] [[RE]], 1 @@ -177,7 +177,7 @@ } define {i1, i7} @cb({i32, i1} %a, [2 x i7] %b) { - ; TLS_ABI: define { i1, i7 } @"dfs$cb"({ i32, i1 } %a, [2 x i7] %b) + ; TLS_ABI: define { i1, i7 } @cb.dfsan({ i32, i1 } %a, [2 x i7] %b) ; TLS_ABI: [[BL:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 [[#mul(2,SBYTES)]]) to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; TLS_ABI: [[AL:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([100 x i64]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; TLS_ABI: [[AL1:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[AL]], 1 @@ -194,7 +194,7 @@ } define {i1, i7} ({i32, i1}, [2 x i7])* @ret_custom() { - ; TLS_ABI: @"dfs$ret_custom" + ; TLS_ABI: @ret_custom.dfsan ; TLS_ABI: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 ; TLS_ABI: ret {{.*}} @"dfsw$custom_with_ret" ret {i1, i7} ({i32, i1}, [2 x i7])* @custom_with_ret diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll b/llvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/args-unreachable-bb.ll @@ -5,7 +5,7 @@ ; CHECK: @__dfsan_shadow_width_bits = weak_odr constant i32 [[#SBITS:]] ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] -; CHECK-LABEL: @"dfs$unreachable_bb1" +; CHECK-LABEL: @unreachable_bb1.dfsan define i8 @unreachable_bb1() { ; CHECK: ret { i8, i[[#SBITS]] } { i8 1, i[[#SBITS]] 0 } ; CHECK-NOT: bb2: @@ -25,7 +25,7 @@ declare void @abort() noreturn -; CHECK-LABEL: @"dfs$unreachable_bb2" +; CHECK-LABEL: @unreachable_bb2.dfsan define i8 @unreachable_bb2() { call void @abort() noreturn ; CHECK-NOT: i8 12 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll b/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/arith.ll @@ -6,7 +6,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i8 @add(i8 %a, i8 %b) { - ; CHECK: @"dfs$add" + ; CHECK: @add.dfsan ; CHECK-DAG: %[[#ALABEL:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[ARGTLSTYPE:\[100 x i64\]]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; CHECK-DAG: %[[#BLABEL:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[ARGTLSTYPE]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; CHECK: %[[#UNION:]] = or i[[#SBITS]] %[[#ALABEL]], %[[#BLABEL]] @@ -18,7 +18,7 @@ } define i8 @sub(i8 %a, i8 %b) { - ; CHECK: @"dfs$sub" + ; CHECK: @sub.dfsan ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: or i[[#SBITS]] @@ -30,7 +30,7 @@ } define i8 @mul(i8 %a, i8 %b) { - ; CHECK: @"dfs$mul" + ; CHECK: @mul.dfsan ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: or i[[#SBITS]] @@ -42,7 +42,7 @@ } define i8 @sdiv(i8 %a, i8 %b) { - ; CHECK: @"dfs$sdiv" + ; CHECK: @sdiv.dfsan ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: or i[[#SBITS]] @@ -54,7 +54,7 @@ } define i8 @udiv(i8 %a, i8 %b) { - ; CHECK: @"dfs$udiv" + ; CHECK: @udiv.dfsan ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: or i[[#SBITS]] @@ -66,7 +66,7 @@ } define double @fneg(double %a) { - ; CHECK: @"dfs$fneg" + ; CHECK: @fneg.dfsan ; CHECK: load{{.*}}__dfsan_arg_tls ; CHECK: %c = fneg double %a ; CHECK: store{{.*}}__dfsan_retval_tls diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/array.ll b/llvm/test/Instrumentation/DataFlowSanitizer/array.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/array.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/array.ll @@ -13,14 +13,14 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define [4 x i8] @pass_array([4 x i8] %a) { - ; NO_COMBINE_LOAD_PTR: @"dfs$pass_array" + ; NO_COMBINE_LOAD_PTR: @pass_array.dfsan ; NO_COMBINE_LOAD_PTR: %1 = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: store [4 x i[[#SBITS]]] %1, [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [4 x i[[#SBITS]]]*), align [[ALIGN]] - ; ARGS_ABI: @"dfs$pass_array" + ; ARGS_ABI: @pass_array.dfsan ; ARGS_ABI: ret { [4 x i8], i[[#SBITS]] } - ; DEBUG_NONZERO_LABELS: @"dfs$pass_array" + ; DEBUG_NONZERO_LABELS: @pass_array.dfsan ; DEBUG_NONZERO_LABELS: [[L:%.*]] = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN:2]] ; DEBUG_NONZERO_LABELS: [[L0:%.*]] = extractvalue [4 x i[[#SBITS]]] [[L]], 0 ; DEBUG_NONZERO_LABELS: [[L1:%.*]] = extractvalue [4 x i[[#SBITS]]] [[L]], 1 @@ -38,24 +38,24 @@ %ArrayOfStruct = type [4 x {i8*, i32}] define %ArrayOfStruct @pass_array_of_struct(%ArrayOfStruct %as) { - ; NO_COMBINE_LOAD_PTR: @"dfs$pass_array_of_struct" + ; NO_COMBINE_LOAD_PTR: @pass_array_of_struct.dfsan ; NO_COMBINE_LOAD_PTR: %1 = load [4 x { i[[#SBITS]], i[[#SBITS]] }], [4 x { i[[#SBITS]], i[[#SBITS]] }]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x { i[[#SBITS]], i[[#SBITS]] }]*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: store [4 x { i[[#SBITS]], i[[#SBITS]] }] %1, [4 x { i[[#SBITS]], i[[#SBITS]] }]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [4 x { i[[#SBITS]], i[[#SBITS]] }]*), align [[ALIGN]] - ; ARGS_ABI: @"dfs$pass_array_of_struct" + ; ARGS_ABI: @pass_array_of_struct.dfsan ; ARGS_ABI: ret { [4 x { i8*, i32 }], i[[#SBITS]] } ret %ArrayOfStruct %as } define [4 x i1]* @alloca_ret_array() { - ; NO_COMBINE_LOAD_PTR: @"dfs$alloca_ret_array" + ; NO_COMBINE_LOAD_PTR: @alloca_ret_array.dfsan ; NO_COMBINE_LOAD_PTR: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 %p = alloca [4 x i1] ret [4 x i1]* %p } define [4 x i1] @load_alloca_array() { - ; NO_COMBINE_LOAD_PTR-LABEL: @"dfs$load_alloca_array" + ; NO_COMBINE_LOAD_PTR-LABEL: @load_alloca_array.dfsan ; NO_COMBINE_LOAD_PTR-NEXT: %[[#R:]] = alloca i[[#SBITS]], align [[#SBYTES]] ; NO_COMBINE_LOAD_PTR-NEXT: %p = alloca [4 x i1] ; NO_COMBINE_LOAD_PTR-NEXT: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* %[[#R]], align [[#SBYTES]] @@ -73,23 +73,23 @@ } define [0 x i1] @load_array0([0 x i1]* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_array0" + ; NO_COMBINE_LOAD_PTR: @load_array0.dfsan ; NO_COMBINE_LOAD_PTR: store [0 x i[[#SBITS]]] zeroinitializer, [0 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [0 x i[[#SBITS]]]*), align 2 %a = load [0 x i1], [0 x i1]* %p ret [0 x i1] %a } define [1 x i1] @load_array1([1 x i1]* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_array1" + ; NO_COMBINE_LOAD_PTR: @load_array1.dfsan ; NO_COMBINE_LOAD_PTR: [[L:%.*]] = load i[[#SBITS]], ; NO_COMBINE_LOAD_PTR: [[S:%.*]] = insertvalue [1 x i[[#SBITS]]] undef, i[[#SBITS]] [[L]], 0 ; NO_COMBINE_LOAD_PTR: store [1 x i[[#SBITS]]] [[S]], [1 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [1 x i[[#SBITS]]]*), align 2 - ; EVENT_CALLBACKS: @"dfs$load_array1" + ; EVENT_CALLBACKS: @load_array1.dfsan ; EVENT_CALLBACKS: [[L:%.*]] = or i[[#SBITS]] ; EVENT_CALLBACKS: call void @__dfsan_load_callback(i[[#SBITS]] [[L]], i8* {{.*}}) - ; FAST: @"dfs$load_array1" + ; FAST: @load_array1.dfsan ; FAST: [[P:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: [[L:%.*]] = load i[[#SBITS]], i[[#SBITS]]* {{.*}}, align [[#SBYTES]] ; FAST: [[U:%.*]] = or i[[#SBITS]] [[L]], [[P]] @@ -101,7 +101,7 @@ } define [2 x i1] @load_array2([2 x i1]* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_array2" + ; NO_COMBINE_LOAD_PTR: @load_array2.dfsan ; NO_COMBINE_LOAD_PTR: [[P1:%.*]] = getelementptr i[[#SBITS]], i[[#SBITS]]* [[P0:%.*]], i64 1 ; NO_COMBINE_LOAD_PTR-DAG: [[E1:%.*]] = load i[[#SBITS]], i[[#SBITS]]* [[P1]], align [[#SBYTES]] ; NO_COMBINE_LOAD_PTR-DAG: [[E0:%.*]] = load i[[#SBITS]], i[[#SBITS]]* [[P0]], align [[#SBYTES]] @@ -110,12 +110,12 @@ ; NO_COMBINE_LOAD_PTR: [[S2:%.*]] = insertvalue [2 x i[[#SBITS]]] [[S1]], i[[#SBITS]] [[U]], 1 ; NO_COMBINE_LOAD_PTR: store [2 x i[[#SBITS]]] [[S2]], [2 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] - ; EVENT_CALLBACKS: @"dfs$load_array2" + ; EVENT_CALLBACKS: @load_array2.dfsan ; EVENT_CALLBACKS: [[O1:%.*]] = or i[[#SBITS]] ; EVENT_CALLBACKS: [[O2:%.*]] = or i[[#SBITS]] [[O1]] ; EVENT_CALLBACKS: call void @__dfsan_load_callback(i[[#SBITS]] [[O2]], i8* {{.*}}) - ; FAST: @"dfs$load_array2" + ; FAST: @load_array2.dfsan ; FAST: [[P:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: [[O:%.*]] = or i[[#SBITS]] ; FAST: [[U:%.*]] = or i[[#SBITS]] [[O]], [[P]] @@ -127,7 +127,7 @@ } define [4 x i1] @load_array4([4 x i1]* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_array4" + ; NO_COMBINE_LOAD_PTR: @load_array4.dfsan ; NO_COMBINE_LOAD_PTR: [[T:%.*]] = trunc i[[#mul(4, SBITS)]] {{.*}} to i[[#SBITS]] ; NO_COMBINE_LOAD_PTR: [[S1:%.*]] = insertvalue [4 x i[[#SBITS]]] undef, i[[#SBITS]] [[T]], 0 ; NO_COMBINE_LOAD_PTR: [[S2:%.*]] = insertvalue [4 x i[[#SBITS]]] [[S1]], i[[#SBITS]] [[T]], 1 @@ -135,14 +135,14 @@ ; NO_COMBINE_LOAD_PTR: [[S4:%.*]] = insertvalue [4 x i[[#SBITS]]] [[S3]], i[[#SBITS]] [[T]], 3 ; NO_COMBINE_LOAD_PTR: store [4 x i[[#SBITS]]] [[S4]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [4 x i[[#SBITS]]]*), align 2 - ; EVENT_CALLBACKS: @"dfs$load_array4" + ; EVENT_CALLBACKS: @load_array4.dfsan ; EVENT_CALLBACKS: [[O0:%.*]] = or i[[#mul(4, SBITS)]] ; EVENT_CALLBACKS: [[O1:%.*]] = or i[[#mul(4, SBITS)]] [[O0]] ; EVENT_CALLBACKS: [[O2:%.*]] = trunc i[[#mul(4, SBITS)]] [[O1]] to i[[#SBITS]] ; EVENT_CALLBACKS: [[O3:%.*]] = or i[[#SBITS]] [[O2]] ; EVENT_CALLBACKS: call void @__dfsan_load_callback(i[[#SBITS]] [[O3]], i8* {{.*}}) - ; FAST: @"dfs$load_array4" + ; FAST: @load_array4.dfsan ; FAST: [[T:%.*]] = trunc i[[#mul(4, SBITS)]] {{.*}} to i[[#SBITS]] ; FAST: [[O:%.*]] = or i[[#SBITS]] [[T]] ; FAST: [[S1:%.*]] = insertvalue [4 x i[[#SBITS]]] undef, i[[#SBITS]] [[O]], 0 @@ -156,7 +156,7 @@ } define i1 @extract_array([4 x i1] %a) { - ; NO_COMBINE_LOAD_PTR: @"dfs$extract_array" + ; NO_COMBINE_LOAD_PTR: @extract_array.dfsan ; NO_COMBINE_LOAD_PTR: [[AM:%.*]] = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: [[EM:%.*]] = extractvalue [4 x i[[#SBITS]]] [[AM]], 2 ; NO_COMBINE_LOAD_PTR: store i[[#SBITS]] [[EM]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 @@ -165,7 +165,7 @@ } define [4 x i1] @insert_array([4 x i1] %a, i1 %e2) { - ; NO_COMBINE_LOAD_PTR: @"dfs$insert_array" + ; NO_COMBINE_LOAD_PTR: @insert_array.dfsan ; NO_COMBINE_LOAD_PTR: [[EM:%.*]] = load i[[#SBITS]], i[[#SBITS]]* ; NO_COMBINE_LOAD_PTR-SAME: inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(4, SBYTES)]]) to i[[#SBITS]]*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: [[AM:%.*]] = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN]] @@ -176,7 +176,7 @@ } define void @store_alloca_array([4 x i1] %a) { - ; FAST: @"dfs$store_alloca_array" + ; FAST: @store_alloca_array.dfsan ; FAST: [[S:%.*]] = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN:2]] ; FAST: [[SP:%.*]] = alloca i[[#SBITS]], align [[#SBYTES]] ; FAST: [[E0:%.*]] = extractvalue [4 x i[[#SBITS]]] [[S]], 0 @@ -193,19 +193,19 @@ } define void @store_zero_array([4 x i1]* %p) { - ; FAST: @"dfs$store_zero_array" + ; FAST: @store_zero_array.dfsan ; FAST: store i[[#mul(4, SBITS)]] 0, i[[#mul(4, SBITS)]]* {{.*}} store [4 x i1] zeroinitializer, [4 x i1]* %p ret void } define void @store_array2([2 x i1] %a, [2 x i1]* %p) { - ; EVENT_CALLBACKS: @"dfs$store_array2" + ; EVENT_CALLBACKS: @store_array2.dfsan ; EVENT_CALLBACKS: [[E12:%.*]] = or i[[#SBITS]] ; EVENT_CALLBACKS: [[P:%.*]] = bitcast [2 x i1]* %p to i8* ; EVENT_CALLBACKS: call void @__dfsan_store_callback(i[[#SBITS]] [[E12]], i8* [[P]]) - ; FAST: @"dfs$store_array2" + ; FAST: @store_array2.dfsan ; FAST: [[S:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [2 x i[[#SBITS]]]*), align [[ALIGN:2]] ; FAST: [[E1:%.*]] = extractvalue [2 x i[[#SBITS]]] [[S]], 0 ; FAST: [[E2:%.*]] = extractvalue [2 x i[[#SBITS]]] [[S]], 1 @@ -215,7 +215,7 @@ ; FAST: [[SP1:%.*]] = getelementptr i[[#SBITS]], i[[#SBITS]]* [[SP]], i32 1 ; FAST: store i[[#SBITS]] [[E12]], i[[#SBITS]]* [[SP1]], align [[#SBYTES]] - ; COMBINE_STORE_PTR: @"dfs$store_array2" + ; COMBINE_STORE_PTR: @store_array2.dfsan ; COMBINE_STORE_PTR: [[O:%.*]] = or i[[#SBITS]] ; COMBINE_STORE_PTR: [[U:%.*]] = or i[[#SBITS]] [[O]] ; COMBINE_STORE_PTR: [[P1:%.*]] = getelementptr i[[#SBITS]], i[[#SBITS]]* [[P:%.*]], i32 0 @@ -228,7 +228,7 @@ } define void @store_array17([17 x i1] %a, [17 x i1]* %p) { - ; FAST: @"dfs$store_array17" + ; FAST: @store_array17.dfsan ; FAST: %[[#R:]] = load [17 x i[[#SBITS]]], [17 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [17 x i[[#SBITS]]]*), align 2 ; FAST: %[[#R+1]] = extractvalue [17 x i[[#SBITS]]] %[[#R]], 0 ; FAST: %[[#R+2]] = extractvalue [17 x i[[#SBITS]]] %[[#R]], 1 @@ -283,13 +283,13 @@ } define [2 x i32] @const_array() { - ; FAST: @"dfs$const_array" + ; FAST: @const_array.dfsan ; FAST: store [2 x i[[#SBITS]]] zeroinitializer, [2 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [2 x i[[#SBITS]]]*), align 2 ret [2 x i32] [ i32 42, i32 11 ] } define [4 x i8] @call_array([4 x i8] %a) { - ; FAST-LABEL: @"dfs$call_array" + ; FAST-LABEL: @call_array.dfsan ; FAST: %[[#R:]] = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN:2]] ; FAST: store [4 x i[[#SBITS]]] %[[#R]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to [4 x i[[#SBITS]]]*), align [[ALIGN]] ; FAST: %_dfsret = load [4 x i[[#SBITS]]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [4 x i[[#SBITS]]]*), align [[ALIGN]] @@ -302,20 +302,20 @@ %LargeArr = type [1000 x i8] define i8 @fun_with_large_args(i1 %i, %LargeArr %a) { - ; FAST: @"dfs$fun_with_large_args" + ; FAST: @fun_with_large_args.dfsan ; FAST: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 %r = extractvalue %LargeArr %a, 0 ret i8 %r } define %LargeArr @fun_with_large_ret() { - ; FAST: @"dfs$fun_with_large_ret" + ; FAST: @fun_with_large_ret.dfsan ; FAST-NEXT: ret [1000 x i8] zeroinitializer ret %LargeArr zeroinitializer } define i8 @call_fun_with_large_ret() { - ; FAST: @"dfs$call_fun_with_large_ret" + ; FAST: @call_fun_with_large_ret.dfsan ; FAST: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 %r = call %LargeArr @fun_with_large_ret() %e = extractvalue %LargeArr %r, 0 @@ -323,10 +323,10 @@ } define i8 @call_fun_with_large_args(i1 %i, %LargeArr %a) { - ; FAST: @"dfs$call_fun_with_large_args" + ; FAST: @call_fun_with_large_args.dfsan ; FAST: [[I:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: store i[[#SBITS]] [[I]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] - ; FAST: %r = call i8 @"dfs$fun_with_large_args"(i1 %i, [1000 x i8] %a) + ; FAST: %r = call i8 @fun_with_large_args.dfsan(i1 %i, [1000 x i8] %a) %r = call i8 @fun_with_large_args(i1 %i, %LargeArr %a) ret i8 %r diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/atomics.ll b/llvm/test/Instrumentation/DataFlowSanitizer/atomics.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/atomics.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/atomics.ll @@ -13,7 +13,7 @@ entry: ; COMM: atomicrmw xchg: store clean shadow/origin, return clean shadow/origin - ; CHECK-LABEL: @"dfs$AtomicRmwXchg" + ; CHECK-LABEL: @AtomicRmwXchg.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK: %[[#INTP:]] = ptrtoint i32* %p to i64 @@ -33,7 +33,7 @@ define i32 @AtomicRmwMax(i32* %p, i32 %x) { ; COMM: atomicrmw max: exactly the same as above - ; CHECK-LABEL: @"dfs$AtomicRmwMax" + ; CHECK-LABEL: @AtomicRmwMax.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK: %[[#INTP:]] = ptrtoint i32* %p to i64 @@ -55,7 +55,7 @@ define i32 @Cmpxchg(i32* %p, i32 %a, i32 %b) { ; COMM: cmpxchg: store clean shadow/origin, return clean shadow/origin - ; CHECK-LABEL: @"dfs$Cmpxchg" + ; CHECK-LABEL: @Cmpxchg.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK: %[[#INTP:]] = ptrtoint i32* %p to i64 @@ -78,7 +78,7 @@ define i32 @CmpxchgMonotonic(i32* %p, i32 %a, i32 %b) { ; COMM: relaxed cmpxchg: bump up to "release monotonic" - ; CHECK-LABEL: @"dfs$CmpxchgMonotonic" + ; CHECK-LABEL: @CmpxchgMonotonic.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK: %[[#INTP:]] = ptrtoint i32* %p to i64 @@ -102,7 +102,7 @@ define i32 @AtomicLoad(i32* %p) { ; COMM: atomic load: load shadow value after app value - ; CHECK-LABEL: @"dfs$AtomicLoad" + ; CHECK-LABEL: @AtomicLoad.dfsan ; CHECK_ORIGIN: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 ; CHECK: %a = load atomic i32, i32* %p seq_cst, align 16 @@ -127,7 +127,7 @@ define i32 @AtomicLoadAcquire(i32* %p) { ; COMM: atomic load: load shadow value after app value - ; CHECK-LABEL: @"dfs$AtomicLoadAcquire" + ; CHECK-LABEL: @AtomicLoadAcquire.dfsan ; CHECK_ORIGIN: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 ; CHECK: %a = load atomic i32, i32* %p acquire, align 16 @@ -152,7 +152,7 @@ define i32 @AtomicLoadMonotonic(i32* %p) { ; COMM: atomic load monotonic: bump up to load acquire - ; CHECK-LABEL: @"dfs$AtomicLoadMonotonic" + ; CHECK-LABEL: @AtomicLoadMonotonic.dfsan ; CHECK_ORIGIN: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 ; CHECK: %a = load atomic i32, i32* %p acquire, align 16 @@ -176,7 +176,7 @@ define i32 @AtomicLoadUnordered(i32* %p) { ; COMM: atomic load unordered: bump up to load acquire - ; CHECK-LABEL: @"dfs$AtomicLoadUnordered" + ; CHECK-LABEL: @AtomicLoadUnordered.dfsan ; CHECK_ORIGIN: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 ; CHECK: %a = load atomic i32, i32* %p acquire, align 16 @@ -200,7 +200,7 @@ define void @AtomicStore(i32* %p, i32 %x) { ; COMM: atomic store: store clean shadow value before app value - ; CHECK-LABEL: @"dfs$AtomicStore" + ; CHECK-LABEL: @AtomicStore.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK_ORIGIN-NOT: 35184372088832 @@ -220,7 +220,7 @@ define void @AtomicStoreRelease(i32* %p, i32 %x) { ; COMM: atomic store: store clean shadow value before app value - ; CHECK-LABEL: @"dfs$AtomicStoreRelease" + ; CHECK-LABEL: @AtomicStoreRelease.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK_ORIGIN-NOT: 35184372088832 @@ -240,7 +240,7 @@ define void @AtomicStoreMonotonic(i32* %p, i32 %x) { ; COMM: atomic store monotonic: bumped up to store release - ; CHECK-LABEL: @"dfs$AtomicStoreMonotonic" + ; CHECK-LABEL: @AtomicStoreMonotonic.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK_ORIGIN-NOT: 35184372088832 @@ -260,7 +260,7 @@ define void @AtomicStoreUnordered(i32* %p, i32 %x) { ; COMM: atomic store unordered: bumped up to store release - ; CHECK-LABEL: @"dfs$AtomicStoreUnordered" + ; CHECK-LABEL: @AtomicStoreUnordered.dfsan ; CHECK-NOT: @__dfsan_arg_origin_tls ; CHECK-NOT: @__dfsan_arg_tls ; CHECK_ORIGIN-NOT: 35184372088832 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/basic.ll b/llvm/test/Instrumentation/DataFlowSanitizer/basic.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/basic.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/basic.ll @@ -14,7 +14,7 @@ ; CHECK: @__dfsan_shadow_ptr_mask = external global i64 define i8 @load(i8* %p) { - ; CHECK-LABEL: define i8 @"dfs$load" + ; CHECK-LABEL: define i8 @load.dfsan ; CHECK: and i64 {{.*}}, [[SHADOW_MASK]] ; CHECK: ret i8 %a %a = load i8, i8* %p @@ -22,7 +22,7 @@ } define void @store(i8* %p) { - ; CHECK-LABEL: define void @"dfs$store" + ; CHECK-LABEL: define void @store.dfsan ; CHECK: and i64 {{.*}}, [[SHADOW_MASK]] ; CHECK: ret void store i8 0, i8* %p diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/call.ll b/llvm/test/Instrumentation/DataFlowSanitizer/call.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/call.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/call.ll @@ -12,10 +12,10 @@ declare i32 @f(i32) declare float @llvm.sqrt.f32(float) -; CHECK-LABEL: @"dfs$call" +; CHECK-LABEL: @call.dfsan define i32 @call() { ; CHECK: store{{.*}}__dfsan_arg_tls - ; CHECK: call{{.*}}@"dfs$f" + ; CHECK: call{{.*}}@f.dfsan ; CHECK: load{{.*}}__dfsan_retval_tls %r = call i32 @f(i32 0) @@ -35,11 +35,11 @@ declare void @g(...) -; CHECK-LABEL: @"dfs$h" -; CHECK: personality {{.*}} @"dfs$__gxx_personality_v0" {{.*}} { +; CHECK-LABEL: @h.dfsan +; CHECK: personality {{.*}} @__gxx_personality_v0.dfsan {{.*}} { define i32 @h() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) { entry: -; CHECK: invoke void (...) @"dfs$g"(i32 42) +; CHECK: invoke void (...) @g.dfsan(i32 42) invoke void (...) @g(i32 42) to label %try.cont unwind label %lpad @@ -48,12 +48,12 @@ catch i8* null %1 = extractvalue { i8*, i32 } %0, 0 - ; CHECK: store i8 0,{{.*}} @__dfsan_arg_tls - ; CHECK: call {{.*}} @"dfs$__cxa_begin_catch" + ; CHECK: store {{.*}} @__dfsan_arg_tls + ; CHECK: call {{.*}} @__cxa_begin_catch.dfsan ; CHECK: load {{.*}} @__dfsan_retval_tls %2 = tail call i8* @__cxa_begin_catch(i8* %1) - ; CHECK: call {{.*}} @"dfs$__cxa_end_catch" + ; CHECK: call {{.*}} @__cxa_end_catch.dfsan tail call void @__cxa_end_catch() br label %try.cont diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_callback_attributes.ll b/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_callback_attributes.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_callback_attributes.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_callback_attributes.ll @@ -13,7 +13,7 @@ declare i8 @a_callback_fun(i32, double) -; CHECK-LABEL: @"dfs$call_custom_funs_with_callbacks" +; CHECK-LABEL: @call_custom_funs_with_callbacks.dfsan define void @call_custom_funs_with_callbacks(i8 (i32, double)* %callback_arg) { ;; The callback should have attribute 'nonnull': ; CHECK: call signext i32 @__dfsw_custom_fun_one_callback( diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_varargs_attributes.ll b/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_varargs_attributes.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_varargs_attributes.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/custom_fun_varargs_attributes.ll @@ -8,7 +8,7 @@ ; Declare a custom varargs function. declare i16 @custom_varargs(i64, ...) -; CHECK-LABEL: @"dfs$call_custom_varargs" +; CHECK-LABEL: @call_custom_varargs.dfsan define void @call_custom_varargs(i8* %buf) { ;; All arguments have an annotation. Check that the transformed function ;; preserves each annotation. diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll b/llvm/test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/debug-nonzero-labels.ll @@ -7,7 +7,7 @@ declare i32 @g() -; CHECK: define { i32, i[[#SBITS]] } @"dfs$f"(i32 %0, i32 %1, i[[#SBITS]] %2, i[[#SBITS]] %3) +; CHECK: define { i32, i[[#SBITS]] } @f.dfsan(i32 %0, i32 %1, i[[#SBITS]] %2, i[[#SBITS]] %3) define i32 @f(i32, i32) { ; CHECK: [[LOCALLABELALLOCA:%.*]] = alloca i[[#SBITS]] %i = alloca i32 @@ -17,7 +17,7 @@ ; CHECK: br i1 [[ARGCMP2]] %x = add i32 %0, %1 store i32 %x, i32* %i - ; CHECK: [[CALL:%.*]] = call { i32, i[[#SBITS]] } @"dfs$g"() + ; CHECK: [[CALL:%.*]] = call { i32, i[[#SBITS]] } @g.dfsan() ; CHECK: [[CALLLABEL:%.*]] = extractvalue { i32, i[[#SBITS]] } [[CALL]], 1 ; CHECK: [[CALLCMP:%.*]] = icmp ne i[[#SBITS]] [[CALLLABEL]], 0 ; CHECK: br i1 [[CALLCMP]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll b/llvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/dont_combine_offset_labels_on_gep.ll @@ -8,7 +8,7 @@ ; CHECK: @__dfsan_shadow_width_bits = weak_odr constant i32 [[#SBITS:]] define i32* @gepop([10 x [20 x i32]]* %p, i32 %a, i32 %b, i32 %c) { - ; CHECK: @"dfs$gepop" + ; CHECK: @gepop.dfsan ; CHECK_ORIGIN: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align [[ALIGN_O:4]] ; CHECK: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN_S:2]] ; CHECK: %e = getelementptr [10 x [20 x i32]], [10 x [20 x i32]]* %p, i32 %a, i32 %b, i32 %c diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll b/llvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/external_mask.ll @@ -3,7 +3,7 @@ target triple = "aarch64-unknown-linux-gnu" define i32 @test(i32 %a, i32* nocapture readonly %b) #0 { - ; CHECK: @"dfs$test" + ; CHECK: @test.dfsan ; CHECK: %[[RV:.*]] load{{.*}}__dfsan_shadow_ptr_mask ; CHECK: ptrtoint i32* {{.*}} to i64 ; CHECK: and {{.*}}%[[RV:.*]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/load.ll b/llvm/test/Instrumentation/DataFlowSanitizer/load.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/load.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/load.ll @@ -10,7 +10,7 @@ define {} @load0({}* %p) { - ; CHECK-LABEL: @"dfs$load0" + ; CHECK-LABEL: @load0.dfsan ; CHECK-NEXT: %a = load {}, {}* %p, align 1 ; CHECK-NEXT: store {} zeroinitializer, {}* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to {}*), align [[ALIGN:2]] ; CHECK-NEXT: ret {} %a @@ -20,7 +20,7 @@ } define i8 @load8(i8* %p) { - ; CHECK-LABEL: @"dfs$load8" + ; CHECK-LABEL: @load8.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i8* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#%.10d,MASK:]] @@ -36,7 +36,7 @@ } define i16 @load16(i16* %p) { - ; CHECK-LABEL: @"dfs$load16" + ; CHECK-LABEL: @load16.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i16* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#MASK]] @@ -56,7 +56,7 @@ } define i32 @load32(i32* %p) { - ; CHECK-LABEL: @"dfs$load32" + ; CHECK-LABEL: @load32.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i32* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#MASK]] @@ -78,7 +78,7 @@ } define i64 @load64(i64* %p) { - ; CHECK-LABEL: @"dfs$load64" + ; CHECK-LABEL: @load64.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i64* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#MASK]] @@ -102,7 +102,7 @@ } define i128 @load128(i128* %p) { - ; CHECK-LABEL: @"dfs$load128" + ; CHECK-LABEL: @load128.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i128* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#MASK]] @@ -130,7 +130,7 @@ define i17 @load17(i17* %p) { - ; CHECK-LABEL: @"dfs$load17" + ; CHECK-LABEL: @load17.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: %[[#INTP:]] = ptrtoint i17* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#MASK]] @@ -147,7 +147,7 @@ @X = constant i1 1 define i1 @load_global() { - ; CHECK-LABEL: @"dfs$load_global" + ; CHECK-LABEL: @load_global.dfsan ; CHECK-NEXT: %a = load i1, i1* @X ; CHECK-NEXT: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: ret i1 %a diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/memset.ll b/llvm/test/Instrumentation/DataFlowSanitizer/memset.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/memset.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/memset.ll @@ -8,7 +8,7 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) define void @ms(i8* %p, i8 %v) { - ; CHECK-LABEL: @"dfs$ms" + ; CHECK-LABEL: @ms.dfsan ; CHECK-SAME: (i8* %0, i8 %1, i[[#SBITS]] %2, i[[#SBITS]] %3) ; CHECK: call void @__dfsan_set_label(i[[#SBITS]] %3, i32 0, i8* %0, i64 1) call void @llvm.memset.p0i8.i64(i8* %p, i8 %v, i64 1, i1 1) diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/musttailcall.ll b/llvm/test/Instrumentation/DataFlowSanitizer/musttailcall.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/musttailcall.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/musttailcall.ll @@ -5,7 +5,7 @@ declare i32 @f(i32) -; CHECK-LABEL: @"dfs$inner_callee" +; CHECK-LABEL: @inner_callee.dfsan define i32 @inner_callee(i32) { %r = call i32 @f(i32 %0) @@ -16,10 +16,10 @@ ret i32 %r } -; CHECK-LABEL: @"dfs$musttail_call" +; CHECK-LABEL: @musttail_call.dfsan define i32 @musttail_call(i32) { ; CHECK: store{{.*}}__dfsan_arg_tls - ; CHECK-NEXT: musttail call i32 @"dfs$inner_callee" + ; CHECK-NEXT: musttail call i32 @inner_callee.dfsan %r = musttail call i32 @inner_callee(i32 %0) ; For "musttail" calls we can not insert any shadow manipulating code between @@ -32,9 +32,9 @@ ret i32 %r } -; CHECK-LABEL: @"dfs$outer_caller" +; CHECK-LABEL: @outer_caller.dfsan define i32 @outer_caller() { - ; CHECK: call{{.*}}@"dfs$musttail_call" + ; CHECK: call{{.*}}@musttail_call.dfsan ; CHECK-NEXT: load{{.*}}__dfsan_retval_tls ; CHECK_ORIGIN-NEXT: load{{.*}}__dfsan_retval_origin_tls %r = call i32 @musttail_call(i32 0) @@ -47,10 +47,10 @@ declare i32* @mismatching_callee(i32) -; CHECK-LABEL: define i8* @"dfs$mismatching_musttail_call" +; CHECK-LABEL: define i8* @mismatching_musttail_call.dfsan define i8* @mismatching_musttail_call(i32) { %r = musttail call i32* @mismatching_callee(i32 %0) - ; CHECK: musttail call i32* @"dfs$mismatching_callee" + ; CHECK: musttail call i32* @mismatching_callee.dfsan ; COMM: No instrumentation between call and ret. ; CHECK-NEXT: bitcast i32* {{.*}} to i8* %c = bitcast i32* %r to i8* diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_abilist.ll @@ -11,7 +11,7 @@ } define i32 @call_discard(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_discard" + ; CHECK: @call_discard.dfsan ; CHECK: %r = call i32 @discard(i32 %a, i32 %b) ; CHECK: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 ; CHECK: ret i32 %r @@ -27,7 +27,7 @@ } define i32 @call_functional(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_functional" + ; CHECK: @call_functional.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[RO:%.*]] = select i1 {{.*}}, i32 [[BO]], i32 [[AO]] @@ -43,7 +43,7 @@ } define i32 @call_uninstrumented(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_uninstrumented" + ; CHECK: @call_uninstrumented.dfsan ; CHECK: %r = call i32 @uninstrumented(i32 %a, i32 %b) ; CHECK: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 ; CHECK: ret i32 %r @@ -60,7 +60,7 @@ @discardg = alias i32 (i32, i32), i32 (i32, i32)* @g define i32 @call_discardg(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_discardg" + ; CHECK: @call_discardg.dfsan ; CHECK: %r = call i32 @discardg(i32 %a, i32 %b) ; CHECK: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 ; CHECK: ret i32 %r @@ -107,14 +107,14 @@ } define i32 (i32, i32)* @ret_custom() { - ; CHECK: @"dfs$ret_custom" + ; CHECK: @ret_custom.dfsan ; CHECK: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 ret i32 (i32, i32)* @custom_with_ret } define void @call_custom_without_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_without_ret" + ; CHECK: @call_custom_without_ret.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 @@ -127,7 +127,7 @@ } define i32 @call_custom_with_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_with_ret" + ; CHECK: @call_custom_with_ret.dfsan ; CHECK: %originreturn = alloca i32, align 4 ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 @@ -145,7 +145,7 @@ } define void @call_custom_varg_without_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_varg_without_ret" + ; CHECK: @call_custom_varg_without_ret.dfsan ; CHECK: %originva = alloca [1 x i32], align 4 ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 @@ -166,7 +166,7 @@ } define i32 @call_custom_varg_with_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_varg_with_ret" + ; CHECK: @call_custom_varg_with_ret.dfsan ; CHECK: %originreturn = alloca i32, align 4 ; CHECK: %originva = alloca [1 x i32], align 4 ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 @@ -192,14 +192,14 @@ } define i32 @call_custom_cb_with_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_cb_with_ret" + ; CHECK: @call_custom_cb_with_ret.dfsan ; CHECK: %originreturn = alloca i32, align 4 ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %labelreturn = alloca i[[#SBITS]], align [[#SBYTES]] ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 ; CHECK: [[AS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 - ; CHECK: {{.*}} = call i32 @__dfso_custom_cb_with_ret(i32 (i32 (i32, i32)*, i32, i32, i[[#SBITS]], i[[#SBITS]], i[[#SBITS]]*, i32, i32, i32*)* @"dfst0$custom_cb_with_ret", i8* bitcast (i32 (i32, i32)* @"dfs$cb_with_ret" to i8*), i32 %a, i32 %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[AS]], i[[#SBITS]] zeroext [[BS]], i[[#SBITS]]* %labelreturn, i32 zeroext 0, i32 zeroext [[AO]], i32 zeroext [[BO]], i32* %originreturn) + ; CHECK: {{.*}} = call i32 @__dfso_custom_cb_with_ret(i32 (i32 (i32, i32)*, i32, i32, i[[#SBITS]], i[[#SBITS]], i[[#SBITS]]*, i32, i32, i32*)* @"dfst0$custom_cb_with_ret", i8* bitcast (i32 (i32, i32)* @cb_with_ret.dfsan to i8*), i32 %a, i32 %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[AS]], i[[#SBITS]] zeroext [[BS]], i[[#SBITS]]* %labelreturn, i32 zeroext 0, i32 zeroext [[AO]], i32 zeroext [[BO]], i32* %originreturn) ; CHECK: [[RS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* %labelreturn, align [[#SBYTES]] ; CHECK: [[RO:%.*]] = load i32, i32* %originreturn, align 4 ; CHECK: store i[[#SBITS]] [[RS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 @@ -210,12 +210,12 @@ } define void @call_custom_cb_without_ret(i32 %a, i32 %b) { - ; CHECK: @"dfs$call_custom_cb_without_ret" + ; CHECK: @call_custom_cb_without_ret.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 ; CHECK: [[AS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 - ; CHECK: call void @__dfso_custom_cb_without_ret(void (void (i32, i32)*, i32, i32, i[[#SBITS]], i[[#SBITS]], i32, i32)* @"dfst0$custom_cb_without_ret", i8* bitcast (void (i32, i32)* @"dfs$cb_without_ret" to i8*), i32 %a, i32 %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[AS]], i[[#SBITS]] zeroext [[BS]], i32 zeroext 0, i32 zeroext [[AO]], i32 zeroext [[BO]]) + ; CHECK: call void @__dfso_custom_cb_without_ret(void (void (i32, i32)*, i32, i32, i[[#SBITS]], i[[#SBITS]], i32, i32)* @"dfst0$custom_cb_without_ret", i8* bitcast (void (i32, i32)* @cb_without_ret.dfsan to i8*), i32 %a, i32 %b, i[[#SBITS]] zeroext 0, i[[#SBITS]] zeroext [[AS]], i[[#SBITS]] zeroext [[BS]], i32 zeroext 0, i32 zeroext [[AO]], i32 zeroext [[BO]]) ; CHECK-NEXT: ret void call void @custom_cb_without_ret(void (i32, i32)* @cb_without_ret, i32 %a, i32 %b) @@ -223,7 +223,7 @@ } ; CHECK: define i32 @discardg(i32 %0, i32 %1) -; CHECK: [[R:%.*]] = call i32 @"dfs$g" +; CHECK: [[R:%.*]] = call i32 @g.dfsan ; CHECK-NEXT: %_dfsret = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 ; CHECK-NEXT: %_dfsret_o = load i32, i32* @__dfsan_retval_origin_tls, align 4 ; CHECK-NEXT: ret i32 [[R]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_cached_shadows.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_cached_shadows.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_cached_shadows.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_cached_shadows.ll @@ -12,7 +12,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define void @cached_shadows(double %0) { - ; CHECK: @"dfs$cached_shadows" + ; CHECK: @cached_shadows.dfsan ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[AS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; CHECK: [[L1:[0-9]+]]: diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_call.ll @@ -29,7 +29,7 @@ i1 %a190, i1 %a191, i1 %a192, i1 %a193, i1 %a194, i1 %a195, i1 %a196, i1 %a197, i1 %a198, i1 %a199, i1 %a200 ) { - ; CHECK: @"dfs$arg_overflow" + ; CHECK: @arg_overflow.dfsan ; CHECK: [[A199:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 199), align 4 ; CHECK: store i32 [[A199]], i32* @__dfsan_retval_origin_tls, align 4 @@ -38,11 +38,11 @@ } define i1 @param_overflow(i1 %a) { - ; CHECK: @"dfs$param_overflow" + ; CHECK: @param_overflow.dfsan ; CHECK: store i32 %1, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 199), align 4 ; CHECK-NEXT: store i[[#SBITS]] %2, i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 398) to i[[#SBITS]]*), align 2 ; CHECK-NEXT: store i[[#SBITS]] %2, i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 400) to i[[#SBITS]]*), align 2 - ; CHECK-NEXT: %r = call i1 @"dfs$arg_overflow" + ; CHECK-NEXT: %r = call i1 @arg_overflow.dfsan ; CHECK: %_dfsret_o = load i32, i32* @__dfsan_retval_origin_tls, align 4 ; CHECK: store i32 %_dfsret_o, i32* @__dfsan_retval_origin_tls, align 4 @@ -75,9 +75,9 @@ declare void @foo(i1 %a) define void @param_with_zero_shadow() { - ; CHECK: @"dfs$param_with_zero_shadow" + ; CHECK: @param_with_zero_shadow.dfsan ; CHECK-NEXT: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 - ; CHECK-NEXT: call void @"dfs$foo"(i1 true) + ; CHECK-NEXT: call void @foo.dfsan(i1 true) call void @foo(i1 1) ret void diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_load.ll @@ -7,7 +7,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define {} @load0({}* %p) { - ; CHECK-LABEL: @"dfs$load0" + ; CHECK-LABEL: @load0.dfsan ; CHECK-NEXT: %a = load {}, {}* %p, align 1 ; CHECK-NEXT: store {} zeroinitializer, {}* bitcast ([100 x i64]* @__dfsan_retval_tls to {}*), align [[ALIGN:2]] ; CHECK-NEXT: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 @@ -18,7 +18,7 @@ } define i16 @load_non_escaped_alloca() { - ; CHECK-LABEL: @"dfs$load_non_escaped_alloca" + ; CHECK-LABEL: @load_non_escaped_alloca.dfsan ; CHECK-NEXT: %[[#S_ALLOCA:]] = alloca i[[#SBITS]], align [[#SBYTES]] ; CHECK-NEXT: %_dfsa = alloca i32, align 4 ; CHECK: %[[#SHADOW:]] = load i[[#SBITS]], i[[#SBITS]]* %[[#S_ALLOCA]], align [[#SBYTES]] @@ -33,7 +33,7 @@ } define i16* @load_escaped_alloca() { - ; CHECK-LABEL: @"dfs$load_escaped_alloca" + ; CHECK-LABEL: @load_escaped_alloca.dfsan ; CHECK: %[[#INTP:]] = ptrtoint i16* %p to i64 ; CHECK-NEXT: %[[#SHADOW_ADDR:]] = and i64 %[[#INTP]], [[#%.10d,MASK:]] ; CHECK-NEXT: %[[#SHADOW_PTR0:]] = inttoptr i64 %[[#SHADOW_ADDR]] to i[[#SBITS]]* @@ -56,7 +56,7 @@ @X = constant i1 1 define i1 @load_global() { - ; CHECK-LABEL: @"dfs$load_global" + ; CHECK-LABEL: @load_global.dfsan ; CHECK: %a = load i1, i1* @X, align 1 ; CHECK-NEXT: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK-NEXT: store i32 0, i32* @__dfsan_retval_origin_tls, align 4 @@ -66,7 +66,7 @@ } define i1 @load1(i1* %p) { - ; CHECK-LABEL: @"dfs$load1" + ; CHECK-LABEL: @load1.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -93,7 +93,7 @@ } define i16 @load16(i1 %i, i16* %p) { - ; CHECK-LABEL: @"dfs$load16" + ; CHECK-LABEL: @load16.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] @@ -123,7 +123,7 @@ } define i32 @load32(i32* %p) { - ; CHECK-LABEL: @"dfs$load32" + ; CHECK-LABEL: @load32.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -155,7 +155,7 @@ } define i64 @load64(i64* %p) { - ; CHECK-LABEL: @"dfs$load64" + ; CHECK-LABEL: @load64.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -196,7 +196,7 @@ } define i64 @load64_align2(i64* %p) { - ; CHECK-LABEL: @"dfs$load64_align2" + ; CHECK-LABEL: @load64_align2.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -220,7 +220,7 @@ } define i128 @load128(i128* %p) { - ; CHECK-LABEL: @"dfs$load128" + ; CHECK-LABEL: @load128.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -271,7 +271,7 @@ } define i17 @load17(i17* %p) { - ; CHECK-LABEL: @"dfs$load17" + ; CHECK-LABEL: @load17.dfsan ; COMBINE_LOAD_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_LOAD_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_mem_intrinsic.ll @@ -10,7 +10,7 @@ declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i1) define void @memcpy(i8* %d, i8* %s, i32 %l) { - ; CHECK: @"dfs$memcpy" + ; CHECK: @memcpy.dfsan ; CHECK: [[L64:%.*]] = zext i32 %l to i64 ; CHECK: call void @__dfsan_mem_origin_transfer(i8* %d, i8* %s, i64 [[L64]]) ; CHECK: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align [[#SBYTES]] {{.*}}, i8* align [[#SBYTES]] {{.*}}, i32 {{.*}}, i1 false) @@ -21,7 +21,7 @@ } define void @memmove(i8* %d, i8* %s, i32 %l) { - ; CHECK: @"dfs$memmove" + ; CHECK: @memmove.dfsan ; CHECK: [[L64:%.*]] = zext i32 %l to i64 ; CHECK: call void @__dfsan_mem_origin_transfer(i8* %d, i8* %s, i64 [[L64]]) ; CHECK: call void @llvm.memmove.p0i8.p0i8.i32(i8* align [[#SBYTES]] {{.*}}, i8* align [[#SBYTES]] {{.*}}, i32 {{.*}}, i1 false) @@ -32,10 +32,10 @@ } define void @memset(i8* %p, i8 %v) { - ; CHECK: @"dfs$memset" + ; CHECK: @memset.dfsan ; CHECK: [[O:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[S:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN:2]] ; CHECK: call void @__dfsan_set_label(i[[#SBITS]] [[S]], i32 [[O]], i8* %p, i64 1) call void @llvm.memset.p0i8.i64(i8* %p, i8 %v, i64 1, i1 1) ret void } \ No newline at end of file diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_other_ops.ll @@ -8,7 +8,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define float @unop(float %f) { - ; CHECK: @"dfs$unop" + ; CHECK: @unop.dfsan ; CHECK: [[FO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: store i32 [[FO]], i32* @__dfsan_retval_origin_tls, align 4 @@ -17,7 +17,7 @@ } define i1 @binop(i1 %a, i1 %b) { - ; CHECK: @"dfs$binop" + ; CHECK: @binop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 @@ -30,7 +30,7 @@ } define i8 @castop(i32* %p) { - ; CHECK: @"dfs$castop" + ; CHECK: @castop.dfsan ; CHECK: [[PO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: store i32 [[PO]], i32* @__dfsan_retval_origin_tls, align 4 @@ -39,7 +39,7 @@ } define i1 @cmpop(i1 %a, i1 %b) { - ; CHECK: @"dfs$cmpop" + ; CHECK: @cmpop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 @@ -52,7 +52,7 @@ } define i32* @gepop([10 x [20 x i32]]* %p, i32 %a, i32 %b, i32 %c) { - ; CHECK: @"dfs$gepop" + ; CHECK: @gepop.dfsan ; CHECK: [[CO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 3), align 4 ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 @@ -73,7 +73,7 @@ } define i32 @eeop(<4 x i32> %a, i32 %b) { - ; CHECK: @"dfs$eeop" + ; CHECK: @eeop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 @@ -86,7 +86,7 @@ } define <4 x i32> @ieop(<4 x i32> %p, i32 %a, i32 %b) { - ; CHECK: @"dfs$ieop" + ; CHECK: @ieop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[PO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 @@ -103,7 +103,7 @@ } define <4 x i32> @svop(<4 x i32> %a, <4 x i32> %b) { - ; CHECK: @"dfs$svop" + ; CHECK: @svop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: [[BS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align 2 @@ -116,7 +116,7 @@ } define i32 @evop({i32, float} %a) { - ; CHECK: @"dfs$evop" + ; CHECK: @evop.dfsan ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: store i32 [[AO]], i32* @__dfsan_retval_origin_tls, align 4 @@ -125,7 +125,7 @@ } define {i32, {float, float}} @ivop({i32, {float, float}} %a, {float, float} %b) { - ; CHECK: @"dfs$ivop" + ; CHECK: @ivop.dfsan ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMM: TODO simplify the expression [[#mul(2,SBYTES) + max(SBYTES,2)]] to diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_phi.ll @@ -7,7 +7,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i32 @phiop(i32 %a, i32 %b, i1 %c) { - ; CHECK: @"dfs$phiop" + ; CHECK: @phiop.dfsan ; CHECK: entry: ; CHECK: [[BO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_select.ll @@ -9,7 +9,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i8 @select8(i1 %c, i8 %t, i8 %f) { - ; TRACK_CONTROL_FLOW: @"dfs$select8" + ; TRACK_CONTROL_FLOW: @select8.dfsan ; TRACK_CONTROL_FLOW: [[CO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; TRACK_CONTROL_FLOW: [[FO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; TRACK_CONTROL_FLOW: [[TO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 @@ -19,7 +19,7 @@ ; TRACK_CONTROL_FLOW: [[CTFO:%.*]] = select i1 [[CS_NE]], i32 [[CO]], i32 [[TFO]] ; TRACK_CONTROL_FLOW: store i32 [[CTFO]], i32* @__dfsan_retval_origin_tls, align 4 - ; NO_TRACK_CONTROL_FLOW: @"dfs$select8" + ; NO_TRACK_CONTROL_FLOW: @select8.dfsan ; NO_TRACK_CONTROL_FLOW: [[FO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; NO_TRACK_CONTROL_FLOW: [[TO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; NO_TRACK_CONTROL_FLOW: [[TFO:%.*]] = select i1 %c, i32 [[TO]], i32 [[FO]] @@ -30,7 +30,7 @@ } define i8 @select8e(i1 %c, i8 %tf) { - ; TRACK_CONTROL_FLOW: @"dfs$select8e" + ; TRACK_CONTROL_FLOW: @select8e.dfsan ; TRACK_CONTROL_FLOW: [[CO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; TRACK_CONTROL_FLOW: [[TFO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; TRACK_CONTROL_FLOW: [[CS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 @@ -38,7 +38,7 @@ ; TRACK_CONTROL_FLOW: [[CTFO:%.*]] = select i1 [[CS_NE]], i32 [[CO]], i32 [[TFO]] ; TRACK_CONTROL_FLOW: store i32 [[CTFO]], i32* @__dfsan_retval_origin_tls, align 4 - ; NO_TRACK_CONTROL_FLOW: @"dfs$select8e" + ; NO_TRACK_CONTROL_FLOW: @select8e.dfsan ; NO_TRACK_CONTROL_FLOW: [[TFO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; NO_TRACK_CONTROL_FLOW: store i32 [[TFO]], i32* @__dfsan_retval_origin_tls, align 4 @@ -47,7 +47,7 @@ } define <4 x i8> @select8v(<4 x i1> %c, <4 x i8> %t, <4 x i8> %f) { - ; TRACK_CONTROL_FLOW: @"dfs$select8v" + ; TRACK_CONTROL_FLOW: @select8v.dfsan ; TRACK_CONTROL_FLOW: [[CO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; TRACK_CONTROL_FLOW: [[FO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; TRACK_CONTROL_FLOW: [[TO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 @@ -59,7 +59,7 @@ ; TRACK_CONTROL_FLOW: [[CFTO:%.*]] = select i1 [[CS_NE]], i32 [[CO]], i32 [[FTO]] ; TRACK_CONTROL_FLOW: store i32 [[CFTO]], i32* @__dfsan_retval_origin_tls, align 4 - ; NO_TRACK_CONTROL_FLOW: @"dfs$select8v" + ; NO_TRACK_CONTROL_FLOW: @select8v.dfsan ; NO_TRACK_CONTROL_FLOW: [[FO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 2), align 4 ; NO_TRACK_CONTROL_FLOW: [[TO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; NO_TRACK_CONTROL_FLOW: [[FS:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 4) to i[[#SBITS]]*), align 2 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_store.ll @@ -7,7 +7,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define void @store_zero_to_non_escaped_alloca() { - ; CHECK-LABEL: @"dfs$store_zero_to_non_escaped_alloca" + ; CHECK-LABEL: @store_zero_to_non_escaped_alloca.dfsan ; CHECK-NEXT: [[A:%.*]] = alloca i[[#SBITS]], align [[#SBYTES]] ; CHECK-NEXT: %_dfsa = alloca i32, align 4 ; CHECK-NEXT: %p = alloca i16, align 2 @@ -21,7 +21,7 @@ } define void @store_nonzero_to_non_escaped_alloca(i16 %a) { - ; CHECK-LABEL: @"dfs$store_nonzero_to_non_escaped_alloca" + ; CHECK-LABEL: @store_nonzero_to_non_escaped_alloca.dfsan ; CHECK: %[[#AO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK: %_dfsa = alloca i32, align 4 ; CHECK: store i32 %[[#AO]], i32* %_dfsa, align 4 @@ -34,12 +34,12 @@ declare void @foo(i16* %p) define void @store_zero_to_escaped_alloca() { - ; CHECK-LABEL: @"dfs$store_zero_to_escaped_alloca" + ; CHECK-LABEL: @store_zero_to_escaped_alloca.dfsan ; CHECK: %[[#SA:]] = bitcast i[[#SBITS]]* {{.*}} to i[[#NUM_BITS:mul(SBITS,2)]]* ; CHECK-NEXT: store i[[#NUM_BITS]] 0, i[[#NUM_BITS]]* %[[#SA]], align [[#SBYTES]] ; CHECK-NEXT: store i16 1, i16* %p, align 2 ; CHECK-NEXT: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] - ; CHECK-NEXT: call void @"dfs$foo"(i16* %p) + ; CHECK-NEXT: call void @foo.dfsan(i16* %p) %p = alloca i16 store i16 1, i16* %p @@ -48,7 +48,7 @@ } define void @store_nonzero_to_escaped_alloca(i16 %a) { - ; CHECK-LABEL: @"dfs$store_nonzero_to_escaped_alloca" + ; CHECK-LABEL: @store_nonzero_to_escaped_alloca.dfsan ; CHECK-NEXT: %[[#AO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK-NEXT: %[[#AS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; CHECK: %[[#INTP:]] = ptrtoint i16* %p to i64 @@ -73,7 +73,7 @@ } define void @store64_align8(i64* %p, i64 %a) { - ; CHECK-LABEL: @"dfs$store64_align8" + ; CHECK-LABEL: @store64_align8.dfsan ; COMBINE_STORE_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_STORE_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -103,7 +103,7 @@ } define void @store64_align2(i64* %p, i64 %a) { - ; CHECK-LABEL: @"dfs$store64_align2" + ; CHECK-LABEL: @store64_align2.dfsan ; COMBINE_STORE_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_STORE_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -130,7 +130,7 @@ } define void @store96_align8(i96* %p, i96 %a) { - ; CHECK-LABEL: @"dfs$store96_align8" + ; CHECK-LABEL: @store96_align8.dfsan ; COMBINE_STORE_PTR-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; COMBINE_STORE_PTR-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_store_threshold.ll @@ -6,7 +6,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define void @store_threshold([2 x i64]* %p, [2 x i64] %a) { - ; CHECK: @"dfs$store_threshold" + ; CHECK: @store_threshold.dfsan ; CHECK: [[AO:%.*]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 1), align 4 ; CHECK: [[AS:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to [2 x i[[#SBITS]]]*), align 2 ; CHECK: [[AS0:%.*]] = extractvalue [2 x i[[#SBITS]]] [[AS]], 0 diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/origin_track_load.ll b/llvm/test/Instrumentation/DataFlowSanitizer/origin_track_load.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/origin_track_load.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/origin_track_load.ll @@ -6,7 +6,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i64 @load64(i64* %p) { - ; CHECK-LABEL: @"dfs$load64" + ; CHECK-LABEL: @load64.dfsan ; CHECK-NEXT: %[[#PO:]] = load i32, i32* getelementptr inbounds ([200 x i32], [200 x i32]* @__dfsan_arg_origin_tls, i64 0, i64 0), align 4 ; CHECK-NEXT: %[[#PS:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/prefix-rename.ll b/llvm/test/Instrumentation/DataFlowSanitizer/prefix-rename.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/prefix-rename.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/prefix-rename.ll @@ -3,21 +3,21 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" -; CHECK: module asm ".symver dfs$f1,dfs$f@@version1" +; CHECK: module asm ".symver f1.dfsan,f.dfsan@@version1" module asm ".symver f1,f@@version1" -; CHECK: @"dfs$f2" = alias {{.*}} @"dfs$f1" +; CHECK: @f2.dfsan = alias {{.*}} @f1.dfsan @f2 = alias void (), void ()* @f1 -; CHECK: @"dfs$g2" = alias {{.*}} @"dfs$g1" +; CHECK: @g2.dfsan = alias {{.*}} @g1.dfsan @g2 = alias void (i16*), bitcast (void (i8*)* @g1 to void (i16*)*) -; CHECK: define void @"dfs$f1" +; CHECK: define void @f1.dfsan define void @f1() { ret void } -; CHECK: define void @"dfs$g1" +; CHECK: define void @g1.dfsan define void @g1(i8*) { ret void } diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/select.ll b/llvm/test/Instrumentation/DataFlowSanitizer/select.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/select.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/select.ll @@ -9,7 +9,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i8 @select8(i1 %c, i8 %t, i8 %f) { - ; TRACK_CF: @"dfs$select8" + ; TRACK_CF: @select8.dfsan ; TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 4) to i[[#SBITS]]*), align [[ALIGN:2]] ; TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: %[[#R+2]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -19,7 +19,7 @@ ; TRACK_CF: store i[[#SBITS]] %[[#RO]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: ret i8 %a - ; NO_TRACK_CF: @"dfs$select8" + ; NO_TRACK_CF: @select8.dfsan ; NO_TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 4) to i[[#SBITS]]*), align [[ALIGN:2]] ; NO_TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; NO_TRACK_CF: %[[#R+2]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -33,7 +33,7 @@ } define i8 @select8e(i1 %c, i8 %tf) { - ; TRACK_CF: @"dfs$select8e" + ; TRACK_CF: @select8e.dfsan ; TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: %[[#RO:]] = or i[[#SBITS]] %[[#R+1]], %[[#R]] @@ -41,7 +41,7 @@ ; TRACK_CF: store i[[#SBITS]] %[[#RO]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: ret i8 %a - ; NO_TRACK_CF: @"dfs$select8e" + ; NO_TRACK_CF: @select8e.dfsan ; NO_TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; NO_TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; NO_TRACK_CF: %a = select i1 %c, i8 %tf, i8 %tf @@ -53,7 +53,7 @@ } define <4 x i8> @select8v(<4 x i1> %c, <4 x i8> %t, <4 x i8> %f) { - ; TRACK_CF: @"dfs$select8v" + ; TRACK_CF: @select8v.dfsan ; TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 4) to i[[#SBITS]]*), align [[ALIGN:2]] ; TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: %[[#R+2]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -63,7 +63,7 @@ ; TRACK_CF: store i[[#SBITS]] %[[#RO]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TRACK_CF: ret <4 x i8> %a - ; NO_TRACK_CF: @"dfs$select8v" + ; NO_TRACK_CF: @select8v.dfsan ; NO_TRACK_CF: %[[#R:]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 4) to i[[#SBITS]]*), align [[ALIGN:2]] ; NO_TRACK_CF: %[[#R+1]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN]] ; NO_TRACK_CF: %[[#R+2]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/shadow-args-zext.ll b/llvm/test/Instrumentation/DataFlowSanitizer/shadow-args-zext.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/shadow-args-zext.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/shadow-args-zext.ll @@ -8,7 +8,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define i32 @m() { - ; CHECK-LABEL: @"dfs$m" + ; CHECK-LABEL: @m.dfsan ; CHECK: %{{.*}} = call zeroext i16 @__dfsw_dfsan_get_label(i64 signext 56, i[[#SBITS]] zeroext 0, i[[#SBITS]]* %{{.*}}) entry: @@ -18,7 +18,7 @@ } define i32 @k() { - ; CHECK-LABEL: @"dfs$k" + ; CHECK-LABEL: @k.dfsan ; CHECK: %{{.*}} = call zeroext i16 @__dfsw_k2(i64 signext 56, i64 signext 67, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]]* %{{.*}}) entry: @@ -28,7 +28,7 @@ } define i32 @k3() { - ; CHECK-LABEL: @"dfs$k3" + ; CHECK-LABEL: @k3.dfsan ; CHECK: %{{.*}} = call zeroext i16 @__dfsw_k4(i64 signext 56, i64 signext 67, i64 signext 78, i64 signext 89, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]] zeroext {{.*}}, i[[#SBITS]]* %{{.*}}) entry: diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/store.ll b/llvm/test/Instrumentation/DataFlowSanitizer/store.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/store.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/store.ll @@ -7,7 +7,7 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define void @store0({} %v, {}* %p) { - ; CHECK-LABEL: @"dfs$store0" + ; CHECK-LABEL: @store0.dfsan ; CHECK: store {} %v, {}* %p ; CHECK-NOT: store ; CHECK: ret void @@ -17,7 +17,7 @@ } define void @store8(i8 %v, i8* %p) { - ; CHECK-LABEL: @"dfs$store8" + ; CHECK-LABEL: @store8.dfsan ; CHECK: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: or i[[#SBITS]] @@ -34,7 +34,7 @@ } define void @store16(i16 %v, i16* %p) { - ; CHECK-LABEL: @"dfs$store16" + ; CHECK-LABEL: @store16.dfsan ; CHECK: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: or i[[#SBITS]] @@ -53,7 +53,7 @@ } define void @store32(i32 %v, i32* %p) { - ; CHECK-LABEL: @"dfs$store32" + ; CHECK-LABEL: @store32.dfsan ; CHECK: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: or i[[#SBITS]] @@ -76,7 +76,7 @@ } define void @store64(i64 %v, i64* %p) { - ; CHECK-LABEL: @"dfs$store64" + ; CHECK-LABEL: @store64.dfsan ; CHECK: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: load i[[#SBITS]], i[[#SBITS]]* {{.*}} @__dfsan_arg_tls ; COMBINE_PTR_LABEL: or i[[#SBITS]] @@ -95,7 +95,7 @@ } define void @store_zero(i32* %p) { - ; CHECK-LABEL: @"dfs$store_zero" + ; CHECK-LABEL: @store_zero.dfsan ; NO_COMBINE_PTR_LABEL: bitcast i[[#SBITS]]* {{.*}} to i[[#mul(4, SBITS)]]* ; NO_COMBINE_PTR_LABEL: store i[[#mul(4, SBITS)]] 0, i[[#mul(4, SBITS)]]* {{.*}} store i32 0, i32* %p diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/struct.ll b/llvm/test/Instrumentation/DataFlowSanitizer/struct.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/struct.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/struct.ll @@ -14,15 +14,15 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define {i8*, i32} @pass_struct({i8*, i32} %s) { - ; NO_COMBINE_LOAD_PTR: @"dfs$pass_struct" + ; NO_COMBINE_LOAD_PTR: @pass_struct.dfsan ; NO_COMBINE_LOAD_PTR: [[L:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: store { i[[#SBITS]], i[[#SBITS]] } [[L]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] - ; ARGS_ABI: @"dfs$pass_struct" + ; ARGS_ABI: @pass_struct.dfsan ; ARGS_ABI-SAME: ({ i8*, i32 } {{%.*}}, i[[#SBITS]] {{%.*}}) ; ARGS_ABI: ret { { i8*, i32 }, i[[#SBITS]] } - ; DEBUG_NONZERO_LABELS: @"dfs$pass_struct" + ; DEBUG_NONZERO_LABELS: @pass_struct.dfsan ; DEBUG_NONZERO_LABELS: [[L:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; DEBUG_NONZERO_LABELS: [[L0:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[L]], 0 ; DEBUG_NONZERO_LABELS: [[L1:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[L]], 1 @@ -37,17 +37,17 @@ %StructOfAggr = type {i8*, [4 x i2], <4 x i3>, {i1, i1}} define %StructOfAggr @pass_struct_of_aggregate(%StructOfAggr %s) { - ; NO_COMBINE_LOAD_PTR: @"dfs$pass_struct_of_aggregate" + ; NO_COMBINE_LOAD_PTR: @pass_struct_of_aggregate.dfsan ; NO_COMBINE_LOAD_PTR: %1 = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; NO_COMBINE_LOAD_PTR: store { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } %1, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN]] - ; ARGS_ABI: @"dfs$pass_struct_of_aggregate" + ; ARGS_ABI: @pass_struct_of_aggregate.dfsan ; ARGS_ABI: ret { %StructOfAggr, i[[#SBITS]] } ret %StructOfAggr %s } define {} @load_empty_struct({}* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_empty_struct" + ; NO_COMBINE_LOAD_PTR: @load_empty_struct.dfsan ; NO_COMBINE_LOAD_PTR: store {} zeroinitializer, {}* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to {}*), align 2 %a = load {}, {}* %p @@ -57,7 +57,7 @@ @Y = constant {i1, i32} {i1 1, i32 1} define {i1, i32} @load_global_struct() { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_global_struct" + ; NO_COMBINE_LOAD_PTR: @load_global_struct.dfsan ; NO_COMBINE_LOAD_PTR: store { i[[#SBITS]], i[[#SBITS]] } zeroinitializer, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align 2 %a = load {i1, i32}, {i1, i32}* @Y @@ -65,14 +65,14 @@ } define {i1, i32} @select_struct(i1 %c, {i1, i32} %a, {i1, i32} %b) { - ; NO_SELECT_CONTROL: @"dfs$select_struct" + ; NO_SELECT_CONTROL: @select_struct.dfsan ; NO_SELECT_CONTROL: [[B:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(2, SBYTES) + 2]]) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; NO_SELECT_CONTROL: [[A:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; NO_SELECT_CONTROL: [[C:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; NO_SELECT_CONTROL: [[S:%.*]] = select i1 %c, { i[[#SBITS]], i[[#SBITS]] } [[A]], { i[[#SBITS]], i[[#SBITS]] } [[B]] ; NO_SELECT_CONTROL: store { i[[#SBITS]], i[[#SBITS]] } [[S]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] - ; FAST: @"dfs$select_struct" + ; FAST: @select_struct.dfsan ; FAST: %[[#R:]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(2, SBYTES) + 2]]) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; FAST: %[[#R+1]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; FAST: %[[#R+2]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -90,7 +90,7 @@ } define { i32, i32 } @asm_struct(i32 %0, i32 %1) { - ; FAST: @"dfs$asm_struct" + ; FAST: @asm_struct.dfsan ; FAST: [[E1:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: [[E0:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; FAST: [[E01:%.*]] = or i[[#SBITS]] [[E0]], [[E1]] @@ -104,13 +104,13 @@ } define {i32, i32} @const_struct() { - ; FAST: @"dfs$const_struct" + ; FAST: @const_struct.dfsan ; FAST: store { i[[#SBITS]], i[[#SBITS]] } zeroinitializer, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align 2 ret {i32, i32} { i32 42, i32 11 } } define i1 @extract_struct({i1, i5} %s) { - ; FAST: @"dfs$extract_struct" + ; FAST: @extract_struct.dfsan ; FAST: [[SM:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; FAST: [[EM:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[SM]], 0 ; FAST: store i[[#SBITS]] [[EM]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -120,7 +120,7 @@ } define {i1, i5} @insert_struct({i1, i5} %s, i5 %e1) { - ; FAST: @"dfs$insert_struct" + ; FAST: @insert_struct.dfsan ; FAST: [[EM:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(2, SBYTES)]]) to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: [[SM:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; FAST: [[SM1:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } [[SM]], i[[#SBITS]] [[EM]], 1 @@ -130,13 +130,13 @@ } define {i1, i1} @load_struct({i1, i1}* %p) { - ; NO_COMBINE_LOAD_PTR: @"dfs$load_struct" + ; NO_COMBINE_LOAD_PTR: @load_struct.dfsan ; NO_COMBINE_LOAD_PTR: [[OL:%.*]] = or i[[#SBITS]] ; NO_COMBINE_LOAD_PTR: [[S0:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } undef, i[[#SBITS]] [[OL]], 0 ; NO_COMBINE_LOAD_PTR: [[S1:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } [[S0]], i[[#SBITS]] [[OL]], 1 ; NO_COMBINE_LOAD_PTR: store { i[[#SBITS]], i[[#SBITS]] } [[S1]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align 2 - ; EVENT_CALLBACKS: @"dfs$load_struct" + ; EVENT_CALLBACKS: @load_struct.dfsan ; EVENT_CALLBACKS: [[OL0:%.*]] = or i[[#SBITS]] ; EVENT_CALLBACKS: [[OL1:%.*]] = or i[[#SBITS]] [[OL0]], ; EVENT_CALLBACKS: [[S0:%.*]] = insertvalue { i[[#SBITS]], i[[#SBITS]] } undef, i[[#SBITS]] [[OL1]], 0 @@ -147,7 +147,7 @@ } define void @store_struct({i1, i1}* %p, {i1, i1} %s) { - ; FAST: @"dfs$store_struct" + ; FAST: @store_struct.dfsan ; FAST: [[S:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; FAST: [[E0:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[S]], 0 ; FAST: [[E1:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[S]], 1 @@ -157,11 +157,11 @@ ; FAST: [[P1:%.*]] = getelementptr i[[#SBITS]], i[[#SBITS]]* [[P]], i32 1 ; FAST: store i[[#SBITS]] [[E]], i[[#SBITS]]* [[P1]], align [[#SBYTES]] - ; EVENT_CALLBACKS: @"dfs$store_struct" + ; EVENT_CALLBACKS: @store_struct.dfsan ; EVENT_CALLBACKS: [[OL:%.*]] = or i[[#SBITS]] ; EVENT_CALLBACKS: call void @__dfsan_store_callback(i[[#SBITS]] [[OL]] - ; COMBINE_STORE_PTR: @"dfs$store_struct" + ; COMBINE_STORE_PTR: @store_struct.dfsan ; COMBINE_STORE_PTR: [[PL:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; COMBINE_STORE_PTR: [[SL:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; COMBINE_STORE_PTR: [[SL0:%.*]] = extractvalue { i[[#SBITS]], i[[#SBITS]] } [[SL]], 0 @@ -178,7 +178,7 @@ } define i2 @extract_struct_of_aggregate11(%StructOfAggr %s) { - ; FAST: @"dfs$extract_struct_of_aggregate11" + ; FAST: @extract_struct_of_aggregate11.dfsan ; FAST: [[E:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; FAST: [[E11:%.*]] = extractvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[E]], 1, 1 ; FAST: store i[[#SBITS]] [[E11]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -188,7 +188,7 @@ } define [4 x i2] @extract_struct_of_aggregate1(%StructOfAggr %s) { - ; FAST: @"dfs$extract_struct_of_aggregate1" + ; FAST: @extract_struct_of_aggregate1.dfsan ; FAST: [[E:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; FAST: [[E1:%.*]] = extractvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[E]], 1 ; FAST: store [4 x i[[#SBITS]]] [[E1]], [4 x i[[#SBITS]]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to [4 x i[[#SBITS]]]*), align [[ALIGN]] @@ -197,7 +197,7 @@ } define <4 x i3> @extract_struct_of_aggregate2(%StructOfAggr %s) { - ; FAST: @"dfs$extract_struct_of_aggregate2" + ; FAST: @extract_struct_of_aggregate2.dfsan ; FAST: [[E:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; FAST: [[E2:%.*]] = extractvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[E]], 2 ; FAST: store i[[#SBITS]] [[E2]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -206,7 +206,7 @@ } define { i1, i1 } @extract_struct_of_aggregate3(%StructOfAggr %s) { - ; FAST: @"dfs$extract_struct_of_aggregate3" + ; FAST: @extract_struct_of_aggregate3.dfsan ; FAST: [[E:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; FAST: [[E3:%.*]] = extractvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[E]], 3 ; FAST: store { i[[#SBITS]], i[[#SBITS]] } [[E3]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] @@ -215,7 +215,7 @@ } define i1 @extract_struct_of_aggregate31(%StructOfAggr %s) { - ; FAST: @"dfs$extract_struct_of_aggregate31" + ; FAST: @extract_struct_of_aggregate31.dfsan ; FAST: [[E:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN:2]] ; FAST: [[E31:%.*]] = extractvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[E]], 3, 1 ; FAST: store i[[#SBITS]] [[E31]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] @@ -224,7 +224,7 @@ } define %StructOfAggr @insert_struct_of_aggregate11(%StructOfAggr %s, i2 %e11) { - ; FAST: @"dfs$insert_struct_of_aggregate11" + ; FAST: @insert_struct_of_aggregate11.dfsan ; FAST: [[E11:%.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(8, SBYTES)]]) to i[[#SBITS]]*), align [[ALIGN:2]] ; FAST: [[S:%.*]] = load { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }, { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } }*), align [[ALIGN]] ; FAST: [[S1:%.*]] = insertvalue { i[[#SBITS]], [4 x i[[#SBITS]]], i[[#SBITS]], { i[[#SBITS]], i[[#SBITS]] } } [[S]], i[[#SBITS]] [[E11]], 1, 1 @@ -235,7 +235,7 @@ } define {i8*, i32} @call_struct({i8*, i32} %s) { - ; FAST: @"dfs$call_struct" + ; FAST: @call_struct.dfsan ; FAST: [[S:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; FAST: store { i[[#SBITS]], i[[#SBITS]] } [[S]], { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] ; FAST: %_dfsret = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* bitcast ([[TLS_ARR]]* @__dfsan_retval_tls to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN]] @@ -248,7 +248,7 @@ declare %StructOfAggr @fun_with_many_aggr_args(<2 x i7> %v, [2 x i5] %a, {i3, i3} %s) define %StructOfAggr @call_many_aggr_args(<2 x i7> %v, [2 x i5] %a, {i3, i3} %s) { - ; FAST: @"dfs$call_many_aggr_args" + ; FAST: @call_many_aggr_args.dfsan ; FAST: [[S:%.*]] = load { i[[#SBITS]], i[[#SBITS]] }, { i[[#SBITS]], i[[#SBITS]] }* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 [[#mul(2, SBYTES) + 2]]) to { i[[#SBITS]], i[[#SBITS]] }*), align [[ALIGN:2]] ; FAST: [[A:%.*]] = load [2 x i[[#SBITS]]], [2 x i[[#SBITS]]]* inttoptr (i64 add (i64 ptrtoint ([[TLS_ARR]]* @__dfsan_arg_tls to i64), i64 2) to [2 x i[[#SBITS]]]*), align [[ALIGN]] ; FAST: [[V:%.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([[TLS_ARR]]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/union.ll b/llvm/test/Instrumentation/DataFlowSanitizer/union.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/union.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/union.ll @@ -10,7 +10,7 @@ ; Check that we reuse unions where possible. -; CHECK-LABEL: @"dfs$f" +; CHECK-LABEL: @f.dfsan define void @f(i32 %x, i32 %y) { ; CHECK: or i[[#SBITS]] %xay = add i32 %x, %y @@ -24,7 +24,7 @@ ; In this case, we compute the unions on both sides because neither block ; dominates the other. -; CHECK-LABEL: @"dfs$g" +; CHECK-LABEL: @g.dfsan define void @g(i1 %p, i32 %x, i32 %y) { br i1 %p, label %l1, label %l2 @@ -46,7 +46,7 @@ ; In this case, we know that the label for %xayax subsumes the label for %xay. -; CHECK-LABEL: @"dfs$h" +; CHECK-LABEL: @h.dfsan define i32 @h(i32 %x, i32 %y) { ; CHECK: or i[[#SBITS]] %xay = add i32 %x, %y diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll b/llvm/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/unordered_atomic_mem_intrins.ll @@ -13,7 +13,7 @@ declare void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32) nounwind define void @test_memcpy(i8* nocapture, i8* nocapture) { - ; CHECK-LABEL: dfs$test_memcpy + ; CHECK-LABEL: test_memcpy.dfsan ; CHECK: call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 16, i32 1) ; CHECK: ret void call void @llvm.memcpy.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 16, i32 1) @@ -21,7 +21,7 @@ } define void @test_memmove(i8* nocapture, i8* nocapture) { - ; CHECK-LABEL: dfs$test_memmove + ; CHECK-LABEL: test_memmove.dfsan ; CHECK: call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 16, i32 1) ; CHECK: ret void call void @llvm.memmove.element.unordered.atomic.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 %1, i64 16, i32 1) @@ -29,7 +29,7 @@ } define void @test_memset(i8* nocapture) { - ; CHECK-LABEL: dfs$test_memset + ; CHECK-LABEL: test_memset.dfsan ; CHECK: call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 1 %0, i8 88, i64 16, i32 1) ; CHECK: ret void call void @llvm.memset.element.unordered.atomic.p0i8.i64(i8* align 1 %0, i8 88, i64 16, i32 1) diff --git a/llvm/test/Instrumentation/DataFlowSanitizer/vector.ll b/llvm/test/Instrumentation/DataFlowSanitizer/vector.ll --- a/llvm/test/Instrumentation/DataFlowSanitizer/vector.ll +++ b/llvm/test/Instrumentation/DataFlowSanitizer/vector.ll @@ -7,13 +7,13 @@ ; CHECK: @__dfsan_shadow_width_bytes = weak_odr constant i32 [[#SBYTES:]] define <4 x i4> @pass_vector(<4 x i4> %v) { - ; ARGS_ABI-LABEL: @"dfs$pass_vector" + ; ARGS_ABI-LABEL: @pass_vector.dfsan ; ARGS_ABI-SAME: (<4 x i4> %[[VEC:.*]], i[[#SBITS]] %[[LABEL:.*]]) ; ARGS_ABI-NEXT: %[[#REG:]] = insertvalue { <4 x i4>, i[[#SBITS]] } undef, <4 x i4> %[[VEC]], 0 ; ARGS_ABI-NEXT: %[[#REG+1]] = insertvalue { <4 x i4>, i[[#SBITS]] } %[[#REG]], i[[#SBITS]] %[[LABEL]], 1 ; ARGS_ABI-NEXT: ret { <4 x i4>, i[[#SBITS]] } - ; TLS_ABI-LABEL: @"dfs$pass_vector" + ; TLS_ABI-LABEL: @pass_vector.dfsan ; TLS_ABI-NEXT: %[[#REG:]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; TLS_ABI-NEXT: store i[[#SBITS]] %[[#REG]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TLS_ABI-NEXT: ret <4 x i4> %v @@ -21,7 +21,7 @@ } define void @load_update_store_vector(<4 x i4>* %p) { - ; TLS_ABI-LABEL: @"dfs$load_update_store_vector" + ; TLS_ABI-LABEL: @load_update_store_vector.dfsan ; TLS_ABI: {{.*}} = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align 2 %v = load <4 x i4>, <4 x i4>* %p @@ -32,7 +32,7 @@ } define <4 x i1> @icmp_vector(<4 x i8> %a, <4 x i8> %b) { - ; TLS_ABI-LABEL: @"dfs$icmp_vector" + ; TLS_ABI-LABEL: @icmp_vector.dfsan ; TLS_ABI-NEXT: %[[B:.*]] = load i[[#SBITS]], i[[#SBITS]]* inttoptr (i64 add (i64 ptrtoint ([100 x i64]* @__dfsan_arg_tls to i64), i64 2) to i[[#SBITS]]*), align [[ALIGN:2]] ; TLS_ABI-NEXT: %[[A:.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] ; TLS_ABI: %[[L:.*]] = or i[[#SBITS]] %[[A]], %[[B]] @@ -46,7 +46,7 @@ } define <2 x i32> @const_vector() { - ; TLS_ABI-LABEL: @"dfs$const_vector" + ; TLS_ABI-LABEL: @const_vector.dfsan ; TLS_ABI-NEXT: store i[[#SBITS]] 0, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align 2 ; TLS_ABI-NEXT: ret <2 x i32> @@ -54,10 +54,10 @@ } define <4 x i4> @call_vector(<4 x i4> %v) { - ; TLS_ABI-LABEL: @"dfs$call_vector" + ; TLS_ABI-LABEL: @call_vector.dfsan ; TLS_ABI-NEXT: %[[V:.*]] = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN:2]] ; TLS_ABI-NEXT: store i[[#SBITS]] %[[V]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_arg_tls to i[[#SBITS]]*), align [[ALIGN]] - ; TLS_ABI-NEXT: %r = call <4 x i4> @"dfs$pass_vector"(<4 x i4> %v) + ; TLS_ABI-NEXT: %r = call <4 x i4> @pass_vector.dfsan(<4 x i4> %v) ; TLS_ABI-NEXT: %_dfsret = load i[[#SBITS]], i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TLS_ABI-NEXT: store i[[#SBITS]] %_dfsret, i[[#SBITS]]* bitcast ([100 x i64]* @__dfsan_retval_tls to i[[#SBITS]]*), align [[ALIGN]] ; TLS_ABI-NEXT: ret <4 x i4> %r