aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/ScalarEvolution.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2009-04-29 16:38:47 +0000
committerDale Johannesen <dalej@apple.com>2009-04-29 16:38:47 +0000
commit68264ff5fc2233d79f5a8fde1101e57ada36c811 (patch)
tree1dace26ef1653f368491e0d4b2803acc02912531 /lib/Analysis/ScalarEvolution.cpp
parent55715cde5fff543a4e33cb025f512ae60f7e32b1 (diff)
downloadexternal_llvm-68264ff5fc2233d79f5a8fde1101e57ada36c811.zip
external_llvm-68264ff5fc2233d79f5a8fde1101e57ada36c811.tar.gz
external_llvm-68264ff5fc2233d79f5a8fde1101e57ada36c811.tar.bz2
Fix recent regression in gcc.dg/pr26719.c (6835035).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 7f63217..42d2fdd 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -812,11 +812,14 @@ SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op,
SCEVHandle Step = AR->getStepRecurrence(*this);
// Check whether the backedge-taken count can be losslessly casted to
- // the addrec's type. The count is always unsigned.
+ // the addrec's type. The count needs to be the same whether sign
+ // extended or zero extended.
SCEVHandle CastedBECount =
getTruncateOrZeroExtend(BECount, Start->getType());
if (BECount ==
- getTruncateOrZeroExtend(CastedBECount, BECount->getType())) {
+ getTruncateOrZeroExtend(CastedBECount, BECount->getType()) &&
+ BECount ==
+ getTruncateOrSignExtend(CastedBECount, BECount->getType())) {
const Type *WideTy =
IntegerType::get(getTypeSizeInBits(Start->getType()) * 2);
SCEVHandle SMul =