File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
include/mlir/Dialect/Bufferization/IR
lib/Dialect/Bufferization/Transforms Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -19,9 +19,10 @@ namespace mlir {
19
19
// Enum class representing different hoisting kinds for the allocation
20
20
// operation
21
21
enum class HoistingKind : uint8_t {
22
- None = 0 , // No hoisting kind selected
23
- Loop = 1 << 0 , // Indicates loop hoisting kind
24
- Block = 1 << 1 // Indicates dominated block hoisting kind
22
+ None = 0 , // No hoisting kind selected
23
+ Loop = 1 << 0 , // Indicates loop hoisting kind
24
+ Block = 1 << 1 , // Indicates dominated block hoisting kind
25
+ LLVM_MARK_AS_BITMASK_ENUM (/* LargestValue = */ Block)
25
26
};
26
27
} // namespace mlir
27
28
Original file line number Diff line number Diff line change @@ -645,8 +645,7 @@ struct DefaultAllocationInterface
645
645
.getResult ();
646
646
}
647
647
static ::mlir::HoistingKind getHoistingKind () {
648
- return static_cast <HoistingKind>(static_cast <uint8_t >(HoistingKind::Loop) |
649
- static_cast <uint8_t >(HoistingKind::Block));
648
+ return HoistingKind::Loop | HoistingKind::Block;
650
649
}
651
650
static ::std::optional<::mlir::Operation *>
652
651
buildPromotedAlloc (OpBuilder &builder, Value alloc) {
Original file line number Diff line number Diff line change @@ -44,16 +44,16 @@ static bool isKnownControlFlowInterface(Operation *op) {
44
44
// / and it supports the dominate block hoisting.
45
45
static bool allowAllocDominateBlockHoisting (Operation *op) {
46
46
auto allocOp = dyn_cast<AllocationOpInterface>(op);
47
- return allocOp && ( static_cast < uint8_t >(allocOp. getHoistingKind ()) &
48
- static_cast <uint8_t >(HoistingKind::Block) );
47
+ return allocOp &&
48
+ static_cast <uint8_t >(allocOp. getHoistingKind () & HoistingKind::Block);
49
49
}
50
50
51
51
// / Returns true if the given operation implements the AllocationOpInterface
52
52
// / and it supports the loop hoisting.
53
53
static bool allowAllocLoopHoisting (Operation *op) {
54
54
auto allocOp = dyn_cast<AllocationOpInterface>(op);
55
- return allocOp && ( static_cast < uint8_t >(allocOp. getHoistingKind ()) &
56
- static_cast <uint8_t >(HoistingKind::Loop) );
55
+ return allocOp &&
56
+ static_cast <uint8_t >(allocOp. getHoistingKind () & HoistingKind::Loop);
57
57
}
58
58
59
59
// / Check if the size of the allocation is less than the given size. The
You can’t perform that action at this time.
0 commit comments