Skip to content

Commit 19cd47b

Browse files
authored
[DevASAN] Fix build failure caused by circle dependency (#16130)
1 parent 023cb2b commit 19cd47b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#include "llvm/IR/Use.h"
6565
#include "llvm/IR/Value.h"
6666
#include "llvm/MC/MCSectionMachO.h"
67-
#include "llvm/SYCLLowerIR/DeviceGlobals.h"
6867
#include "llvm/Support/Casting.h"
6968
#include "llvm/Support/CommandLine.h"
7069
#include "llvm/Support/Debug.h"
@@ -1566,7 +1565,11 @@ static bool isUnsupportedDeviceGlobal(GlobalVariable *G) {
15661565
// Non image scope device globals are implemented by device USM, and the
15671566
// out-of-bounds check for them will be done by sanitizer USM part. So we
15681567
// exclude them here.
1569-
return (!isDeviceGlobalVariable(*G) || !hasDeviceImageScopeProperty(*G));
1568+
if (!G->hasAttribute("sycl-device-image-scope"))
1569+
return true;
1570+
1571+
Attribute Attr = G->getAttribute("sycl-device-image-scope");
1572+
return (!Attr.isStringAttribute() || Attr.getValueAsString() == "false");
15701573
}
15711574

15721575
static bool isUnsupportedSPIRAccess(Value *Addr, Instruction *Inst) {

llvm/lib/Transforms/Instrumentation/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ add_llvm_component_library(LLVMInstrumentation
3939
Core
4040
Demangle
4141
MC
42-
SYCLLowerIR
4342
Support
4443
TargetParser
4544
TransformUtils

0 commit comments

Comments
 (0)