[llvm] [SPIRV] Fix printf regression after #178980 (PR #182423)
Nick Sarnie via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 20 07:11:06 PST 2026
================
@@ -984,6 +993,31 @@ struct SPIRV final : public VariadicABIInfo {
return {A, false};
}
+ // The SPIR-V backend has special handling for SPIR-V mangled printf
+ // functions.
+ // printf can be mangled in two ways with itanium mangling,
+ // either as a normal printf or with an additional __spirv_ocl_ prefix.
+ // For example:
+ // _Z6printfPU3AS2Kcz
+ // _Z18__spirv_ocl_printfPU3AS2Kcz
+ // Ignore those functions if target is SPIR-V
+ bool ignoreFunction(Function *F) override {
+ Module *M = F->getParent();
+ const Triple &T = M->getTargetTriple();
----------------
sarnex wrote:
We really should avoid this kind of target-specific special handling leaking into other passes. Can you provide more information on specifically what is wrong with the IR after `ExpandVariadics` and why it can't be fixed inside the `SPIR-V` backend?
https://github.com/llvm/llvm-project/pull/182423
More information about the llvm-commits
mailing list