summaryrefslogtreecommitdiff
path: root/include/llvm/Analysis/CodeMetrics.h
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2012-12-20 16:04:27 +0000
committerJames Molloy <james.molloy@arm.com>2012-12-20 16:04:27 +0000
commit67ae13575900e8efd056672987249fd0adbf5e73 (patch)
treec297968f698f92b4b2d7b06c6d892a2299061887 /include/llvm/Analysis/CodeMetrics.h
parent6af228a92a7b8414fa3c1b3c37ee659d32e66e1b (diff)
downloadllvm-67ae13575900e8efd056672987249fd0adbf5e73.tar.gz
llvm-67ae13575900e8efd056672987249fd0adbf5e73.tar.bz2
llvm-67ae13575900e8efd056672987249fd0adbf5e73.tar.xz
Add a new attribute, 'noduplicate'. If a function contains a noduplicate call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call.
Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170704 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/CodeMetrics.h')
-rw-r--r--include/llvm/Analysis/CodeMetrics.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Analysis/CodeMetrics.h b/include/llvm/Analysis/CodeMetrics.h
index 4398faa20a..35eabec6ee 100644
--- a/include/llvm/Analysis/CodeMetrics.h
+++ b/include/llvm/Analysis/CodeMetrics.h
@@ -46,8 +46,11 @@ namespace llvm {
/// \brief True if this function calls itself.
bool isRecursive;
- /// \brief True if this function contains one or more indirect branches.
- bool containsIndirectBr;
+ /// \brief True if this function cannot be duplicated.
+ ///
+ /// True if this function contains one or more indirect branches, or it contains
+ /// one or more 'noduplicate' instructions.
+ bool notDuplicatable;
/// \brief True if this function calls alloca (in the C sense).
bool usesDynamicAlloca;
@@ -79,7 +82,7 @@ namespace llvm {
unsigned NumRets;
CodeMetrics() : exposesReturnsTwice(false), isRecursive(false),
- containsIndirectBr(false), usesDynamicAlloca(false),
+ notDuplicatable(false), usesDynamicAlloca(false),
NumInsts(0), NumBlocks(0), NumCalls(0),
NumInlineCandidates(0), NumVectorInsts(0),
NumRets(0) {}