TailDuplicator: Use optForSize instead of hasFnAttribute.

This will cause minsize functions to have the same threshold as optsize
functions, but otherwise should have no effects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278980 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kyle Butt 2016-08-17 21:07:33 +00:00
parent 7526feb22f
commit af9bccaaa4

View File

@ -513,7 +513,7 @@ bool TailDuplicator::shouldTailDuplicate(const MachineFunction &MF,
unsigned MaxDuplicateCount;
if (TailDuplicateSize.getNumOccurrences() == 0 &&
// FIXME: Use Function::optForSize().
MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize))
MF.getFunction()->optForSize())
MaxDuplicateCount = 1;
else
MaxDuplicateCount = TailDuplicateSize;