diff options
| author | Nikita Popov <npopov@redhat.com> | 2022-04-19 17:59:34 +0200 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2022-04-19 17:59:34 +0200 |
| commit | dbe6d85b8b245bd913e6f38425dc5e37cd610bfa (patch) | |
| tree | e60447068f40905af1e2b3970e1c8ccec53c0f8a /polly/lib/CodeGen/PPCGCodeGeneration.cpp | |
| parent | 880014b59343c8e8e5dc55f6324ce08fd37bd43c (diff) | |
[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.
Diffstat (limited to 'polly/lib/CodeGen/PPCGCodeGeneration.cpp')
| -rw-r--r-- | polly/lib/CodeGen/PPCGCodeGeneration.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
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 (<func-type>*) among operands of Inst - if (auto PtrTy = dyn_cast<PointerType>(Op->getType())) { - if (isa<FunctionType>(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<Function>(Op->stripPointerCasts())) { + LLVM_DEBUG(dbgs() + << Inst << " has illegal use of function in kernel.\n"); + return true; } } return false; |
