[llvm-commits] [llvm] r142569 - /llvm/trunk/lib/Analysis/InlineCost.cpp
Eli Friedman
eli.friedman at gmail.com
Wed Oct 19 21:05:33 PDT 2011
Author: efriedma
Date: Wed Oct 19 23:05:33 2011
New Revision: 142569
URL: http://llvm.org/viewvc/llvm-project?rev=142569&view=rev
Log:
A FIXME about block addresses and indirectbr.
Modified:
llvm/trunk/lib/Analysis/InlineCost.cpp
Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=142569&r1=142568&r2=142569&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Wed Oct 19 23:05:33 2011
@@ -135,6 +135,12 @@
// 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;
More information about the llvm-commits
mailing list