File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -354,17 +354,23 @@ bool ProcessFuncAttributes::runOnModule(Module& M)
354
354
for (auto &arg : F->args ())
355
355
{
356
356
// 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))
358
362
{
359
363
keepAlwaysInline = true ;
360
364
break ;
361
365
}
362
366
}
363
367
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 ;
368
374
}
369
375
}
370
376
You can’t perform that action at this time.
0 commit comments