Add a new attribute, 'noduplicate'. If a function contains a noduplicate call, the...
authorJames Molloy <james.molloy@arm.com>
Thu, 20 Dec 2012 16:04:27 +0000 (16:04 +0000)
committerJames Molloy <james.molloy@arm.com>
Thu, 20 Dec 2012 16:04:27 +0000 (16:04 +0000)
commit67ae13575900e8efd056672987249fd0adbf5e73
treec297968f698f92b4b2d7b06c6d892a2299061887
parent6af228a92a7b8414fa3c1b3c37ee659d32e66e1b
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
21 files changed:
docs/LangRef.rst
include/llvm/Analysis/CodeMetrics.h
include/llvm/Attributes.h
include/llvm/Function.h
include/llvm/Instructions.h
lib/Analysis/CodeMetrics.cpp
lib/Analysis/InlineCost.cpp
lib/Analysis/LoopInfo.cpp
lib/AsmParser/LLLexer.cpp
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLToken.h
lib/Transforms/Scalar/JumpThreading.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Scalar/LoopUnswitch.cpp
lib/VMCore/Attributes.cpp
test/Transforms/Inline/basictest.ll
test/Transforms/JumpThreading/basic.ll
test/Transforms/LoopRotate/basic.ll
test/Transforms/LoopUnroll/basic.ll
test/Transforms/LoopUnswitch/basictest.ll