From 4fcb006fb627b26a454d59298cd771fffd670477 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 27 Apr 2023 10:49:34 +0200 Subject: [PATCH] [SCEV] Fix getOperandsToCreate() for and/or We can create expressions either for constant operand or i1 and/or. The implementation was inverting the latter check. --- llvm/lib/Analysis/ScalarEvolution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 15bb954..d8a269a 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -7475,7 +7475,7 @@ ScalarEvolution::getOperandsToCreate(Value *V, SmallVectorImpl &Ops) { break; case Instruction::And: case Instruction::Or: - if (!IsConstArg && BO->LHS->getType()->isIntegerTy(1)) + if (!IsConstArg && !BO->LHS->getType()->isIntegerTy(1)) return nullptr; break; case Instruction::LShr: -- 2.7.4