diff options
author | Sanjay Patel <spatel@rotateright.com> | 2015-08-11 19:39:36 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2015-08-11 19:39:36 +0000 |
commit | 82d91ddb4f3a8f44166cde07af47217fcc3023fb (patch) | |
tree | 47d85e00869330aae697f710c7720433cb71a055 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | f6ae8ae025fbf2e49fe37ff13bc7bf6762b01697 (diff) | |
download | bcm5719-llvm-82d91ddb4f3a8f44166cde07af47217fcc3023fb.tar.gz bcm5719-llvm-82d91ddb4f3a8f44166cde07af47217fcc3023fb.zip |
fix minsize detection: minsize attribute implies optimizing for size
Also, add a test for optsize because this was not part of any existing regression test.
llvm-svn: 244651
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 3768807702b..9e0ac96ba56 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -214,8 +214,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) { TLI = TM->getSubtargetImpl(F)->getTargetLowering(); TLInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(); TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F); - // FIXME: Use Function::optForSize(). - OptSize = F.hasFnAttribute(Attribute::OptimizeForSize); + OptSize = F.optForSize(); /// This optimization identifies DIV instructions that can be /// profitably bypassed and carried out with a shorter, faster divide. |