Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fce2b89
[mlir][RFC] Allow to skip operands type specification in ASM form
Oct 12, 2021
77d9062
Add FlatSymbolRefAttr and ArrayAttr for memory space representation (…
nikita-kud Dec 21, 2021
6d3f422
[mlir] Relax ASM parser requirements about operands Type presence
Jan 14, 2022
a4cb8d6
[mlir] Remove LIT tests affected by ASM simplification
Jan 21, 2022
7023593
Merge pull request #11 from iszilve/SymbolTableTweaks
nikita-kud Mar 14, 2023
55ffa76
Disable failed tests: #73140
nikita-kud Feb 13, 2024
cdbc3be
extend SymbolContainer semantics to SymbolUserMap
Jun 22, 2023
406ac9c
Add method getInlineBlockAndPoint for DialectInlinerInterface
nikita-kud Jan 31, 2024
dc5651d
Added f8E4M3FN and f8E5M2 support to existing QuantizedTypes (17.x) (…
AndreiFilipIntel Feb 22, 2024
144e66f
Initialize pass options using pipeline options
nikita-kud Apr 15, 2024
ee4e87e
Fix compilation issue with MSVC
jschj May 7, 2024
6eaf574
Port Ubunu-24 warning fixes to npu/release/18.x (#45)
DariaMityagina Jun 24, 2024
34a913a
Extend Quant dialect with Quantile Quantization type (#53)
sartil Aug 20, 2024
23a6af9
Extending QuantileQuantizedType with quantileType mlir::Type member (…
sartil Oct 3, 2024
a2ca591
Relax negative scales conditions in Quant Dialect (#61)
ZoranZomborat Oct 10, 2024
9d74ec8
Adding missing check in QuantileQuantizedPerAxisType::verify (#66)
sartil Oct 11, 2024
fcef848
Adding new quantileType types to mlir test (#85)
sartil Nov 19, 2024
f88bb56
Add Value back to SideEffectInterfaces
rayngun Mar 21, 2025
eb5a8ec
Revert "[mlir][Symbol] Add verification that symbol's parent is a Sym…
rayngun Mar 24, 2025
33efd4d
Fix thread handle leak on Windows (#133)
lmielick Jun 4, 2025
f44972c
EISW-130780: remove all wd flag to enable warnings when LLVM_ENABLE_W…
ShaojieZhuIntel Jun 11, 2025
836e039
EISW-176770 Fix argument parsing issue in mlir-src-sharder after comm…
sramasit Jun 27, 2025
9529786
[mlir] Expose output strategies of TimingManager (#166548)
andrey-golubev Nov 6, 2025
e8a99db
[mlir][bufferization] Support custom types at function boundaries (#1…
andrey-golubev Sep 24, 2025
970c50d
Avoid copies in getChecked (cherry-pick from upstream) (#151) (#170)
AlexandruLorinti Nov 10, 2025
cc8ea1c
[mlir][bufferization] Refine tensor-buffer compatibility checks (#167…
andrey-golubev Nov 18, 2025
e689889
[MLIR][ODS] Fully qualify namespace for mlir::Attribute in ODS genera…
BogdanDragosV Nov 21, 2025
6749243
Enable quantization for FP4 type
Jacenty-And-Intel Dec 23, 2025
04649f1
[MLIR] Forward generated OpTy::create arguments (#170012)
ricejasonf Dec 2, 2025
a2126df
[mlir][SCF] Add scf.index_switch support for populateSCFStructuralTyp…
ArtemySkrebkov Sep 24, 2025
8d12776
Enable printing newlines and indents in attribute and type printers (…
Jacenty-And-Intel Jan 5, 2026
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
10 changes: 10 additions & 0 deletions llvm/cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,16 @@ if (MSVC)

# Enable warnings
if (LLVM_ENABLE_WARNINGS)
# Remove all -wd flag to enable warnings
if (NOT CLANG_CL)
set(msvc_warning_flags
# Promoted warnings.
-w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.

# Promoted warnings to errors.
-we4238 # Promote 'nonstandard extension used : class rvalue used as lvalue' to error.
)
endif(NOT CLANG_CL)
# Put /W4 in front of all the -we flags. cl.exe doesn't care, but for
# clang-cl having /W4 after the -we flags will re-enable the warnings
# disabled by -we.
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/FunctionExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
void *StoragePtr;
size_t Size;
size_t Alignment;
} OutOfLineStorage;
} OutOfLineStorage = {};
static_assert(
sizeof(OutOfLineStorageT) <= InlineStorageSize,
"Should always use all of the out-of-line storage for inline storage!");
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1444,8 +1444,8 @@ void DWARFVerifier::verifyNameIndexAttribute(
}

if (AttrEnc.Index == dwarf::DW_IDX_parent) {
constexpr static auto AllowedForms = {dwarf::Form::DW_FORM_flag_present,
dwarf::Form::DW_FORM_ref4};
static constexpr dwarf::Form AllowedForms[] = {
dwarf::Form::DW_FORM_flag_present, dwarf::Form::DW_FORM_ref4};
if (!is_contained(AllowedForms, AttrEnc.Form)) {
ErrorCategory.Report("Unexpected NameIndex Abbreviation", [&]() {
error() << formatv(
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/Support/Windows/Threading.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ void llvm_thread_join_impl(HANDLE hThread) {
if (::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED) {
ReportLastErrorFatal("WaitForSingleObject failed");
}
if (::CloseHandle(hThread) == FALSE) {
ReportLastErrorFatal("CloseHandle failed");
}
}

void llvm_thread_detach_impl(HANDLE hThread) {
Expand Down
5 changes: 5 additions & 0 deletions mlir/docs/DefiningDialects/AttributesAndTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@ For Attributes, these methods will have the form:

- `void MyAttr::print(AsmPrinter &p) const`

It is possible to use newlines and indents in custom `print` methods.
However, multiline Types or Attributes are not recommended nor allowed in the upstream MLIR dialects.
They can be used in custom dialects to improve flexibility and readability, e.g. in cases of
multiple nested Types and Attributes.

#### Using `assemblyFormat`

Attributes and types defined in ODS with a mnemonic can define an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ struct BufferizationOptions {
std::function<LogicalResult(OpBuilder &, Location, Value, Value)>;
/// Initializer function for analysis state.
using AnalysisStateInitFn = std::function<void(AnalysisState &)>;
/// Tensor -> MemRef type converter.
/// Parameters: tensor type, memory space, func op, bufferization options
/// Tensor-like -> Buffer-like type conversion.
/// Parameters: tensor-like type, memory space, func op, bufferization options
using FunctionArgTypeConverterFn =
std::function<BaseMemRefType(TensorType, Attribute memorySpace,
std::function<BufferLikeType(TensorLikeType, Attribute memorySpace,
func::FuncOp, const BufferizationOptions &)>;
/// Tensor -> MemRef type converter.
/// Tensor -> MemRef type conversion.
/// Parameters: tensor type, memory space, bufferization options
using UnknownTypeConverterFn = std::function<BaseMemRefType(
TensorType, Attribute memorySpace, const BufferizationOptions &)>;
Expand Down Expand Up @@ -335,10 +335,12 @@ struct BufferizationOptions {
/// predictable.
void setFunctionBoundaryTypeConversion(LayoutMapOption layoutMapOption);

/// Type converter from tensors to memrefs. This type converter is used to
/// determine bufferized function argument and result types. By default, a
/// type converter that returns a memref type with a fully dynamic layout map
/// is used.
/// Type conversion from tensors to buffers. This type conversion is used to
/// determine bufferized function argument and result types.
///
/// By default, if tensor is a (builtin) tensor type, it is converted to a
/// memref type with a fully dynamic layout map; if tensor is a (generic)
/// tensor-like type, it is converted using TensorLikeType::getBufferType().
///
/// If `bufferizeFunctionBoundaries` is not set, this function isn't used.
FunctionArgTypeConverterFn functionArgTypeConverterFn = nullptr;
Expand All @@ -350,10 +352,9 @@ struct BufferizationOptions {
/// If `bufferizeFunctionBoundaries` is not set, this flag has no effect.
bool inferFunctionResultLayout = true;

/// Type converter from tensors to memrefs. This type converter is used if no
/// memref type could be inferred during bufferization. By default, a type
/// converter that returns a memref type with a fully dynamic layout map is
/// used.
/// Type conversion from tensors to memrefs. This type conversion is used if
/// no memref type could be inferred during bufferization. By default, returns
/// a memref type with a fully dynamic layout map.
UnknownTypeConverterFn unknownTypeConverterFn = nullptr;

// Use during type conversion to determine the memory space for memref based
Expand Down
20 changes: 20 additions & 0 deletions mlir/include/mlir/Dialect/Quant/IR/QuantBase.td
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,26 @@ class quant_ScalarOrTensorOf<Type etype> :
def quant_QuantizedType :
Type<CPred<"::llvm::isa<mlir::quant::QuantizedType>($_self)">, "quantized type">;

// UniformQuantizedPerAxisType
def quant_UniformQuantizedPerAxisType :
DialectType<Quant_Dialect,
CPred<"::llvm::isa<::mlir::quant::UniformQuantizedPerAxisType>($_self)">,
"UniformQuantizedPerAxisType">;

// QuantileQuantizedPerAxisType
def quant_QuantileQuantizedPerAxisType :
DialectType<Quant_Dialect,
CPred<"::llvm::isa<::mlir::quant::QuantileQuantizedPerAxisType>($_self)">,
"QuantileQuantizedPerAxisType">;

// Predicate for detecting a container or primitive of UniformQuantizedPerAxisType.
def quant_UniformQuantizedPerAxisValueType :
quant_ScalarOrTensorOf<quant_UniformQuantizedPerAxisType>;

// Predicate for detecting a container or primitive of QuantileQuantizedPerAxisType.
def quant_QuantileQuantizedPerAxisValueType :
quant_ScalarOrTensorOf<quant_QuantileQuantizedPerAxisType>;

def quant_ScalarType :
Type<Or<[
AnySignlessInteger.predicate,
Expand Down
34 changes: 33 additions & 1 deletion mlir/include/mlir/Dialect/Quant/IR/QuantDialectBytecode.td
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,37 @@ def UniformQuantizedSubChannelType
}];
}

def QuantileQuantizedType: DialectType<(type
VarInt:$flags,
Type:$storageType,
Type:$quantileType,
Type:$expressedType,
Array<DoubleAPFloatList>:$quantiles,
DoubleAPFloat:$scale,
SignedVarInt:$zeroPoint,
SignedVarInt:$storageTypeMin,
SignedVarInt:$storageTypeMax
)>;

def QuantileQuantizedPerAxisType: DialectType<(type
VarInt:$flags,
Type:$storageType,
Type:$quantileType,
Type:$expressedType,
VarInt:$quantizedDimension,
SignedVarInt:$storageTypeMin,
SignedVarInt:$storageTypeMax,
Array<DoubleAPFloatList>:$quantiles,
Array<DoubleAPFloatList>:$scales,
Array<SignedVarIntList>:$zeroPoints
)> {
// Note: builder order differs from bytecode.
let cBuilder = [{
get<$_resultType>(context, flags, storageType, quantileType, expressedType, quantiles, scales,
zeroPoints, quantizedDimension, storageTypeMin, storageTypeMax)
}];
}

/// This enum contains marker codes used to indicate which attribute is
/// currently being decoded, and how it should be decoded. The order of these
/// codes should generally be unchanged, as any changes will inevitably break
Expand All @@ -106,7 +137,8 @@ def QuantDialectTypes : DialectTypes<"Quant"> {
let elems = [ReservedOrDead, AnyQuantizedType,
AnyQuantizedTypeWithExpressedType, CalibratedQuantizedType,
UniformQuantizedType, UniformQuantizedPerAxisType,
UniformQuantizedSubChannelType];
UniformQuantizedSubChannelType,
QuantileQuantizedType, QuantileQuantizedPerAxisType];
}

#endif // QUANT_BYTECODE
Loading