Skip to content

[MLIR][XeGPU] Add uArch defintion for CRI - Crescent Island#191024

Merged
silee2 merged 2 commits into
llvm:mainfrom
silee2:xegpuAddCRIuArch
Apr 10, 2026
Merged

[MLIR][XeGPU] Add uArch defintion for CRI - Crescent Island#191024
silee2 merged 2 commits into
llvm:mainfrom
silee2:xegpuAddCRIuArch

Conversation

@silee2
Copy link
Copy Markdown
Contributor

@silee2 silee2 commented Apr 8, 2026

XeGPU lowering relies on uArch definition and lowering fails if a chip does not have uArch definition entry.
Add preliminary uArch definition for CRI.
This is a place holder for now and current defintion is identical to BMG.

XeGPU lowering relies on uArch definition and lowering fails if a
chip does not have uArch definition entry.
Add preliminary uArch definition for CRI.
This is a place holder for now and current defintion is
identical to BMG.
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 8, 2026

@llvm/pr-subscribers-mlir-gpu

@llvm/pr-subscribers-mlir

Author: Sang Ik Lee (silee2)

Changes

XeGPU lowering relies on uArch definition and lowering fails if a chip does not have uArch definition entry.
Add preliminary uArch definition for CRI.
This is a place holder for now and current defintion is identical to BMG.


Full diff: https://github.com/llvm/llvm-project/pull/191024.diff

1 Files Affected:

  • (modified) mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h (+30)
diff --git a/mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h b/mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h
index b36c6e3fee353..e5b38a644dd4c 100644
--- a/mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h
+++ b/mlir/include/mlir/Dialect/XeGPU/uArch/IntelGpuXe2.h
@@ -279,11 +279,41 @@ struct BMGuArch : public Xe2Plus {
   }
 };
 
+struct CRIuArch : public Xe2Plus {
+  static llvm::ArrayRef<const Instruction *> getInstructionRegistryArr() {
+    static const SubgroupMatrixMultiplyAcc dpasInst{16, 32};
+    static const Subgroup2DBlockLoadInstruction loadNdInst;
+    static const Subgroup2DBlockStoreInstruction storeNdInst;
+    static const Subgroup2DBlockPrefetchInstruction prefetchNdInst;
+    static const SpirvStoreScatterInstruction storeScatterInst;
+    static const SpirvLoadGatherInstruction loadGatherInst;
+    static const Instruction *arr[] = {&dpasInst,         &loadNdInst,
+                                       &storeNdInst,      &prefetchNdInst,
+                                       &storeScatterInst, &loadGatherInst};
+    return arr;
+  }
+
+  CRIuArch()
+      : Xe2Plus("cri",                     // archName
+                "Crescent Island Architecture", // archDescription
+                getInstructionRegistryArr(),
+                // Using bmg config as placeholder
+                // TODO: Update to actual XeCore and SharedMemory config
+                XeCoreInfo(8, SharedMemory(256 * 1024, 4), 8, 8) // xeCore
+        ) {}
+  static const uArch *getInstance() {
+    static const CRIuArch instance;
+    return reinterpret_cast<const uArch *>(&instance);
+  }
+};
+
 inline const uArch *getUArch(llvm::StringRef archName) {
   if (archName.equals_insensitive("pvc"))
     return PVCuArch::getInstance();
   if (archName.equals_insensitive("bmg"))
     return BMGuArch::getInstance();
+  if (archName.equals_insensitive("cri"))
+    return CRIuArch::getInstance();
   return nullptr;
 }
 

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

✅ With the latest revision this PR passed the C/C++ code formatter.

@silee2 silee2 requested a review from mshahneo April 9, 2026 17:12
Copy link
Copy Markdown
Contributor

@mshahneo mshahneo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@silee2 silee2 merged commit 81fee9e into llvm:main Apr 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants