[llvm] 4fcb006 - [SCEV] Fix getOperandsToCreate() for and/or

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 01:51:05 PDT 2023


Author: Nikita Popov
Date: 2023-04-27T10:50:57+02:00
New Revision: 4fcb006fb627b26a454d59298cd771fffd670477

URL: https://github.com/llvm/llvm-project/commit/4fcb006fb627b26a454d59298cd771fffd670477
DIFF: https://github.com/llvm/llvm-project/commit/4fcb006fb627b26a454d59298cd771fffd670477.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Analysis/ScalarEvolution.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 15bb95429ca6..d8a269aa9815 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -7475,7 +7475,7 @@ ScalarEvolution::getOperandsToCreate(Value *V, SmallVectorImpl<Value *> &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:


        


More information about the llvm-commits mailing list