Lines Matching defs:BECount
82 static void ConnectProlog(Loop *L, Value *BECount, unsigned Count,
171 // If BECount <u (Count - 1) then (BECount + 1) % Count == (BECount + 1)
172 // This means %xtraiter is (BECount + 1) and all of the iterations of this
173 // loop were executed by the prologue. Note that if BECount <u (Count - 1)
174 // then (BECount + 1) cannot unsigned-overflow.
176 B.CreateICmpULT(BECount, ConstantInt::get(BECount->getType(), Count - 1));
511 /// Calculate ModVal = (BECount + 1) % Count on the abstract integer domain
514 /// 1) TripCount = BECount + 1 (allowing overflow)
515 /// 2) Log2(Count) <= BitWidth(BECount)
516 static Value *CreateTripRemainder(IRBuilder<> &B, Value *BECount,
518 // Note that TripCount is BECount + 1.
531 // As (BECount + 1) can potentially unsigned overflow we count
532 // (BECount % Count) + 1 which is overflow safe as BECount % Count < Count.
533 Constant *CountC = ConstantInt::get(BECount->getType(), Count);
534 Value *ModValTmp = B.CreateURem(BECount, CountC);
537 // At that point (BECount % Count) + 1 could be equal to Count.
770 Value *BECount;
773 // In this case, freeze the TripCount and base BECount on the frozen
780 BECount =
783 // If we don't need to freeze, use SCEVExpander for BECount as well, to
785 BECount =
789 Value * const ModVal = CreateTripRemainder(B, BECount, TripCount, Count);
792 UseEpilogRemainder ? B.CreateICmpULT(BECount,
793 ConstantInt::get(BECount->getType(),
954 ConnectProlog(L, BECount, Count, PrologExit, LatchExit, PreHeader,