summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorSebastian Pop <sebpop@gmail.com>2016-12-12 02:52:51 +0000
committerSebastian Pop <sebpop@gmail.com>2016-12-12 02:52:51 +0000
commit8c9cc8c86be80abd4224341314725d03551460d6 (patch)
tree233be3a765d7f5e2f181c5dd2ffaaf5085c473d9 /llvm/lib/Analysis/ScalarEvolution.cpp
parent7fc6d34ed1fce99505713c5b09b3701aaac9d60e (diff)
downloadbcm5719-llvm-8c9cc8c86be80abd4224341314725d03551460d6.tar.gz
bcm5719-llvm-8c9cc8c86be80abd4224341314725d03551460d6.zip
[SCEVExpand] do not hoist divisions by zero (PR30935)
SCEVExpand computes the insertion point for the components of a SCEV to be code generated. When it comes to generating code for a division, SCEVexpand would not be able to check (at compilation time) all the conditions necessary to avoid a division by zero. The patch disables hoisting of expressions containing divisions by anything other than non-zero constants in order to avoid hoisting these expressions past conditions that should hold before doing the division. The patch passes check-all on x86_64-linux. Differential Revision: https://reviews.llvm.org/D27216 llvm-svn: 289412
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 7962222a210..051489730bb 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -2130,7 +2130,7 @@ const SCEV *ScalarEvolution::getAddExpr(SmallVectorImpl<const SCEV *> &Ops,
}
// Okay, check to see if the same value occurs in the operand list more than
- // once. If so, merge them together into an multiply expression. Since we
+ // once. If so, merge them together into a multiply expression. Since we
// sorted the list, these values are required to be adjacent.
Type *Ty = Ops[0]->getType();
bool FoundMatch = false;
OpenPOWER on IntegriCloud