diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-30 20:38:12 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-30 20:38:12 +0000 |
commit | 9af7afcb7f834ff7a4b78a284051c53db984007c (patch) | |
tree | 017ea5f5d05e3522b0d55b9f29d775588fbb443c /llvm/lib/CodeGen/TailDuplication.cpp | |
parent | b30438aa2b253d89a5efdabbe8230b816948011b (diff) | |
download | bcm5719-llvm-9af7afcb7f834ff7a4b78a284051c53db984007c.tar.gz bcm5719-llvm-9af7afcb7f834ff7a4b78a284051c53db984007c.zip |
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.
llvm-svn: 124564
Diffstat (limited to 'llvm/lib/CodeGen/TailDuplication.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index 15aed3436c7..83706deb3f7 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/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; |