-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtransform_aie2.mlir
More file actions
39 lines (34 loc) · 1.82 KB
/
Copy pathtransform_aie2.mlir
File metadata and controls
39 lines (34 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2026, Advanced Micro Devices, Inc. All rights reserved.
// SPDX-License-Identifier: MIT
////////////////////////////////////////////////////////////////////////////////
// Transform Script for Vector Addition (AIE2)
// Simple elementwise add: out = a + b
// Binary op (2 inputs + 1 output). No fusion needed.
// No type casts needed (bf16/i8/i16 add is native; f32 uses bf16-emulation).
// Dtype-generic: uses @DTYPE@ and @VECTOR_SIZE@ placeholders substituted
// by the driver based on the IR element type and NPU version.
// Uses shared library sequences from transform_library.mlir (auto-injected).
////////////////////////////////////////////////////////////////////////////////
module attributes {transform.with_named_sequence} {
transform.named_sequence @__transform_main(
%arg1: !transform.any_op {transform.readonly}) {
// No Phase 1/2 for vec-add (no elementwise fusion needed)
transform.include @flatten_tile_forall failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @canonicalize_with_cse failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @pad_and_promote_binary_@DTYPE@ failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @canonicalize_with_cse failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @one_shot_bufferize failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @post_bufferize_cleanup failures(propagate)
(%arg1) : (!transform.any_op) -> ()
transform.include @vectorize_generics_at_@VECTOR_SIZE@ failures(propagate)
(%arg1) : (!transform.any_op) -> ()
%vh = transform.include @air_herd_mapping_and_vectorize
failures(propagate) (%arg1) : (!transform.any_op) -> !transform.any_op
transform.yield
}
}