Skip to content
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
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ void AsmPrinter::emitJumpTableSizesSection(const MachineJumpTableInfo *MJTI,

if (isElf) {
MCSymbolELF *LinkedToSym = dyn_cast<MCSymbolELF>(CurrentFnSym);
int Flags = F.hasComdat() ? (unsigned)ELF::SHF_GROUP : 0;
int Flags = F.hasComdat() ? static_cast<int>(ELF::SHF_GROUP) : 0;

JumpTableSizesSection = OutContext.getELFSection(
sectionName, ELF::SHT_LLVM_JT_SIZES, Flags, 0, GroupName, F.hasComdat(),
Expand Down
21 changes: 14 additions & 7 deletions mlir/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,20 @@ check_c_compiler_flag("-Werror=mismatched-tags" C_SUPPORTS_WERROR_MISMATCHED_TAG
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_C_FLAGS)
append_if(C_SUPPORTS_WERROR_MISMATCHED_TAGS "-Werror=mismatched-tags" CMAKE_CXX_FLAGS)

# Silence a false positive GCC -Wunused-but-set-parameter warning in constexpr
# cases, by marking SelectedCase as used. See
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is
# fixed in GCC 10.
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "10.0")
check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
# Silence a false positive GCC -Wunused-but-set-parameter warning in
# constexpr cases. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827
# for details
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "14.0")
check_cxx_compiler_flag("-Wno-unused-but-set-parameter" CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER)
append_if(CXX_SUPPORTS_WNO_UNUSED_BUT_SET_PARAMETER "-Wno-unused-but-set-parameter" CMAKE_CXX_FLAGS)
endif()
# Silence a false positive GCC -Wdeprecated-copy warning in cases where
# a copy operator is defined through "using" a base class copy operator.
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")
check_cxx_compiler_flag("-Wno-deprecated-copy" CXX_SUPPORTS_WNO_DEPRECTAED_COPY)
append_if(CXX_SUPPORTS_WNO_DEPRECTAED_COPY "-Wno-deprecated-copy" CMAKE_CXX_FLAGS)
endif()
endif()

# Installing the headers and docs needs to depend on generating any public
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/CAPI/IR/IR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ static mlir::WalkResult unwrap(MlirWalkResult result) {
case MlirWalkResultSkip:
return mlir::WalkResult::skip();
}
llvm_unreachable("unknown result in WalkResult::unwrap");
}

void mlirOperationWalk(MlirOperation op, MlirOperationWalkCallback callback,
Expand Down
3 changes: 3 additions & 0 deletions mlir/lib/Conversion/ArmSMEToLLVM/ArmSMEToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static Operation *createLoadTileSliceIntrinsic(
break;
}
}
llvm_unreachable("unknown type in createLoadTileSliceIntrinsic");
}

/// Helper to create an arm_sme.intr.st1*.(horiz|vert)' intrinsic.
Expand Down Expand Up @@ -125,6 +126,7 @@ static Operation *createStoreTileSliceIntrinsic(
loc, maskOp, ptr, tileId, tileSliceI32);
}
}
llvm_unreachable("unknown type in createStoreTileSliceIntrinsic");
}

IntegerAttr getTileIdOrError(arm_sme::ArmSMETileOpInterface op) {
Expand Down Expand Up @@ -850,6 +852,7 @@ struct StreamingVLOpConversion
case arm_sme::TypeSize::Double:
return rewriter.create<arm_sme::aarch64_sme_cntsd>(loc, i64Type);
}
llvm_unreachable("unknown type size in StreamingVLOpConversion");
}();
rewriter.replaceOpWithNewOp<arith::IndexCastOp>(
streamingVlOp, rewriter.getIndexType(), intrOp->getResult(0));
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Conversion/IndexToSPIRV/IndexToSPIRV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ struct ConvertIndexCmpPattern final : OpConversionPattern<CmpOp> {
case IndexCmpPredicate::ULT:
return rewriteCmpOp<spirv::ULessThanOp>(op, adaptor, rewriter);
}
llvm_unreachable("Unknown predicate in ConvertIndexCmpPattern");
}
};

