Skip to content

[NFC] Fix some typos #108355

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix more
  • Loading branch information
VitalyAnkh committed Sep 12, 2024
commit 2edcaa6a89c3cb907db8ae40eca8c58e96c0bd89
4 changes: 2 additions & 2 deletions mlir/include/mlir/Transforms/Passes.td
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def RemoveDeadValues : Pass<"remove-dead-values"> {
(A) Removes function arguments that are not live,
(B) Removes function return values that are not live across all callers of
the function,
(C) Removes unneccesary operands, results, region arguments, and region
(C) Removes unnecessary operands, results, region arguments, and region
terminator operands of region branch ops, and,
(D) Removes simple and region branch ops that have all non-live results and
don't affect memory in any way,
Expand Down Expand Up @@ -412,7 +412,7 @@ def SROA : Pass<"sroa"> {
let summary = "Scalar Replacement of Aggregates";
let description = [{
Scalar Replacement of Aggregates. Replaces allocations of aggregates into
independant allocations of its elements.
independent allocations of its elements.

Allocators must implement `DestructurableAllocationOpInterface` to provide
the list of memory slots for which destructuring should be attempted.
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/LLVMIR/IR/LLVMMemorySlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static bool areConversionCompatible(const DataLayout &layout, Type targetType,

/// Checks if `dataLayout` describes a little endian layout.
static bool isBigEndian(const DataLayout &dataLayout) {
auto endiannessStr = dyn_cast_or_null<StringAttr>(dataLayout.getEndiannesss());
auto endiannessStr = dyn_cast_or_null<StringAttr>(dataLayout.getEndianness());
return endiannessStr && endiannessStr == "big";
}

Expand Down
10 changes: 5 additions & 5 deletions mlir/lib/Interfaces/DataLayoutInterfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ std::optional<uint64_t> mlir::detail::getDefaultIndexBitwidth(

// Returns the endianness if specified in the given entry. If the entry is empty
// the default endianness represented by an empty attribute is returned.
Attribute mlir::detail::getDefaultEndiannesss(DataLayoutEntryInterface entry) {
Attribute mlir::detail::getDefaultEndianness(DataLayoutEntryInterface entry) {
if (entry == DataLayoutEntryInterface())
return Attribute();

Expand Down Expand Up @@ -580,19 +580,19 @@ std::optional<uint64_t> mlir::DataLayout::getTypeIndexBitwidth(Type t) const {
});
}

mlir::Attribute mlir::DataLayout::getEndiannesss() const {
mlir::Attribute mlir::DataLayout::getEndianness() const {
checkValid();
if (endianness)
return *endianness;
DataLayoutEntryInterface entry;
if (originalLayout)
entry = originalLayout.getSpecForIdentifier(
originalLayout.getEndiannesssIdentifier(originalLayout.getContext()));
originalLayout.getEndiannessIdentifier(originalLayout.getContext()));

if (auto iface = dyn_cast_or_null<DataLayoutOpInterface>(scope))
endianness = iface.getEndiannesss(entry);
endianness = iface.getEndianness(entry);
else
endianness = detail::getDefaultEndiannesss(entry);
endianness = detail::getDefaultEndianness(entry);
return *endianness;
}

Expand Down
12 changes: 6 additions & 6 deletions mlir/lib/Target/LLVMIR/DataLayoutImporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ DataLayoutImporter::tryToEmplacePointerAlignmentEntry(LLVMPointerType type,
}

LogicalResult
DataLayoutImporter::tryToEmplaceEndiannesssEntry(StringRef endianness,
DataLayoutImporter::tryToEmplaceEndiannessEntry(StringRef endianness,
StringRef token) {
auto key = StringAttr::get(context, DLTIDialect::kDataLayoutEndiannesssKey);
auto key = StringAttr::get(context, DLTIDialect::kDataLayoutEndiannessKey);
if (keyEntries.count(key))
return success();

Expand Down Expand Up @@ -236,14 +236,14 @@ void DataLayoutImporter::translateDataLayout(

// Parse the endianness.
if (*prefix == "e") {
if (failed(tryToEmplaceEndiannesssEntry(
DLTIDialect::kDataLayoutEndiannesssLittle, token)))
if (failed(tryToEmplaceEndiannessEntry(
DLTIDialect::kDataLayoutEndiannessLittle, token)))
return;
continue;
}
if (*prefix == "E") {
if (failed(tryToEmplaceEndiannesssEntry(
DLTIDialect::kDataLayoutEndiannesssBig, token)))
if (failed(tryToEmplaceEndiannessEntry(
DLTIDialect::kDataLayoutEndiannessBig, token)))
return;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Target/LLVMIR/DataLayoutImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class DataLayoutImporter {
StringRef token);

/// Adds an endianness entry if there is none yet.
LogicalResult tryToEmplaceEndiannesssEntry(StringRef endianness,
LogicalResult tryToEmplaceEndiannessEntry(StringRef endianness,
StringRef token);

/// Adds an alloca address space entry if there is none yet.
Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,10 @@ translateDataLayout(DataLayoutSpecInterface attribute,
auto key = llvm::dyn_cast_if_present<StringAttr>(entry.getKey());
if (!key)
continue;
if (key.getValue() == DLTIDialect::kDataLayoutEndiannesssKey) {
if (key.getValue() == DLTIDialect::kDataLayoutEndiannessKey) {
auto value = cast<StringAttr>(entry.getValue());
bool isLittleEndian =
value.getValue() == DLTIDialect::kDataLayoutEndiannesssLittle;
value.getValue() == DLTIDialect::kDataLayoutEndiannessLittle;
layoutStream << "-" << (isLittleEndian ? "e" : "E");
layoutStream.flush();
continue;
Expand Down
2 changes: 1 addition & 1 deletion mlir/test/lib/Dialect/DLTI/TestDataLayoutQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ struct TestDataLayoutQuery
uint64_t alignment = layout.getTypeABIAlignment(op.getType());
uint64_t preferred = layout.getTypePreferredAlignment(op.getType());
uint64_t index = layout.getTypeIndexBitwidth(op.getType()).value_or(0);
Attribute endianness = layout.getEndiannesss();
Attribute endianness = layout.getEndianness();
Attribute allocaMemorySpace = layout.getAllocaMemorySpace();
Attribute programMemorySpace = layout.getProgramMemorySpace();
Attribute globalMemorySpace = layout.getGlobalMemorySpace();
Expand Down
12 changes: 6 additions & 6 deletions mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct CustomDataLayoutSpec
}
DataLayoutEntryListRef getEntries() const { return getImpl()->entries; }
LogicalResult verifySpec(Location loc) { return success(); }
StringAttr getEndiannesssIdentifier(MLIRContext *context) const {
StringAttr getEndiannessIdentifier(MLIRContext *context) const {
return Builder(context).getStringAttr(kEndiannessKeyName);
}
StringAttr getAllocaMemorySpaceIdentifier(MLIRContext *context) const {
Expand Down Expand Up @@ -189,7 +189,7 @@ struct SingleQueryType
return 4;
}

Attribute getEndiannesss(DataLayoutEntryInterface entry) {
Attribute getEndianness(DataLayoutEntryInterface entry) {
static bool executed = false;
if (executed)
llvm::report_fatal_error("repeated call");
Expand Down Expand Up @@ -463,7 +463,7 @@ module {}
EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 42)), 8u);
EXPECT_EQ(layout.getTypePreferredAlignment(Float16Type::get(&ctx)), 2u);

EXPECT_EQ(layout.getEndiannesss(), Attribute());
EXPECT_EQ(layout.getEndianness(), Attribute());
EXPECT_EQ(layout.getAllocaMemorySpace(), Attribute());
EXPECT_EQ(layout.getProgramMemorySpace(), Attribute());
EXPECT_EQ(layout.getGlobalMemorySpace(), Attribute());
Expand Down Expand Up @@ -495,7 +495,7 @@ TEST(DataLayout, NullSpec) {
EXPECT_EQ(layout.getTypeIndexBitwidth(Float16Type::get(&ctx)), std::nullopt);
EXPECT_EQ(layout.getTypeIndexBitwidth(IndexType::get(&ctx)), 64u);

EXPECT_EQ(layout.getEndiannesss(), Attribute());
EXPECT_EQ(layout.getEndianness(), Attribute());
EXPECT_EQ(layout.getAllocaMemorySpace(), Attribute());
EXPECT_EQ(layout.getProgramMemorySpace(), Attribute());
EXPECT_EQ(layout.getGlobalMemorySpace(), Attribute());
Expand Down Expand Up @@ -535,7 +535,7 @@ TEST(DataLayout, EmptySpec) {
EXPECT_EQ(layout.getTypeIndexBitwidth(Float16Type::get(&ctx)), std::nullopt);
EXPECT_EQ(layout.getTypeIndexBitwidth(IndexType::get(&ctx)), 64u);

EXPECT_EQ(layout.getEndiannesss(), Attribute());
EXPECT_EQ(layout.getEndianness(), Attribute());
EXPECT_EQ(layout.getAllocaMemorySpace(), Attribute());
EXPECT_EQ(layout.getProgramMemorySpace(), Attribute());
EXPECT_EQ(layout.getGlobalMemorySpace(), Attribute());
Expand Down Expand Up @@ -593,7 +593,7 @@ TEST(DataLayout, SpecWithEntries) {
EXPECT_EQ(layout.getTypePreferredAlignment(IntegerType::get(&ctx, 32)), 64u);
EXPECT_EQ(layout.getTypePreferredAlignment(Float32Type::get(&ctx)), 64u);

EXPECT_EQ(layout.getEndiannesss(), Builder(&ctx).getStringAttr("little"));
EXPECT_EQ(layout.getEndianness(), Builder(&ctx).getStringAttr("little"));
EXPECT_EQ(layout.getAllocaMemorySpace(), Builder(&ctx).getI32IntegerAttr(5));
EXPECT_EQ(layout.getProgramMemorySpace(), Builder(&ctx).getI32IntegerAttr(3));
EXPECT_EQ(layout.getGlobalMemorySpace(), Builder(&ctx).getI32IntegerAttr(2));
Expand Down
Loading