forked from OSchip/llvm-project
[mlir] Annotate functions used only in debug mode with LLVM_ATTRIBUTE_UNUSED
Functions used only in `assert` cause warnings in release mode Reviewed By: mehdi_amini, dcaballe, ftynse Differential Revision: https://reviews.llvm.org/D98476
This commit is contained in:
parent
5ae949a927
commit
39b2cd4009
|
@ -26,10 +26,6 @@ using namespace mlir::vector;
|
||||||
|
|
||||||
using TypePredicate = llvm::function_ref<bool(Type)>;
|
using TypePredicate = llvm::function_ref<bool(Type)>;
|
||||||
|
|
||||||
static bool isF32(Type type) { return type.isF32(); }
|
|
||||||
|
|
||||||
static bool isI32(Type type) { return type.isInteger(32); }
|
|
||||||
|
|
||||||
// Returns vector width if the element type is matching the predicate (scalars
|
// Returns vector width if the element type is matching the predicate (scalars
|
||||||
// that do match the predicate have width equal to `1`).
|
// that do match the predicate have width equal to `1`).
|
||||||
static Optional<int> vectorWidth(Type type, TypePredicate pred) {
|
static Optional<int> vectorWidth(Type type, TypePredicate pred) {
|
||||||
|
@ -54,11 +50,17 @@ static int vectorWidth(Type type) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns vector element type. If the type is a scalar returns the argument.
|
// Returns vector element type. If the type is a scalar returns the argument.
|
||||||
static Type elementType(Type type) {
|
LLVM_ATTRIBUTE_UNUSED static Type elementType(Type type) {
|
||||||
auto vectorType = type.dyn_cast<VectorType>();
|
auto vectorType = type.dyn_cast<VectorType>();
|
||||||
return vectorType ? vectorType.getElementType() : type;
|
return vectorType ? vectorType.getElementType() : type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LLVM_ATTRIBUTE_UNUSED static bool isF32(Type type) { return type.isF32(); }
|
||||||
|
|
||||||
|
LLVM_ATTRIBUTE_UNUSED static bool isI32(Type type) {
|
||||||
|
return type.isInteger(32);
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------//
|
||||||
// Broadcast scalar types and values into vector types and values.
|
// Broadcast scalar types and values into vector types and values.
|
||||||
//----------------------------------------------------------------------------//
|
//----------------------------------------------------------------------------//
|
||||||
|
|
Loading…
Reference in New Issue