Files
llvm-project/mlir/test/python/dialects/transform_x86_ext.py
Adam Siemieniuk 67ac275fee [mlir][x86] Rename x86vector to x86 (#183311)
Renames 'x86vector' dialect to 'x86'.

This is the first PR in series of cleanups around dialects targeting x86
platforms.
The new naming scheme is shorter, cleaner, and opens possibility of
integrating other x86-specific operations not strictly fitting pure
vector representation. For example, the generalization will allow for
future merger of AMX dialect into the x86 dialect to create one-stop x86
operations collection and boost discoverability.
2026-02-26 11:21:58 +01:00

41 lines
1.5 KiB
Python

# RUN: %PYTHON %s | FileCheck %s
from mlir.ir import *
from mlir.dialects import transform
from mlir.dialects.transform import x86
def run_apply_patterns(f):
with Context(), Location.unknown():
module = Module.create()
with InsertionPoint(module.body):
sequence = transform.SequenceOp(
transform.FailurePropagationMode.Propagate,
[],
transform.AnyOpType.get(),
)
with InsertionPoint(sequence.body):
apply = transform.ApplyPatternsOp(sequence.bodyTarget)
with InsertionPoint(apply.patterns):
f()
transform.YieldOp()
print("\nTEST:", f.__name__)
print(module)
return f
@run_apply_patterns
def non_configurable_patterns():
# CHECK-LABEL: TEST: non_configurable_patterns
# CHECK: apply_patterns
# CHECK: transform.apply_patterns.x86.vector_contract_to_fma
x86.ApplyVectorContractToFMAPatternsOp()
# CHECK: transform.apply_patterns.x86.vector_contract_to_packed_type_dot_product
x86.ApplyVectorContractToPackedTypeDotProductPatternsOp()
# CHECK: transform.apply_patterns.x86.vector_contract_bf16_to_fma
x86.ApplyVectorContractBF16ToFMAPatternsOp()
# CHECK: transform.apply_patterns.x86.sink_vector_producer_ops
x86.ApplySinkVectorProducerOpsPatternsOp()
# CHECK: transform.apply_patterns.x86.shuffle_vector_fma_ops
x86.ApplyShuffleVectorFMAOpsPatternsOp()