================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to