From 67cb2e7341658e28ca8756774801e8e771067f16 Mon Sep 17 00:00:00 2001 From: Rob Suderman Date: Mon, 29 Jan 2024 09:23:05 -0800 Subject: [PATCH] Fix illegal use of TypeRange (#2815) TypeRange is an ArrayRef and therefore cannot be safely instantiated from a list initializer. --- lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp index 7f2fb2b53..f4e8a60ec 100644 --- a/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp +++ b/lib/Dialect/Torch/Transforms/DecomposeComplexOps.cpp @@ -2615,11 +2615,9 @@ namespace { LogicalResult matchAndRewrite(AtenConvTbcOp op, PatternRewriter &rewriter) const override { Value emptyList = rewriter.create( - op.getLoc(), Torch::ListType::get(Torch::IntType::get(op.getContext())), + op.getLoc(), + Torch::ListType::get(Torch::IntType::get(op.getContext())), SmallVector()); - Value zeroList = rewriter.create( - op.getLoc(), Torch::ListType::get(Torch::IntType::get(op.getContext())), - SmallVector{rewriter.create(op.getLoc(), rewriter.getI64IntegerAttr(0))}); Value cstFalse = rewriter.create(op.getLoc(), false); Value oneList = rewriter.create( op.getLoc(), Torch::ListType::get(Torch::IntType::get(op.getContext())), @@ -5406,8 +5404,8 @@ public: auto resultType2 = op->getResult(2).getType(); auto resultType3 = op->getResult(3).getType(); - mlir::TypeRange returnTypes{resultType0, resultType1, resultType2, - resultType3}; + llvm::SmallVector returnTypes{resultType0, resultType1, resultType2, + resultType3}; rewriter.replaceOpWithNewOp( op, returnTypes, weight, indices, offsets, scaleGradByFreq, mode,