aboutsummaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorMax Kazantsev <max.kazantsev@azul.com>2018-11-08 05:07:58 +0000
committerMax Kazantsev <max.kazantsev@azul.com>2018-11-08 05:07:58 +0000
commitb4ace5f3454131a3070ef7c11e19e42fc9a80b4e (patch)
tree7ad281b4a0774695535cc729af7bf5729b52602c /unittests
parent2c000da033ca03bf8ac5aa1c1b8a5fd5bcc5ecf5 (diff)
[SCEV][NFC] Verify IR in isLoop[Entry,Backedge]GuardedByCond
We have a lot of various bugs that are caused by misuse of SCEV (in particular in LV), all of them can simply be described as "we ask SCEV to prove some fact on invalid IR". Some of examples of those are PR36311, PR37221, PR39160. The problem is that these failues manifest differently (what we saw was failure of various asserts across SCEV, but there can also be miscompiles). This patch adds an assert into two SCEV methods that strongly rely on correctness of the IR and are involved in known failues. This will at least allow us to have a clear indication of what was wrong in this case. This patch also fixes a unit test with incorrect IR that fails this verification. Differential Revision: https://reviews.llvm.org/D52930 Reviewed By: fhahn git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@346389 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/Analysis/ScalarEvolutionTest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/unittests/Analysis/ScalarEvolutionTest.cpp b/unittests/Analysis/ScalarEvolutionTest.cpp
index 98fc44e4923..3da0614bb71 100644
--- a/unittests/Analysis/ScalarEvolutionTest.cpp
+++ b/unittests/Analysis/ScalarEvolutionTest.cpp
@@ -701,7 +701,7 @@ TEST_F(ScalarEvolutionsTest, SCEVZeroExtendExpr) {
PN->addIncoming(Dec, IncBB);
BranchInst::Create(CondBB, IncBB);
- Accum = GetElementPtrInst::Create(I8Ty, Accum, Dec, "gep", EndBB);
+ Accum = GetElementPtrInst::Create(I8Ty, Accum, PN, "gep", EndBB);
PrevBB = CondBB;
CondBB = NextBB;