Skip to content

Commit e3786df

Browse files
author
Brox Chen
authored
[SYCL] fix opaque pointer issue in compileTimeProperty alignment (#10748)
update compileTimeProperties pass to check opaque pointers
1 parent e600d79 commit e3786df

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,10 @@ void CompileTimePropertiesPass::parseAlignmentAndApply(
525525
// Get the global variable with the annotation string.
526526
const GlobalVariable *AnnotStrArgGV = nullptr;
527527
const Value *IntrAnnotStringArg = IntrInst->getArgOperand(1);
528-
if (auto *GEP = dyn_cast<GEPOperator>(IntrAnnotStringArg))
529-
if (auto *C = dyn_cast<Constant>(GEP->getOperand(0)))
530-
AnnotStrArgGV = dyn_cast<GlobalVariable>(C);
528+
if (IntrAnnotStringArg->getType()->isOpaquePointerTy())
529+
AnnotStrArgGV = dyn_cast<GlobalVariable>(IntrAnnotStringArg);
530+
else if (auto *GEP = dyn_cast<GEPOperator>(IntrAnnotStringArg))
531+
AnnotStrArgGV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
531532
if (!AnnotStrArgGV)
532533
return;
533534

llvm/test/SYCLLowerIR/CompileTimePropertiesPass/sycl-properties-alignment-loadstore.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
;
44
; Tests the translation of "sycl-alignment" to alignment attributes on load/store
55

6-
; FIXME: Alignment properties not preserved after testcase was opaquified
7-
; REQUIRES: TEMPORARY_DISABLED
8-
96
target triple = "spir64_fpga-unknown-unknown"
107

118
%struct.MyIP = type { %class.ann_ptr }

0 commit comments

Comments
 (0)