Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] fix opaque pointer issue in compileTimeProperty alignment #10748

Merged
merged 4 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,10 @@ void CompileTimePropertiesPass::parseAlignmentAndApply(
// Get the global variable with the annotation string.
const GlobalVariable *AnnotStrArgGV = nullptr;
const Value *IntrAnnotStringArg = IntrInst->getArgOperand(1);
if (auto *GEP = dyn_cast<GEPOperator>(IntrAnnotStringArg))
if (auto *C = dyn_cast<Constant>(GEP->getOperand(0)))
AnnotStrArgGV = dyn_cast<GlobalVariable>(C);
if (IntrAnnotStringArg->getType()->isOpaquePointerTy())
AnnotStrArgGV = dyn_cast<GlobalVariable>(IntrAnnotStringArg);
else if (auto *GEP = dyn_cast<GEPOperator>(IntrAnnotStringArg))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The handling for this case (which does not seem to be related to opaque pointers) has changed. What's the rationale for this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the opaque pointer. If the arg on ptr.annotation is an opaque pointer we do things differently

AnnotStrArgGV = dyn_cast<GlobalVariable>(GEP->getOperand(0));
if (!AnnotStrArgGV)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
;
; Tests the translation of "sycl-alignment" to alignment attributes on load/store

; FIXME: Alignment properties not preserved after testcase was opaquified
; REQUIRES: TEMPORARY_DISABLED

target triple = "spir64_fpga-unknown-unknown"

%struct.MyIP = type { %class.ann_ptr }
Expand Down