[Mlir-commits] [mlir] [uArch][XeGPU] Add XeGPU uArch definition. (PR #153706)
Rolf Morel
llvmlistbot at llvm.org
Tue Oct 7 12:53:35 PDT 2025
================
@@ -23,179 +23,167 @@
#include <tuple>
#include "mlir/IR/Types.h"
+#include "llvm/ADT/SmallVector.h"
namespace mlir {
namespace xegpu {
namespace uArch {
-// Architecture HW component hierarchy to present thread, core, socket ...
-struct uArchHierarchyComponent {
- std::string name = ""; // optional name of the hierarchy component
- // no. of lower hierarchy component it contains, e.g., for PVC XeCore it
- // contains 8 threads, so no_of_component=8
- uint32_t no_of_component;
- // Constructor
- uArchHierarchyComponent(const std::string &name, uint32_t no_of_component)
- : name(name), no_of_component(no_of_component) {}
-};
// An enum class to represent the scope of an instruction
-enum class InstructionScopeEnum { WorkItem, Subgroup, Workgroup, Cluster };
-
-// A struct to represent basic information about an instruction
-// This struct is used to represent the information about an instruction in the
-// uArch The information includes:
-// - the name of the instruction,
-// - the description of the instruction
-// - the scope of the instruction,
-//
-// The information is represented as strings
-// For example, the information about an instruction can be represented as:
-// Instruction instr = {"dpas", "Dot Product Accumulate Systolic (DPAS) is a
-// matrix multiply-add operation", "subgroup"};
+enum class InstructionScope { Lane, Subgroup, Workgroup, Cluster };
+enum class InstructionKind {
+ DPAS, // Dot Product Accumulate Systolic (DPAS) is a matrix
+ // multiply-add operation
+ // @TODO: Add more instructions as needed
+};
+llvm::StringRef toString(InstructionKind name) {
----------------
rolfmorel wrote:
Nit: would this make more sense as a method?
(Similarly, parseInstructionKind _could_ be a static method.)
Matter of taste though. If there's precedence in the codebase, please ignore this comment.
https://github.com/llvm/llvm-project/pull/153706
More information about the Mlir-commits
mailing list