@@ -256,15 +256,11 @@ struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
256256 SmallVector<Value> workList;
257257
258258 func->walk ([&](cf::CondBranchOp condBr) {
259- for (auto operand : condBr.getOperands ()) {
260- workList.push_back (operand);
261- }
259+ llvm::append_range (workList, condBr.getOperands ());
262260 });
263261
264262 func->walk ([&](cf::BranchOp br) {
265- for (auto operand : br.getOperands ()) {
266- workList.push_back (operand);
267- }
263+ llvm::append_range (workList, br.getOperands ());
268264 });
269265
270266 DenseSet<Value> visitedValues;
@@ -310,8 +306,7 @@ struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
310306 // detensorable and if so, their operands will be added to workList to
311307 // potentially discover other parts of the detensorable component.
312308 for (auto *user : currentItem.getUsers ())
313- for (Value result : user->getResults ())
314- workList.push_back (result);
309+ llvm::append_range (workList, user->getResults ());
315310
316311 // 2 - Look backward:
317312 // 2.1 - The current item is defined by a block argument. If the owner
@@ -383,10 +378,7 @@ struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
383378 }
384379
385380 opsToDetensor.insert (genericOp);
386-
387- for (Value genericOpOperand : genericOp.inputs ())
388- workList.push_back (genericOpOperand);
389-
381+ llvm::append_range (workList, genericOp.inputs ());
390382 continue ;
391383 }
392384
@@ -405,8 +397,7 @@ struct LinalgDetensorize : public LinalgDetensorizeBase<LinalgDetensorize> {
405397 if (llvm::all_of (
406398 currentItemDefiningOp->getResultTypes (),
407399 [&](Type resultType) { return resultType.isIntOrFloat (); }))
408- for (Value scalarOpOperand : currentItemDefiningOp->getOperands ())
409- workList.push_back (scalarOpOperand);
400+ llvm::append_range (workList, currentItemDefiningOp->getOperands ());
410401 }
411402
412403 // Since the cost model gives up on some ops (see the details of step 2.2
0 commit comments