File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,30 @@ bool AIE2PreLegalizerCombinerImpl::tryToCombineIntrinsic(
152152 return false ;
153153}
154154
155+ CombinerHelper::GeneratorType sectionGenerator (const int32_t From,
156+ const int32_t To,
157+ const int32_t Partitions,
158+ const int32_t Increment) {
159+ int32_t RoundSize = To / Partitions;
160+ int32_t Index = 0 ;
161+ int32_t Round = 0 ;
162+
163+ return [=]() mutable {
164+ int32_t CurrentGroup = (Index / Increment) % Partitions;
165+ int32_t GroupFirstElement = CurrentGroup * RoundSize;
166+ int32_t IndexInGroup = Index % Increment;
167+ int32_t OffsetGroup = Round * Increment;
168+ int32_t Next = GroupFirstElement + IndexInGroup + OffsetGroup;
169+ if (++Index % (Partitions * Increment) == 0 )
170+ Round++;
171+
172+ std::optional<int32_t > Return = std::optional<int32_t >(Next);
173+ if (Index == To + 1 )
174+ Return = {};
175+ return Return;
176+ };
177+ }
178+
155179bool AIE2PreLegalizerCombinerImpl::tryCombineShuffleVector (
156180 MachineInstr &MI) const {
157181 if (Helper.tryCombineShuffleVector (MI))
You can’t perform that action at this time.
0 commit comments