Skip to content

Commit 6cdf4a7

Browse files
bokrzesiigcbot
authored andcommitted
Workaround for prefetch_cache_control failing due to unknown type size on opaque pointers
Currently `handleCacheControlINTELForPrefetch` requires type size to perform call conversion correctly, but on opaque pointers such size is not available and we cannot just extract it anyhow. We're waiting for "OpUntypedPrefetch" extension which will support opaque pointers in such cases. Meanwhile as of today I'm adding skip of the whole prefetch conversion when opaque pointer type is involved and we're waiting for update about the status of "OpUntypedPrefetch"
1 parent a22afc6 commit 6cdf4a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

IGC/AdaptorOCL/preprocess_spvir/HandleSPIRVDecorations/HandleSpirvDecorationMetadata.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,14 @@ void HandleSpirvDecorationMetadata::handleCacheControlINTELForPrefetch(llvm::Cal
326326
// explicit element size as arg.
327327
PointerType *PTy = dyn_cast<PointerType>(I.getArgOperand(0)->getType());
328328
IGC_ASSERT(PTy);
329+
330+
// As of today there's no "OpUntypedPrefetch" which as previous comments mentions,
331+
// is needed to implement this prefetch correctly on opaque pointers.
332+
// It will of course result in performance penalty and needs to be changed once
333+
// "OpUntypedPrefetch" is ready.
334+
if (IGCLLVM::isOpaquePointerTy(PTy))
335+
return;
336+
329337
args.push_back(ConstantInt::get(Type::getInt32Ty(I.getContext()),
330338
IGCLLVM::getNonOpaquePtrEltTy(PTy)->getPrimitiveSizeInBits() / 8));
331339

0 commit comments

Comments
 (0)