@@ -1741,11 +1741,9 @@ struct ReplaceIfYieldWithConditionOrValue : public OpRewritePattern<IfOp> {
1741
1741
op.getOperation ()->getIterator ());
1742
1742
bool changed = false ;
1743
1743
Type i1Ty = rewriter.getI1Type ();
1744
- for (auto tup : llvm::zip (trueYield.getResults (), falseYield.getResults (),
1745
- op.getResults ())) {
1746
- Value trueResult, falseResult, opResult;
1747
- std::tie (trueResult, falseResult, opResult) = tup;
1748
-
1744
+ for (auto [trueResult, falseResult, opResult] :
1745
+ llvm::zip (trueYield.getResults (), falseYield.getResults (),
1746
+ op.getResults ())) {
1749
1747
if (trueResult == falseResult) {
1750
1748
if (!opResult.use_empty ()) {
1751
1749
opResult.replaceAllUsesWith (trueResult);
@@ -2315,10 +2313,9 @@ struct CollapseSingleIterationLoops : public OpRewritePattern<ParallelOp> {
2315
2313
newLowerBounds.reserve (op.getLowerBound ().size ());
2316
2314
newUpperBounds.reserve (op.getUpperBound ().size ());
2317
2315
newSteps.reserve (op.getStep ().size ());
2318
- for (auto dim : llvm::zip (op.getLowerBound (), op.getUpperBound (),
2319
- op.getStep (), op.getInductionVars ())) {
2320
- Value lowerBound, upperBound, step, iv;
2321
- std::tie (lowerBound, upperBound, step, iv) = dim;
2316
+ for (auto [lowerBound, upperBound, step, iv] :
2317
+ llvm::zip (op.getLowerBound (), op.getUpperBound (), op.getStep (),
2318
+ op.getInductionVars ())) {
2322
2319
// Collect the statically known loop bounds.
2323
2320
auto lowerBoundConstant =
2324
2321
dyn_cast_or_null<arith::ConstantIndexOp>(lowerBound.getDefiningOp ());
@@ -2823,8 +2820,7 @@ struct RemoveLoopInvariantArgsFromBeforeBlock
2823
2820
for (const auto &it :
2824
2821
llvm::enumerate (llvm::zip (op.getOperands (), yieldOpArgs))) {
2825
2822
auto index = static_cast <unsigned >(it.index ());
2826
- Value initVal, yieldOpArg;
2827
- std::tie (initVal, yieldOpArg) = it.value ();
2823
+ auto [initVal, yieldOpArg] = it.value ();
2828
2824
// If i-th yield operand is equal to the i-th operand of the scf.while,
2829
2825
// the i-th before block argument is a loop invariant.
2830
2826
if (yieldOpArg == initVal) {
@@ -2855,8 +2851,7 @@ struct RemoveLoopInvariantArgsFromBeforeBlock
2855
2851
for (const auto &it :
2856
2852
llvm::enumerate (llvm::zip (op.getOperands (), yieldOpArgs))) {
2857
2853
auto index = static_cast <unsigned >(it.index ());
2858
- Value initVal, yieldOpArg;
2859
- std::tie (initVal, yieldOpArg) = it.value ();
2854
+ auto [initVal, yieldOpArg] = it.value ();
2860
2855
2861
2856
// If i-th yield operand is equal to the i-th operand of the scf.while,
2862
2857
// the i-th before block argument is a loop invariant.
0 commit comments