diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-20 04:05:33 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-20 04:05:33 +0000 |
commit | 68db4c2699d2eaafa5cd78858af885c455a1b68c (patch) | |
tree | 7e4e234db93cb502a49cafd9d57fca87d17361b5 | |
parent | 91c7bbde4b6d8b916a81c66465951eda3684746c (diff) | |
download | bcm5719-llvm-68db4c2699d2eaafa5cd78858af885c455a1b68c.tar.gz bcm5719-llvm-68db4c2699d2eaafa5cd78858af885c455a1b68c.zip |
A FIXME about block addresses and indirectbr.
llvm-svn: 142569
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index 40ac9a211af..1f332e84e6e 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -135,6 +135,12 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB, // for example) would be referring to the original function, and this indirect // jump would jump from the inlined copy of the function into the original // function which is extremely undefined behavior. + // FIXME: This logic isn't really right; we can safely inline functions + // with indirectbr's as long as no other function or global references the + // blockaddress of a block within the current function. And as a QOI issue, + // if someone is using a blockaddress wihtout an indirectbr, and that + // reference somehow ends up in another function or global, we probably + // don't want to inline this function. if (isa<IndirectBrInst>(BB->getTerminator())) containsIndirectBr = true; |