Skip to content

Commit

Permalink
Fix mistake
Browse files Browse the repository at this point in the history
  • Loading branch information
AZero13 committed Apr 21, 2024
1 parent 0c43692 commit 59ca3c2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,8 +1270,8 @@ Instruction *InstCombinerImpl::visitLShr(BinaryOperator &I) {
// If both the add and the shift are nuw, then:
// ((X << Y) + Z) nuw >>u Z --> X + (Y nuw >>u Z) nuw
Value *Y;
if (match(Op0, m_OneUse(m_c_NUWAdd((m_NUWShl(m_Value(X), m_Specific(Op1))),
m_Value(Y))))) {
if (match(Op0, m_OneUse(m_c_NUWAdd(m_NUWShl(m_Value(X), m_Value(Y)),
m_Specific(Op1))))) {
Value *NewLshr = Builder.CreateLShr(Y, Op1, "", I.isExact());
auto *newAdd = BinaryOperator::CreateNUWAdd(NewLshr, X);
if (auto *Op0Bin = cast<OverflowingBinaryOperator>(Op0))
Expand Down

0 comments on commit 59ca3c2

Please sign in to comment.