Skip to content

[mlir] Remove unused local variables (NFC) #138642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ createNonLdMatrixLoads(RewriterBase &rewriter, vector::TransferReadOp op,
}

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

// This is the individual element type.
Type loadedElType = regInfo->registerLLVMType;
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ struct ConvertMemRefAllocation final : OpConversionPattern<OpTy> {

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

// Get linearized type.
int srcBits = currentType.getElementType().getIntOrFloatBitWidth();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,10 +955,6 @@ std::pair<Operation *, Value> sparse_tensor::genCoIteration(
// Generates loop body.
builder.setInsertionPointToStart(after);
ValueRange aArgs = after->getArguments();
// Since some LoopCondKind might need extra checks to filter out invalid
// iterations, we maintains another array to hold the iteration arguments to
// yield if the checks fails.
SmallVector<Value> nextArgs(aArgs.begin(), aArgs.end());

for (SparseIterator *it : spIters) {
aArgs = it->linkNewScope(aArgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1659,7 +1659,6 @@ void transform::detail::getPotentialTopLevelEffects(
if (!iface)
continue;

SmallVector<MemoryEffects::EffectInstance, 2> nestedEffects;
iface.getEffects(effects);
}
return;
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Dialect/Vector/IR/VectorOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,6 @@ void ContractionOp::getIterationBounds(
auto lhsShape = getLhsType().getShape();
auto resVectorType = llvm::dyn_cast<VectorType>(getResultType());
SmallVector<AffineMap, 4> indexingMaps(getIndexingMapsArray());
SmallVector<int64_t, 2> iterationShape;
for (const auto &it : llvm::enumerate(getIteratorTypes())) {
// Search lhs/rhs map results for 'targetExpr'.
auto targetExpr = getAffineDimExpr(it.index(), getContext());
Expand Down
2 changes: 0 additions & 2 deletions mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,6 @@ struct WarpOpForwardOperand : public WarpDistributionPattern {
using Base::Base;
LogicalResult matchAndRewrite(WarpExecuteOnLane0Op warpOp,
PatternRewriter &rewriter) const override {
SmallVector<Type> resultTypes;
SmallVector<Value> yieldValues;
auto yield = cast<gpu::YieldOp>(
warpOp.getBodyRegion().getBlocks().begin()->getTerminator());
Value valForwarded;
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ LogicalResult OperationVerifier::verifyOnEntrance(Operation &op) {
if (!numRegions)
return success();
auto kindInterface = dyn_cast<RegionKindInterface>(&op);
SmallVector<Operation *> opsWithIsolatedRegions;
// Verify that all child regions are ok.
MutableArrayRef<Region> regions = op.getRegions();
for (unsigned i = 0; i < numRegions; ++i) {
Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Interfaces/DataLayoutInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,6 @@ static DataLayoutSpecInterface getCombinedDataLayout(Operation *leaf) {
assert((isa<ModuleOp, DataLayoutOpInterface>(leaf)) &&
"expected an op with data layout spec");

SmallVector<DataLayoutOpInterface> opsWithLayout;
SmallVector<DataLayoutSpecInterface> specs;
collectParentLayouts(leaf, specs);

Expand Down
1 change: 0 additions & 1 deletion mlir/lib/Transforms/Utils/InliningUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,6 @@ static void handleResultImpl(InlinerInterface &interface, OpBuilder &builder,
}

// Run the result attribute handler for the given result and attribute.
SmallVector<DictionaryAttr> resultAttributes;
for (auto [result, resAttr] : llvm::zip(results, resAttrs)) {
// Store the original result users before running the handler.
DenseSet<Operation *> resultUsers(llvm::from_range, result.getUsers());
Expand Down
1 change: 0 additions & 1 deletion mlir/test/lib/Dialect/Affine/TestVectorizationUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ void VectorizerTestPass::testVecAffineLoopNest(llvm::raw_ostream &outs) {
strategy.vectorSizes.push_back(4 /*vectorization factor*/);
strategy.loopToVectorDim[outermostLoop] = 0;

ReductionLoopMap reductionLoops;
SmallVector<LoopReduction, 2> reductions;
if (!isLoopParallel(outermostLoop, &reductions)) {
outs << "Outermost loop cannot be parallel\n";
Expand Down
1 change: 0 additions & 1 deletion mlir/test/lib/Dialect/SCF/TestSCFUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ struct TestSCFForUtilsPass

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

if (testReplaceWithNewYields) {
func.walk([&](scf::ForOp forOp) {
Expand Down
1 change: 0 additions & 1 deletion mlir/tools/mlir-tblgen/RewriterGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,6 @@ void PatternEmitter::createAggregateLocalVarsForOpArgs(

const auto *operand =
cast<NamedTypeConstraint *>(resultOp.getArg(argIndex));
std::string varName;
if (operand->isVariadic()) {
++numVariadic;
std::string range;
Expand Down
3 changes: 1 addition & 2 deletions mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,8 +1180,7 @@ static bool emitSerializationFns(const RecordKeeper &records, raw_ostream &os) {
llvm::emitSourceFileHeader("SPIR-V Serialization Utilities/Functions", os,
records);

std::string dSerFnString, dDesFnString, serFnString, deserFnString,
utilsString;
std::string dSerFnString, dDesFnString, serFnString, deserFnString;
raw_string_ostream dSerFn(dSerFnString), dDesFn(dDesFnString),
serFn(serFnString), deserFn(deserFnString);
const Record *attrClass = records.getClass("Attr");
Expand Down