diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index c12e19c2895d..111edc1b0ed8 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -3443,13 +3443,11 @@ public: continue; for (Value *Op : Inst.operands()) - // Look for (*) among operands of Inst - if (auto PtrTy = dyn_cast(Op->getType())) { - if (isa(PtrTy->getPointerElementType())) { - LLVM_DEBUG(dbgs() - << Inst << " has illegal use of function in kernel.\n"); - return true; - } + // Look for functions among operands of Inst. + if (isa(Op->stripPointerCasts())) { + LLVM_DEBUG(dbgs() + << Inst << " has illegal use of function in kernel.\n"); + return true; } } return false;