aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-30 20:38:12 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-01-30 20:38:12 +0000
commit8352062e52eed6e50786fdb89f5e601fdcbe0d90 (patch)
tree0d937f32df941e1792e89a6f016893dcb69ef799
parent7af00c0f6e4a5612a2438269a6f8a71b0ae9190e (diff)
downloadexternal_llvm-8352062e52eed6e50786fdb89f5e601fdcbe0d90.zip
external_llvm-8352062e52eed6e50786fdb89f5e601fdcbe0d90.tar.gz
external_llvm-8352062e52eed6e50786fdb89f5e601fdcbe0d90.tar.bz2
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
-rw-r--r--lib/CodeGen/TailDuplication.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/TailDuplication.cpp b/lib/CodeGen/TailDuplication.cpp
index 15aed34..83706de 100644
--- a/lib/CodeGen/TailDuplication.cpp
+++ b/lib/CodeGen/TailDuplication.cpp
@@ -459,7 +459,8 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, MachineFunction &MF,
// duplicate only one, because one branch instruction can be eliminated to
// compensate for the duplication.
unsigned MaxDuplicateCount;
- if (MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize))
+ if (TailDuplicateSize.getNumOccurrences() == 0 &&
+ MF.getFunction()->hasFnAttr(Attribute::OptimizeForSize))
MaxDuplicateCount = 1;
else
MaxDuplicateCount = TailDuplicateSize;