Skip to content

Commit b42e0c5

Browse files
committed
add check for !SI
1 parent 2f5c4f8 commit b42e0c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ Instruction *InstCombinerImpl::foldAddWithConstant(BinaryOperator &Add) {
884884
X->getType()->getScalarSizeInBits() == 1)
885885
SI = SelectInst::Create(X, InstCombiner::AddOne(Op1C), Op1);
886886
// sext(bool) + C -> bool ? C - 1 : C
887-
if (match(Op0, m_SExt(m_Value(X))) &&
887+
if (!SI && match(Op0, m_SExt(m_Value(X))) &&
888888
X->getType()->getScalarSizeInBits() == 1)
889889
SI = SelectInst::Create(X, InstCombiner::SubOne(Op1C), Op1);
890890
if (SI) {

0 commit comments

Comments
 (0)