[llvm-commits] [llvm] r124564 - /llvm/trunk/lib/CodeGen/TailDuplication.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sun Jan 30 12:38:13 PST 2011
Author: stoklund
Date: Sun Jan 30 14:38:12 2011
New Revision: 124564
URL: http://llvm.org/viewvc/llvm-project?rev=124564&view=rev
Log:
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.
Modified:
llvm/trunk/lib/CodeGen/TailDuplication.cpp
Modified: llvm/trunk/lib/CodeGen/TailDuplication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TailDuplication.cpp?rev=124564&r1=124563&r2=124564&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TailDuplication.cpp (original)
+++ llvm/trunk/lib/CodeGen/TailDuplication.cpp Sun Jan 30 14:38:12 2011
@@ -459,7 +459,8 @@
// 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;
More information about the llvm-commits
mailing list