Skip to content

Commit 414f931

Browse files
dlei6gsys_zuul
authored andcommitted
Reverts commit 82fab012eaeb37ea80efb0390232c69e5c7f0109.
"Remove alwaysinline attribute for function calls with aggregate and GAS pointer arguments" Change-Id: I4e6e3416d6d8d21a3240122f68d972d443678649
1 parent fc431ef commit 414f931

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

IGC/AdaptorCommon/ProcessFuncAttributes.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,23 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
354354
for (auto &arg : F->args())
355355
{
356356
// If argument contains an opaque type e.g. image, then always inline it.
357-
if (containsOpaque(arg.getType()))
357+
// If argument is a pointer to GAS, always inline it for perf reason.
358+
//
359+
// Note that this workaround should be removed.
360+
if (containsOpaque(arg.getType()) || isSupportedAggregateArgument(&arg) ||
361+
isGASPointer(&arg))
358362
{
359363
keepAlwaysInline = true;
360364
break;
361365
}
362366
}
363367

364-
// always inline spirv builtins
365-
if (F->getName().startswith(spv::kLLVMName::builtinPrefix))
366-
{
367-
keepAlwaysInline = true;
368+
// SPIR-V image functions don't contain opaque types for images,
369+
// they use i64 values instead.
370+
// We need to detect them based on function name.
371+
if (F->getName().startswith(spv::kLLVMName::builtinPrefix) &&
372+
F->getName().contains("Image")) {
373+
keepAlwaysInline = true;
368374
}
369375
}
370376

0 commit comments

Comments
 (0)