Consistent use of the noduplicate attribute.

The "noduplicate" attribute of call instructions is sometimes queried directly
and sometimes through the cannotDuplicate() predicate. This patch streamlines
all queries to use the cannotDuplicate() predicate. It also adds this predicate
to InvokeInst, to mirror what CallInst has.

llvm-svn: 204049
This commit is contained in:
Eli Bendersky
2014-03-17 16:19:07 +00:00
parent 83731469a1
commit 576ef3c667
5 changed files with 12 additions and 6 deletions

View File

@@ -65,11 +65,11 @@ void CodeMetrics::analyzeBasicBlock(const BasicBlock *BB,
++NumVectorInsts;
if (const CallInst *CI = dyn_cast<CallInst>(II))
if (CI->hasFnAttr(Attribute::NoDuplicate))
if (CI->cannotDuplicate())
notDuplicatable = true;
if (const InvokeInst *InvI = dyn_cast<InvokeInst>(II))
if (InvI->hasFnAttr(Attribute::NoDuplicate))
if (InvI->cannotDuplicate())
notDuplicatable = true;
NumInsts += TTI.getUserCost(&*II);