diff --git a/llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp b/llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp index 228953293a4ed..32bcd95bb27ba 100644 --- a/llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp +++ b/llvm/lib/SYCLLowerIR/CompileTimePropertiesPass.cpp @@ -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(IntrAnnotStringArg)) - if (auto *C = dyn_cast(GEP->getOperand(0))) - AnnotStrArgGV = dyn_cast(C); + if (IntrAnnotStringArg->getType()->isOpaquePointerTy()) + AnnotStrArgGV = dyn_cast(IntrAnnotStringArg); + else if (auto *GEP = dyn_cast(IntrAnnotStringArg)) + AnnotStrArgGV = dyn_cast(GEP->getOperand(0)); if (!AnnotStrArgGV) return; diff --git a/llvm/test/SYCLLowerIR/CompileTimePropertiesPass/sycl-properties-alignment-loadstore.ll b/llvm/test/SYCLLowerIR/CompileTimePropertiesPass/sycl-properties-alignment-loadstore.ll index 03992ba1933f0..11b595b748d3e 100644 --- a/llvm/test/SYCLLowerIR/CompileTimePropertiesPass/sycl-properties-alignment-loadstore.ll +++ b/llvm/test/SYCLLowerIR/CompileTimePropertiesPass/sycl-properties-alignment-loadstore.ll @@ -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 }