[Mlir-commits] [mlir] [mlir][ArmSME] Use liveness information in the tile allocator (PR #90448)
    Cullen Rhodes 
    llvmlistbot at llvm.org
       
    Tue Apr 30 03:48:52 PDT 2024
    
    
  
================
@@ -137,172 +129,510 @@ static ArrayRef<TileMask> getMasks(ArmSMETileType type) {
   }
 }
 
-/// Allocates and returns a tile ID. Returns an error if there are no tiles
-/// left.
-static FailureOr<unsigned> allocateTileId(ArmSMETileType tileType,
-                                          TileMask &tilesInUse) {
-  auto masks = getMasks(tileType);
-  for (auto [tileId, tileMask] : llvm::enumerate(masks)) {
-    if ((tilesInUse & tileMask) == TileMask::kNone) {
-      tilesInUse |= tileMask;
-      return tileId;
+class TileAllocator {
+public:
+  /// Allocates and returns a tile ID.
----------------
c-rhodes wrote:
```suggestion
  /// Allocates and returns a tile ID. Returns failure if there are no tiles left.
```
https://github.com/llvm/llvm-project/pull/90448
    
    
More information about the Mlir-commits
mailing list