[llvm] [InstCombine] Check isGuaranteedNotToBeUndef in haveNoCommonBitsSetSp… (PR #74390)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 15:50:55 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 4b1254e7d4c30c7e15669e8879f405814c1790ee 523f373dc140d189948aa944e30065ee2ef1c3c2 -- llvm/lib/Analysis/ValueTracking.cpp llvm/unittests/Analysis/ValueTrackingTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index ad1806ee23..0a08829931 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -186,8 +186,7 @@ KnownBits llvm::computeKnownBits(const Value *V, const APInt &DemandedElts,
SimplifyQuery(DL, DT, AC, safeCxtI(V, CxtI), UseInstrInfo));
}
-static bool haveNoCommonBitsSetSpecialCases(const Value *LHS,
- const Value *RHS,
+static bool haveNoCommonBitsSetSpecialCases(const Value *LHS, const Value *RHS,
const SimplifyQuery &SQ) {
// Look for an inverted mask: (X & ~M) op (Y & M).
{
@@ -206,7 +205,8 @@ static bool haveNoCommonBitsSetSpecialCases(const Value *LHS,
// X op ((X & Y) ^ Y) -- this is the canonical form of the previous pattern
// for constant Y.
Value *Y;
- if (match(RHS, m_c_Xor(m_c_And(m_Specific(LHS), m_Value(Y)), m_Deferred(Y))) &&
+ if (match(RHS,
+ m_c_Xor(m_c_And(m_Specific(LHS), m_Value(Y)), m_Deferred(Y))) &&
isGuaranteedNotToBeUndef(LHS, SQ.AC, SQ.CxtI, SQ.DT) &&
isGuaranteedNotToBeUndef(Y, SQ.AC, SQ.CxtI, SQ.DT))
return true;
``````````
</details>
https://github.com/llvm/llvm-project/pull/74390
More information about the llvm-commits
mailing list