Skip to content

Commit 921d162

Browse files
[mlir] Remove unused local variables (NFC) (#138642)
1 parent dd3f6a3 commit 921d162

File tree

13 files changed

+1
-18
lines changed

13 files changed

+1
-18
lines changed

mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ createNonLdMatrixLoads(RewriterBase &rewriter, vector::TransferReadOp op,
784784
}
785785

786786
Value laneId = rewriter.create<gpu::LaneIdOp>(loc, /*upperBound=*/nullptr);
787-
SmallVector<Value, 4> elements;
788787

789788
// This is the individual element type.
790789
Type loadedElType = regInfo->registerLLVMType;

mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ struct ConvertMemRefAllocation final : OpConversionPattern<OpTy> {
188188

189189
Location loc = op.getLoc();
190190
OpFoldResult zero = rewriter.getIndexAttr(0);
191-
SmallVector<OpFoldResult> indices(currentType.getRank(), zero);
192191

193192
// Get linearized type.
194193
int srcBits = currentType.getElementType().getIntOrFloatBitWidth();

mlir/lib/Dialect/SparseTensor/Transforms/Utils/LoopEmitter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,10 +955,6 @@ std::pair<Operation *, Value> sparse_tensor::genCoIteration(
955955
// Generates loop body.
956956
builder.setInsertionPointToStart(after);
957957
ValueRange aArgs = after->getArguments();
958-
// Since some LoopCondKind might need extra checks to filter out invalid
959-
// iterations, we maintains another array to hold the iteration arguments to
960-
// yield if the checks fails.
961-
SmallVector<Value> nextArgs(aArgs.begin(), aArgs.end());
962958

963959
for (SparseIterator *it : spIters) {
964960
aArgs = it->linkNewScope(aArgs);

mlir/lib/Dialect/Transform/Interfaces/TransformInterfaces.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,6 @@ void transform::detail::getPotentialTopLevelEffects(
16591659
if (!iface)
16601660
continue;
16611661

1662-
SmallVector<MemoryEffects::EffectInstance, 2> nestedEffects;
16631662
iface.getEffects(effects);
16641663
}
16651664
return;

mlir/lib/Dialect/Vector/IR/VectorOps.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,6 @@ void ContractionOp::getIterationBounds(
11361136
auto lhsShape = getLhsType().getShape();
11371137
auto resVectorType = llvm::dyn_cast<VectorType>(getResultType());
11381138
SmallVector<AffineMap, 4> indexingMaps(getIndexingMapsArray());
1139-
SmallVector<int64_t, 2> iterationShape;
11401139
for (const auto &it : llvm::enumerate(getIteratorTypes())) {
11411140
// Search lhs/rhs map results for 'targetExpr'.
11421141
auto targetExpr = getAffineDimExpr(it.index(), getContext());

mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,6 @@ struct WarpOpForwardOperand : public WarpDistributionPattern {
878878
using Base::Base;
879879
LogicalResult matchAndRewrite(WarpExecuteOnLane0Op warpOp,
880880
PatternRewriter &rewriter) const override {
881-
SmallVector<Type> resultTypes;
882-
SmallVector<Value> yieldValues;
883881
auto yield = cast<gpu::YieldOp>(
884882
warpOp.getBodyRegion().getBlocks().begin()->getTerminator());
885883
Value valForwarded;

mlir/lib/IR/Verifier.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ LogicalResult OperationVerifier::verifyOnEntrance(Operation &op) {
179179
if (!numRegions)
180180
return success();
181181
auto kindInterface = dyn_cast<RegionKindInterface>(&op);
182-
SmallVector<Operation *> opsWithIsolatedRegions;
183182
// Verify that all child regions are ok.
184183
MutableArrayRef<Region> regions = op.getRegions();
185184
for (unsigned i = 0; i < numRegions; ++i) {

mlir/lib/Interfaces/DataLayoutInterfaces.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ static DataLayoutSpecInterface getCombinedDataLayout(Operation *leaf) {
402402
assert((isa<ModuleOp, DataLayoutOpInterface>(leaf)) &&
403403
"expected an op with data layout spec");
404404

405-
SmallVector<DataLayoutOpInterface> opsWithLayout;
406405
SmallVector<DataLayoutSpecInterface> specs;
407406
collectParentLayouts(leaf, specs);
408407

mlir/lib/Transforms/Utils/InliningUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ static void handleResultImpl(InlinerInterface &interface, OpBuilder &builder,
248248
}
249249

250250
// Run the result attribute handler for the given result and attribute.
251-
SmallVector<DictionaryAttr> resultAttributes;
252251
for (auto [result, resAttr] : llvm::zip(results, resAttrs)) {
253252
// Store the original result users before running the handler.
254253
DenseSet<Operation *> resultUsers(llvm::from_range, result.getUsers());

mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ void VectorizerTestPass::testVecAffineLoopNest(llvm::raw_ostream &outs) {
239239
strategy.vectorSizes.push_back(4 /*vectorization factor*/);
240240
strategy.loopToVectorDim[outermostLoop] = 0;
241241

242-
ReductionLoopMap reductionLoops;
243242
SmallVector<LoopReduction, 2> reductions;
244243
if (!isLoopParallel(outermostLoop, &reductions)) {
245244
outs << "Outermost loop cannot be parallel\n";

mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ struct TestSCFForUtilsPass
4141

4242
void runOnOperation() override {
4343
func::FuncOp func = getOperation();
44-
SmallVector<scf::ForOp, 4> toErase;
4544

4645
if (testReplaceWithNewYields) {
4746
func.walk([&](scf::ForOp forOp) {

mlir/tools/mlir-tblgen/RewriterGen.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,6 @@ void PatternEmitter::createAggregateLocalVarsForOpArgs(
18471847

18481848
const auto *operand =
18491849
cast<NamedTypeConstraint *>(resultOp.getArg(argIndex));
1850-
std::string varName;
18511850
if (operand->isVariadic()) {
18521851
++numVariadic;
18531852
std::string range;

mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,8 +1180,7 @@ static bool emitSerializationFns(const RecordKeeper &records, raw_ostream &os) {
11801180
llvm::emitSourceFileHeader("SPIR-V Serialization Utilities/Functions", os,
11811181
records);
11821182

1183-
std::string dSerFnString, dDesFnString, serFnString, deserFnString,
1184-
utilsString;
1183+
std::string dSerFnString, dDesFnString, serFnString, deserFnString;
11851184
raw_string_ostream dSerFn(dSerFnString), dDesFn(dDesFnString),
11861185
serFn(serFnString), deserFn(deserFnString);
11871186
const Record *attrClass = records.getClass("Attr");

0 commit comments

Comments
 (0)