diff options
author | Florian Hahn <flo@fhahn.com> | 2019-09-25 15:05:08 +0000 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2019-09-25 15:05:08 +0000 |
commit | 5c3bc3c930d3993a2c5f581112c18a9eb0ba6838 (patch) | |
tree | 9092f22afd1040a07a47e77b59c8b822997d609d /llvm/lib/Analysis/ScalarEvolutionExpander.cpp | |
parent | ae834ba52d644088319f7be746c944d67688091f (diff) | |
download | bcm5719-llvm-5c3bc3c930d3993a2c5f581112c18a9eb0ba6838.tar.gz bcm5719-llvm-5c3bc3c930d3993a2c5f581112c18a9eb0ba6838.zip |
[PatternMatch] Make m_Br more flexible, add matchers for BB values.
Currently m_Br only takes references to BasicBlock*, which limits its
flexibility. For example, you have to declare a variable, even if you
ignore the result or you have to have additional checks to make sure the
matched BB matches an expected one.
This patch adds m_BasicBlock and m_SpecificBB matchers, which can be
used like the existing matchers for constants or values.
I also had a look at the existing uses and updated a few. IMO it makes
the code a bit more explicit.
Reviewers: spatel, craig.topper, RKSimon, majnemer, lebedev.ri
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D68013
llvm-svn: 372885
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionExpander.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp index 251717f64e0..8070882c150 100644 --- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp @@ -2105,11 +2105,10 @@ SCEVExpander::getRelatedExistingExpansion(const SCEV *S, const Instruction *At, for (BasicBlock *BB : ExitingBlocks) { ICmpInst::Predicate Pred; Instruction *LHS, *RHS; - BasicBlock *TrueBB, *FalseBB; if (!match(BB->getTerminator(), m_Br(m_ICmp(Pred, m_Instruction(LHS), m_Instruction(RHS)), - TrueBB, FalseBB))) + m_BasicBlock(), m_BasicBlock()))) continue; if (SE.getSCEV(LHS) == S && SE.DT.dominates(LHS, At)) |