Skip to content

[InstCombine] recognize missed i128 split optimization #129363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

7 changes: 7 additions & 0 deletions llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3119,6 +3119,13 @@ static Value *matchOrConcat(Instruction &Or, InstCombiner::BuilderTy &Builder) {
match(UpperSrc, m_BitReverse(m_Value(UpperBRev))))
return ConcatIntrinsicCalls(Intrinsic::bitreverse, UpperBRev, LowerBRev);

Value *X;
if (match(LowerSrc, m_SExt(m_Value(X))) &&
match(UpperSrc,
m_SExt(m_AShr(m_Specific(X), m_SpecificInt(HalfWidth / 2 - 1))))) {
return Builder.CreateSExt(X, Ty);
}

return nullptr;
}

Expand Down