Expand Down
4 changes: 2 additions & 2 deletions mlir/lib/Debug/DebuggerExecutionContextHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ void mlirDebuggerAddFileLineColLocBreakpoint(const char *file, int line,

LLVM_ATTRIBUTE_NOINLINE void mlirDebuggerBreakpointHook() {
static LLVM_THREAD_LOCAL void *volatile sink;
sink = (void *)&sink;
sink = static_cast<void *>(const_cast<void **>(&sink));
}

static void preventLinkerDeadCodeElim() {
Expand All @@ -321,7 +321,7 @@ static void preventLinkerDeadCodeElim() {
sink = (void *)mlirDebuggerAddTagBreakpoint;
sink = (void *)mlirDebuggerAddRewritePatternBreakpoint;
sink = (void *)mlirDebuggerAddFileLineColLocBreakpoint;
sink = (void *)&sink;
sink = static_cast<void *>(const_cast<void **>(&sink));
return true;
}();
(void)initialized;
Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Dialect/AMDGPU/IR/AMDGPUDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ LogicalResult DPPOp::verify() {
return emitOpError("quad_perm attribute must have exactly 4 elements");
}
for (auto elem : quadPermAttr.getAsRange<IntegerAttr>()) {
uint32_t num = elem.getInt();
int32_t num = elem.getInt();
if (num < 0 || num > 3) {
return emitOpError(
"Each element of quad_perm must be in the range [0, 3]");
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Dialect/ArmSME/Transforms/TileAllocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ static ArrayRef<TileMask> getMasks(ArmSMETileType type) {
case ArmSMETileType::ZAQ:
return ZA_Q_MASKS;
}
llvm_unreachable("unknown type in getMasks");
}

class TileAllocator {
Expand Down
5 changes: 0 additions & 5 deletions mlir/lib/Dialect/Async/Transforms/AsyncParallelFor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ struct ParallelComputeFunctionArgs {
BlockArgument blockSize();
ArrayRef<BlockArgument> tripCounts();
ArrayRef<BlockArgument> lowerBounds();
ArrayRef<BlockArgument> upperBounds();
ArrayRef<BlockArgument> steps();
ArrayRef<BlockArgument> captures();

Expand Down Expand Up @@ -175,10 +174,6 @@ ArrayRef<BlockArgument> ParallelComputeFunctionArgs::lowerBounds() {
return args.drop_front(2 + 1 * numLoops).take_front(numLoops);
}

ArrayRef<BlockArgument> ParallelComputeFunctionArgs::upperBounds() {
return args.drop_front(2 + 2 * numLoops).take_front(numLoops);
}

ArrayRef<BlockArgument> ParallelComputeFunctionArgs::steps() {
return args.drop_front(2 + 3 * numLoops).take_front(numLoops);
}
Expand Down
1 change: 1 addition & 0 deletions mlir/lib/Dialect/Index/IR/IndexOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ static bool compareSameArgs(IndexCmpPredicate pred) {
case IndexCmpPredicate::ULT:
return false;
}
llvm_unreachable("unknown predicate in compareSameArgs");
}

OpFoldResult CmpOp::fold(FoldAdaptor adaptor) {
Expand Down
10 changes: 4 additions & 6 deletions mlir/lib/Transforms/Utils/DialectConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1045,9 +1045,8 @@ UnresolvedMaterializationRewrite::UnresolvedMaterializationRewrite(
const TypeConverter *converter, MaterializationKind kind, Type originalType)
: OperationRewrite(Kind::UnresolvedMaterialization, rewriterImpl, op),
converterAndKind(converter, kind), originalType(originalType) {
assert(!originalType ||
kind == MaterializationKind::Target &&
"original type is valid only for target materializations");
assert((!originalType || kind == MaterializationKind::Target) &&
"original type is valid only for target materializations");
rewriterImpl.unresolvedMaterializations[op] = this;
}

Expand Down Expand Up @@ -1337,9 +1336,8 @@ Value ConversionPatternRewriterImpl::buildUnresolvedMaterialization(
MaterializationKind kind, OpBuilder::InsertPoint ip, Location loc,
ValueRange inputs, Type outputType, Type originalType,
const TypeConverter *converter) {
assert(!originalType ||
kind == MaterializationKind::Target &&
"original type is valid only for target materializations");
assert((!originalType || kind == MaterializationKind::Target) &&
"original type is valid only for target materializations");

// Avoid materializing an unnecessary cast.
if (inputs.size() == 1 && inputs.front().getType() == outputType)
Expand Down
2 changes: 1 addition & 1 deletion mlir/unittests/Bytecode/BytecodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ TEST(Bytecode, MultiModuleWithResource) {
constexpr size_t kAlignment = 0x20;
size_t bufferSize = buffer.size();
buffer.reserve(bufferSize + kAlignment - 1);
size_t pad = ~(uintptr_t)buffer.data() + 1 & kAlignment - 1;
size_t pad = (~(uintptr_t)buffer.data() + 1) & (kAlignment - 1);
buffer.insert(0, pad, ' ');
StringRef alignedBuffer(buffer.data() + pad, bufferSize);

Expand Down
3 changes: 2 additions & 1 deletion mlir/unittests/Support/CyclicReplacerCacheTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ class CachedCyclicReplacerGraphReplacement : public ::testing::Test {
/// Add a recursive-self-node, i.e. a duplicate of the original node that is
/// meant to represent an indirection to it.
std::pair<Node, int64_t> addRecursiveSelfNode(Graph::Node originalId) {
return {addNode(originalId, nextRecursionId), nextRecursionId++};
auto node = addNode(originalId, nextRecursionId);
return {node, nextRecursionId++};
}
void addEdge(Node src, Node sink) { connections.addEdge(src, sink); }

Expand Down