@@ -977,18 +977,17 @@ static bool targetSupportsFrem(const TargetLowering &TLI, Type *Ty) {
977977 return TLI.getLibcallName (fremToLibcall (Ty->getScalarType ()));
978978}
979979
980- static void enqueueInstruction (Instruction &I,
981- SmallVector<Instruction *, 4 > &Replace) {
982-
980+ static void addToWorklist (Instruction &I,
981+ SmallVector<Instruction *, 4 > &Worklist) {
983982 if (I.getOperand (0 )->getType ()->isVectorTy ())
984- scalarize (&I, Replace );
983+ scalarize (&I, Worklist );
985984 else
986- Replace .push_back (&I);
985+ Worklist .push_back (&I);
987986}
988987
989988static bool runImpl (Function &F, const TargetLowering &TLI,
990989 AssumptionCache *AC) {
991- SmallVector<Instruction *, 4 > Replace ;
990+ SmallVector<Instruction *, 4 > Worklist ;
992991 bool Modified = false ;
993992
994993 unsigned MaxLegalFpConvertBitWidth =
@@ -1010,7 +1009,7 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
10101009 case Instruction::FRem:
10111010 if (!targetSupportsFrem (TLI, Ty) &&
10121011 FRemExpander::canExpandType (Ty->getScalarType ())) {
1013- enqueueInstruction (I, Replace );
1012+ addToWorklist (I, Worklist );
10141013 Modified = true ;
10151014 }
10161015 break ;
@@ -1020,7 +1019,7 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
10201019 if (IntTy->getIntegerBitWidth () <= MaxLegalFpConvertBitWidth)
10211020 continue ;
10221021
1023- enqueueInstruction (I, Replace );
1022+ addToWorklist (I, Worklist );
10241023 Modified = true ;
10251024 break ;
10261025 }
@@ -1031,16 +1030,16 @@ static bool runImpl(Function &F, const TargetLowering &TLI,
10311030 if (IntTy->getIntegerBitWidth () <= MaxLegalFpConvertBitWidth)
10321031 continue ;
10331032
1034- enqueueInstruction (I, Replace );
1033+ addToWorklist (I, Worklist );
10351034 break ;
10361035 }
10371036 default :
10381037 break ;
10391038 }
10401039 }
10411040
1042- while (!Replace .empty ()) {
1043- Instruction *I = Replace .pop_back_val ();
1041+ while (!Worklist .empty ()) {
1042+ Instruction *I = Worklist .pop_back_val ();
10441043 if (I->getOpcode () == Instruction::FRem) {
10451044 auto SQ = [&]() -> std::optional<SimplifyQuery> {
10461045 if (AC) {
0 commit comments