[llvm-commits] [llvm] r157704 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Benjamin Kramer
benny.kra at googlemail.com
Wed May 30 11:42:43 PDT 2012
Author: d0k
Date: Wed May 30 13:42:43 2012
New Revision: 157704
URL: http://llvm.org/viewvc/llvm-project?rev=157704&view=rev
Log:
Make sure that we're dealing with a binary SCEVExpr when simplifying.
Modified:
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=157704&r1=157703&r2=157704&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed May 30 13:42:43 2012
@@ -5654,7 +5654,8 @@
if (!RA)
if (const SCEVAddExpr *AE = dyn_cast<SCEVAddExpr>(LHS))
if (const SCEVMulExpr *ME = dyn_cast<SCEVMulExpr>(AE->getOperand(0)))
- if (ME->getOperand(0)->isAllOnesValue()) {
+ if (AE->getNumOperands() == 2 && ME->getNumOperands() == 2 &&
+ ME->getOperand(0)->isAllOnesValue()) {
RHS = AE->getOperand(1);
LHS = ME->getOperand(1);
Changed = true;
More information about the llvm-commits
mailing list