Skip to content

Commit 611f679

Browse files
committed
add load and store
1 parent 0660da5 commit 611f679

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,14 +500,21 @@ struct MemoryCounterWaitOpLowering
500500
return cast<IntegerAttr>(attr).getInt();
501501

502502
// This value will be clamped to the maximum value for the chipset.
503-
return 1024 * 1024;
503+
return 1024;
504504
};
505505
unsigned ds = getVal(adaptor.getDsAttr());
506-
unsigned load = getVal(adaptor.getLoadAttr());
507-
unsigned store = getVal(adaptor.getStoreAttr());
508506
unsigned exp = getVal(adaptor.getExpAttr());
509507

510-
unsigned vmcnt = std::min(load, store);
508+
unsigned vmcnt = 1024;
509+
Attribute load = adaptor.getLoadAttr();
510+
Attribute store = adaptor.getStoreAttr();
511+
if (load && store) {
512+
vmcnt = getVal(load) + getVal(store);
513+
} else if (load) {
514+
vmcnt = getVal(load);
515+
} else if (store) {
516+
vmcnt = getVal(store);
517+
}
511518

512519
FailureOr<unsigned> waitcnt = encodeWaitcnt(chipset, vmcnt, exp, ds);
513520
if (failed(waitcnt))

0 commit comments

Comments
 (0)