comparison lib/CodeGen/TailDuplication.cpp @ 83:60c9769439b8 LLVM3.7

LLVM 3.7
author Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp>
date Wed, 18 Feb 2015 14:55:36 +0900
parents 54457678186b
children afa8332a0e37
comparison
equal deleted inserted replaced
78:af83660cff7b 83:60c9769439b8
558 // Set the limit on the cost to duplicate. When optimizing for size, 558 // Set the limit on the cost to duplicate. When optimizing for size,
559 // duplicate only one, because one branch instruction can be eliminated to 559 // duplicate only one, because one branch instruction can be eliminated to
560 // compensate for the duplication. 560 // compensate for the duplication.
561 unsigned MaxDuplicateCount; 561 unsigned MaxDuplicateCount;
562 if (TailDuplicateSize.getNumOccurrences() == 0 && 562 if (TailDuplicateSize.getNumOccurrences() == 0 &&
563 MF.getFunction()->getAttributes(). 563 MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize))
564 hasAttribute(AttributeSet::FunctionIndex, Attribute::OptimizeForSize))
565 MaxDuplicateCount = 1; 564 MaxDuplicateCount = 1;
566 else 565 else
567 MaxDuplicateCount = TailDuplicateSize; 566 MaxDuplicateCount = TailDuplicateSize;
568 567
569 // If the target has hardware branch prediction that can handle indirect 568 // If the target has hardware branch prediction that can handle indirect