[clang] [llvm] [SPIR-V] Implement SPV_KHR_untyped_pointers extension (PR #201233)
Marcos Maronas via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 07:18:46 PDT 2026
================
@@ -1033,7 +1033,11 @@ Type *SPIRVEmitIntrinsicsImpl::deduceElementTypeHelper(
Ty = BestTy;
} else if (auto *Ref = dyn_cast<SelectInst>(I)) {
for (Value *Op : {Ref->getTrueValue(), Ref->getFalseValue()}) {
- Ty = deduceElementTypeByUsersDeep(Op, Visited, UnknownElemTypeI8);
+ // A function pointer operand carries its function type directly. Other
+ // operands are deduced from their uses.
+ Ty = isa<Function>(Op)
+ ? deduceElementTypeHelper(Op, Visited, UnknownElemTypeI8)
+ : deduceElementTypeByUsersDeep(Op, Visited, UnknownElemTypeI8);
----------------
maarquitos14 wrote:
Just for my education: this means that up until now we were doing extra work for functions?
https://github.com/llvm/llvm-project/pull/201233
More information about the llvm-commits
mailing list