File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -783,9 +783,8 @@ Value *ConstantOffsetExtractor::removeConstOffset(unsigned ChainIndex) {
783783// / A helper function to check if reassociating through an entry in the user
784784// / chain would invalidate the GEP's nuw flag.
785785static bool allowsPreservingNUW (User *U) {
786- assert (isa<BinaryOperator>(U) || isa<CastInst>(U) || isa<ConstantInt>(U));
787786 if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) {
788- // Binary operations needd to be effectively add nuw.
787+ // Binary operations need to be effectively add nuw.
789788 auto Opcode = BO->getOpcode ();
790789 if (Opcode == BinaryOperator::Or) {
791790 // Ors are only considered here if they are disjoint. The addition that
@@ -801,7 +800,7 @@ static bool allowsPreservingNUW(User *U) {
801800 // "add nuw trunc(a), trunc(b)" is more poisonous than "trunc(add nuw a, b)"
802801 if (TruncInst *TI = dyn_cast<TruncInst>(U))
803802 return TI->hasNoUnsignedWrap ();
804- return true ;
803+ return isa<CastInst>(U) || isa<ConstantInt>(U) ;
805804}
806805
807806Value *ConstantOffsetExtractor::Extract (Value *Idx, GetElementPtrInst *GEP,
You can’t perform that action at this time.
0 commit comments