Skip to content

Commit dbe6d85

Browse files
committed
[PPCGCodeGeneration] Look for function instead of function pointer type
What this code is actually interested in are references to functions. Use of a function pointer type is being used as an imprecise proxy for that.
1 parent 880014b commit dbe6d85

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

polly/lib/CodeGen/PPCGCodeGeneration.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,13 +3443,11 @@ class PPCGCodeGeneration : public ScopPass {
34433443
continue;
34443444

34453445
for (Value *Op : Inst.operands())
3446-
// Look for (<func-type>*) among operands of Inst
3447-
if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) {
3448-
if (isa<FunctionType>(PtrTy->getPointerElementType())) {
3449-
LLVM_DEBUG(dbgs()
3450-
<< Inst << " has illegal use of function in kernel.\n");
3451-
return true;
3452-
}
3446+
// Look for functions among operands of Inst.
3447+
if (isa<Function>(Op->stripPointerCasts())) {
3448+
LLVM_DEBUG(dbgs()
3449+
<< Inst << " has illegal use of function in kernel.\n");
3450+
return true;
34533451
}
34543452
}
34553453
return false;

0 commit comments

Comments
 (0)