mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-28 15:41:58 +00:00
[SCEV] Use SaveAndRestore<T> instead of a hand rolled struct; NFCI.
`ClearWalkingBEDominatingCondsOnExit` is exactly `SaveAndRestore<bool>`, so use `SaveAndRestore<bool>` instead. llvm-svn: 248227
This commit is contained in:
parent
9671de578a
commit
61097b056a
@ -88,6 +88,7 @@
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/MathExtras.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/Support/SaveAndRestore.h"
|
||||
#include <algorithm>
|
||||
using namespace llvm;
|
||||
|
||||
@ -6987,24 +6988,12 @@ ScalarEvolution::isLoopBackedgeGuardedByCond(const Loop *L,
|
||||
LoopContinuePredicate->getSuccessor(0) != L->getHeader()))
|
||||
return true;
|
||||
|
||||
struct ClearWalkingBEDominatingCondsOnExit {
|
||||
ScalarEvolution &SE;
|
||||
|
||||
explicit ClearWalkingBEDominatingCondsOnExit(ScalarEvolution &SE)
|
||||
: SE(SE){}
|
||||
|
||||
~ClearWalkingBEDominatingCondsOnExit() {
|
||||
SE.WalkingBEDominatingConds = false;
|
||||
}
|
||||
};
|
||||
|
||||
// We don't want more than one activation of the following loops on the stack
|
||||
// -- that can lead to O(n!) time complexity.
|
||||
if (WalkingBEDominatingConds)
|
||||
return false;
|
||||
|
||||
WalkingBEDominatingConds = true;
|
||||
ClearWalkingBEDominatingCondsOnExit ClearOnExit(*this);
|
||||
SaveAndRestore<bool> ClearOnExit(WalkingBEDominatingConds, true);
|
||||
|
||||
// Check conditions due to any @llvm.assume intrinsics.
|
||||
for (auto &AssumeVH : AC.assumptions()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user