@@ -145,10 +145,8 @@ struct DistributeScfFor final : OpDistributionPattern<scf::ForOp> {
145145 SmallVector<Value> newInitArgs;
146146 for (Value initArg : forOp.getInitArgs ()) {
147147 if (auto vectorInitArg = dyn_cast<VectorValue>(initArg)) {
148- if (isNonZeroRank (vectorInitArg)) {
149- initArg =
150- getDistributed (rewriter, vectorInitArg, signature[vectorInitArg]);
151- }
148+ initArg =
149+ getDistributed (rewriter, vectorInitArg, signature[vectorInitArg]);
152150 }
153151 newInitArgs.push_back (initArg);
154152 }
@@ -193,14 +191,8 @@ struct DistributeScfFor final : OpDistributionPattern<scf::ForOp> {
193191 SmallVector<Value> operands;
194192 for (Value operand : yieldOp->getOperands ()) {
195193 if (auto vectorOperand = dyn_cast<VectorValue>(operand)) {
196- // Distributing the operand requires it to have a non-zero rank, meaning
197- // it must have at least one dimension. If the vector has a non-zero
198- // rank, the operand is distributed according to the provided layout
199- // signature.
200- if (isNonZeroRank (vectorOperand)) {
201- operand = DistributionPattern::getDistributed (
202- rewriter, vectorOperand, signature[vectorOperand]);
203- }
194+ operand = DistributionPattern::getDistributed (rewriter, vectorOperand,
195+ signature[vectorOperand]);
204196 }
205197 operands.push_back (operand);
206198 }
@@ -223,10 +215,8 @@ struct DistributeScfFor final : OpDistributionPattern<scf::ForOp> {
223215 for (auto [bbArg, oldInit] : llvm::zip_equal (bbArgs, oldInits)) {
224216 Value val = bbArg;
225217 if (auto oldVectorInit = dyn_cast<VectorValue>(oldInit)) {
226- if (isNonZeroRank (oldVectorInit)) {
227- val = rewriter.create <IREE::VectorExt::ToSIMDOp>(
228- oldVectorInit.getLoc (), oldVectorInit.getType (), val);
229- }
218+ val = rewriter.create <IREE::VectorExt::ToSIMDOp>(
219+ oldVectorInit.getLoc (), oldVectorInit.getType (), val);
230220 }
231221 replacements.push_back (val);
232222 }
0 commit comments