summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorPreston Gurd <preston.gurd@intel.com>2013-03-04 18:13:57 +0000
committerPreston Gurd <preston.gurd@intel.com>2013-03-04 18:13:57 +0000
commit485296d1e85510de2b5df8a5c652fd0abeb5db06 (patch)
tree37157fc9c401587e8556ae890caf95a6b1ec83fa /llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
parent6972f6d3c7c2960df6a0720515cfa7c6846903ed (diff)
downloadbcm5719-llvm-485296d1e85510de2b5df8a5c652fd0abeb5db06.tar.gz
bcm5719-llvm-485296d1e85510de2b5df8a5c652fd0abeb5db06.zip
Bypass Slow Divides
* Only apply divide bypass optimization when not optimizing for size. * Fixed bug caused by constant for 0 value of type Int32, used dividend type to generate the constant instead. * For atom x86-64 apply the divide bypass to use 16-bit divides instead of 64-bit divides when operand values are small enough. * Added lit tests for 64-bit divide bypass. Patch by Tyler Nowicki! llvm-svn: 176442
Diffstat (limited to 'llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index d71dd5dec63..015fd2e6e6f 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -154,7 +154,7 @@ bool CodeGenPrepare::runOnFunction(Function &F) {
/// This optimization identifies DIV instructions that can be
/// profitably bypassed and carried out with a shorter, faster divide.
- if (TLI && TLI->isSlowDivBypassed()) {
+ if (!OptSize && TLI && TLI->isSlowDivBypassed()) {
const DenseMap<unsigned int, unsigned int> &BypassWidths =
TLI->getBypassSlowDivWidths();
for (Function::iterator I = F.begin(); I != F.end(); I++)
OpenPOWER on IntegriCloud