[PATCH] D111660: [FuncSpec] Make sure function is actually the callee before trying to specialize.
duk via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 13 09:02:24 PDT 2021
duck-37 updated this revision to Diff 379428.
duck-37 added a comment.
Make clang-format happy.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111660/new/
https://reviews.llvm.org/D111660
Files:
llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
Index: llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
===================================================================
--- llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
+++ llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
@@ -662,6 +662,12 @@
if (!isa<CallInst>(U) && !isa<InvokeInst>(U))
continue;
auto &CS = *cast<CallBase>(U);
+
+ // This should not happen at the moment; however, it may if we start
+ // specializing functions that have their addresses taken.
+ assert(CS.getCalledFunction() == F &&
+ "Function and callee should be same!");
+
// If the call site has attribute minsize set, that callsite won't be
// specialized.
if (CS.hasFnAttr(Attribute::MinSize)) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111660.379428.patch
Type: text/x-patch
Size: 760 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211013/27c03cd8/attachment.bin>
More information about the llvm-commits
mailing list