[llvm] [CmpInstAnalysis] Return decomposed bit test as struct (NFC) (PR #109819)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 24 10:53:19 PDT 2024
================
@@ -2465,10 +2465,16 @@ static bool detectShiftUntilBitTestIdiom(Loop *CurLoop, Value *&BaseX,
};
auto MatchDecomposableConstantBitMask = [&]() {
APInt Mask;
- return llvm::decomposeBitTestICmp(CmpLHS, CmpRHS, Pred, CurrX, Mask) &&
- ICmpInst::isEquality(Pred) && Mask.isPowerOf2() &&
- (BitMask = ConstantInt::get(CurrX->getType(), Mask)) &&
- (BitPos = ConstantInt::get(CurrX->getType(), Mask.logBase2()));
+ auto Res = llvm::decomposeBitTestICmp(CmpLHS, CmpRHS, Pred);
+ if (Res && Res->Mask.isPowerOf2()) {
+ assert(ICmpInst::isEquality(Res->Pred));
----------------
goldsteinn wrote:
Why did this become an assert?
https://github.com/llvm/llvm-project/pull/109819
More information about the llvm-commits
mailing list