mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Respect the -tail-dup-size command line option even when optimizing for size.
This is similar to the -unroll-threshold option. There should be no change in behavior when -tail-dup-size is not explicit on the llc command line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124564 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -459,7 +459,8 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
|
|||||||
// duplicate only one, because one branch instruction can be eliminated to
|
// duplicate only one, because one branch instruction can be eliminated to
|
||||||
// compensate for the duplication.
|
// compensate for the duplication.
|
||||||
unsigned MaxDuplicateCount;
|
unsigned MaxDuplicateCount;
|
||||||
if (MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize))
|
if (TailDuplicateSize.getNumOccurrences() == 0 &&
|
||||||
|
MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize))
|
||||||
MaxDuplicateCount = 1;
|
MaxDuplicateCount = 1;
|
||||||
else
|
else
|
||||||
MaxDuplicateCount = TailDuplicateSize;
|
MaxDuplicateCount = TailDuplicateSize;
|
||||||
|
Reference in New Issue
Block a user