diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-06-24 06:27:14 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-06-24 06:27:14 +0000 |
commit | 8bec6a4e1c0aeaabfd5c2af7b3aec871f87452f9 (patch) | |
tree | ac327456debd7ec31135bf5a1c06c762c905fcf9 /llvm/lib/Analysis/AssumptionCache.cpp | |
parent | 7b66ffe8755f7961f7e6cd713cae9c868b028659 (diff) | |
download | bcm5719-llvm-8bec6a4e1c0aeaabfd5c2af7b3aec871f87452f9.tar.gz bcm5719-llvm-8bec6a4e1c0aeaabfd5c2af7b3aec871f87452f9.zip |
[IR][AssumptionCache] Add m_Shift and m_BitwiseLogic matchers to replace a couple m_CombineOr
Summary:
m_CombineOr isn't very efficient. The code using it is also quite verbose.
This patch adds m_Shift and m_BitwiseLogic matchers to make the using code more concise and improve the match efficiency.
Reviewers: spatel, davide
Reviewed By: davide
Subscribers: davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D34593
llvm-svn: 306206
Diffstat (limited to 'llvm/lib/Analysis/AssumptionCache.cpp')
-rw-r--r-- | llvm/lib/Analysis/AssumptionCache.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/AssumptionCache.cpp b/llvm/lib/Analysis/AssumptionCache.cpp index 0468c794e81..3ff27890dc3 100644 --- a/llvm/lib/Analysis/AssumptionCache.cpp +++ b/llvm/lib/Analysis/AssumptionCache.cpp @@ -84,18 +84,11 @@ void AssumptionCache::updateAffectedValues(CallInst *CI) { Value *B; ConstantInt *C; // (A & B) or (A | B) or (A ^ B). - if (match(V, - m_CombineOr(m_And(m_Value(A), m_Value(B)), - m_CombineOr(m_Or(m_Value(A), m_Value(B)), - m_Xor(m_Value(A), m_Value(B)))))) { + if (match(V, m_BitwiseLogic(m_Value(A), m_Value(B)))) { AddAffected(A); AddAffected(B); // (A << C) or (A >>_s C) or (A >>_u C) where C is some constant. - } else if (match(V, - m_CombineOr(m_Shl(m_Value(A), m_ConstantInt(C)), - m_CombineOr(m_LShr(m_Value(A), m_ConstantInt(C)), - m_AShr(m_Value(A), - m_ConstantInt(C)))))) { + } else if (match(V, m_Shift(m_Value(A), m_ConstantInt(C)))) { AddAffected(A); } }; |