commit | 2a47bd8b2a96d8517831778066eb96724da50300 | [log] [tgz] |
---|---|---|
author | Florian Hahn <flo@fhahn.com> | Sun Nov 28 12:00:55 2021 +0000 |
committer | Copybara-Service <copybara-worker@google.com> | Sun Nov 28 04:22:39 2021 -0800 |
tree | 19bec56264e681d6fbf977229afae76c7a7204d7 | |
parent | b2aa74b268f7f966f74c0d2a5851728d27534755 [diff] |
[SCEV] Turn validity check in getExistingSCEV into assert (NFC). Now that we track users of SCEV expressions, we should be able to always invalidate containing expressions. With that, I think the case where a value gets removed but SCEVs containing references to it should not be possible any longer. Turn check into an assert. This slightly reduces compile-time: NewPM-O3: -0.27% NewPM-ReleaseThinLTO: -0.21% NewPM-ReleaseLTO-g: -0.26% http://llvm-compile-time-tracker.com/compare.php?from=c3dc6b081da6ba503e67d260033f81f61eb38ea3&to=95a4a028b1f1dd0bc3d221435953b7d2c031b3d5&stat=instructions Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D114633 GitOrigin-RevId: 7b75110fac979be24eed0178caa9d1f8c68e14eb
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index f41b895..8007cef 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp
@@ -4146,10 +4146,9 @@ ValueExprMapType::iterator I = ValueExprMap.find_as(V); if (I != ValueExprMap.end()) { const SCEV *S = I->second; - if (checkValidity(S)) - return S; - eraseValueFromMap(V); - forgetMemoizedResults(S); + assert(checkValidity(S) && + "existing SCEV has not been properly invalidated"); + return S; } return nullptr; }