Skip to content

Commit eb3a1f1

Browse files
committed
[InstCombine] recognize missed i128 split optimization
1 parent 94f34c0 commit eb3a1f1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3119,6 +3119,13 @@ static Value *matchOrConcat(Instruction &Or, InstCombiner::BuilderTy &Builder) {
31193119
match(UpperSrc, m_BitReverse(m_Value(UpperBRev))))
31203120
return ConcatIntrinsicCalls(Intrinsic::bitreverse, UpperBRev, LowerBRev);
31213121

3122+
Value *X;
3123+
if (match(LowerSrc, m_SExt(m_Value(X))) &&
3124+
match(UpperSrc,
3125+
m_SExt(m_AShr(m_Specific(X), m_SpecificInt(HalfWidth / 2 - 1))))) {
3126+
return Builder.CreateSExt(X, Ty);
3127+
}
3128+
31223129
return nullptr;
31233130
}
31243131

0 commit comments

Comments
 (0)