diff options
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
-rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/polly/lib/CodeGen/PPCGCodeGeneration.cpp b/polly/lib/CodeGen/PPCGCodeGeneration.cpp index 41e1c9ecd0f..61c3fd0bc6c 100644 --- a/polly/lib/CodeGen/PPCGCodeGeneration.cpp +++ b/polly/lib/CodeGen/PPCGCodeGeneration.cpp @@ -3338,17 +3338,18 @@ public: for (const Instruction &Inst : *BB) { const CallInst *Call = dyn_cast<CallInst>(&Inst); if (Call && isValidFunctionInKernel(Call->getCalledFunction(), - AllowCUDALibDevice)) { + AllowCUDALibDevice)) continue; - } - for (Value *SrcVal : Inst.operands()) { - PointerType *p = dyn_cast<PointerType>(SrcVal->getType()); - if (!p) - continue; - if (isa<FunctionType>(p->getElementType())) - return true; - } + for (Value *Op : Inst.operands()) + // Look for (<func-type>*) among operands of Inst + if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) { + if (isa<FunctionType>(PtrTy->getElementType())) { + DEBUG(dbgs() << Inst + << " has illegal use of function in kernel.\n"); + return true; + } + } } return false; } |