forked from OSchip/llvm-project
Add convergent property to CodeMetrics.
Summary: No functional changes. Reviewers: jingyue, arsenm Subscribers: arsenm, llvm-commits Differential Revision: http://reviews.llvm.org/D17126 llvm-svn: 260728
This commit is contained in:
parent
531b24b53a
commit
144c5a6c15
|
@ -53,6 +53,9 @@ struct CodeMetrics {
|
|||
/// one or more 'noduplicate' instructions.
|
||||
bool notDuplicatable = false;
|
||||
|
||||
/// \brief True if this function contains a call to a convergent function.
|
||||
bool convergent = false;
|
||||
|
||||
/// \brief True if this function calls alloca (in the C sense).
|
||||
bool usesDynamicAlloca = false;
|
||||
|
||||
|
|
|
@ -152,9 +152,12 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
|
|||
if (II->getType()->isTokenTy() && II->isUsedOutsideOfBlock(BB))
|
||||
notDuplicatable = true;
|
||||
|
||||
if (const CallInst *CI = dyn_cast<CallInst>(II))
|
||||
if (const CallInst *CI = dyn_cast<CallInst>(II)) {
|
||||
if (CI->cannotDuplicate())
|
||||
notDuplicatable = true;
|
||||
if (CI->isConvergent())
|
||||
convergent = true;
|
||||
}
|
||||
|
||||
if (const InvokeInst *InvI = dyn_cast<InvokeInst>(II))
|
||||
if (InvI->cannotDuplicate())
|
||||
|
|
Loading…
Reference in New Issue