Skip to content

Commit

Permalink
Assign variables with initial/default values (iree-org#14511)
Browse files Browse the repository at this point in the history
To avoid maybe-uninitialized GCC warning
  • Loading branch information
hcindyl authored Jul 29, 2023
1 parent fab1805 commit 0b49316
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,9 @@ static uint32_t flagForUser(IREE::LinalgExt::EncodingUser user) {
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERATION_MATMUL_BF16BF16F32;
case IREE::LinalgExt::EncodingUser::MATMUL_BF16BF16BF16:
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERATION_MATMUL_BF16BF16BF16;
default: // Unreachable.
assert(false);
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERATION_NONE;
}
}

Expand All @@ -408,6 +411,9 @@ static uint32_t flagForRole(IREE::LinalgExt::EncodingRole role) {
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RHS;
case IREE::LinalgExt::EncodingRole::RESULT:
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_RESULT;
default: // Unreachable.
assert(false);
return IREE_UK_FLAG_QUERY_TILE_SIZES_OPERAND_ROLE_LHS;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ void LLVMCPUTensorPadPass::runOnOperation() {
auto funcOp = getOperation();
// Preserve the innermost tensor.pad ops (i.e., pad for reduction dims), so we
// can kick canonicalization patterns to fold outer tensor.pad ops away.
bool nofold;
utils::IteratorType targetIterType;
bool nofold = false;
utils::IteratorType targetIterType = utils::IteratorType::parallel;
switch (option) {
case LLVMCPUTensorPadOption::ParallelDims:
LLVM_DEBUG(llvm::dbgs() << "padding parallel dims\n");
Expand All @@ -51,6 +51,9 @@ void LLVMCPUTensorPadPass::runOnOperation() {
targetIterType = utils::IteratorType::reduction;
nofold = true;
break;
default: // Unreachable.
assert(false);
break;
};
SmallVector<linalg::LinalgOp> candidates;
funcOp.walk([&](linalg::LinalgOp op) { candidates.push_back(op); });
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/iree/compiler/ConstEval/Runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ LogicalResult FunctionCall::addArgument(Location loc, Attribute attr) {
for (size_t i = 0; i < rank; ++i) {
shape[i] = stShape[i];
}
iree_hal_element_type_t elementType;
iree_hal_element_type_t elementType = IREE_HAL_ELEMENT_TYPE_NONE;
if (failed(convertToElementType(loc, st.getElementType(), &elementType)))
return failure();

Expand Down

0 comments on commit 0b49316

Please sign in to comment.