File tree Expand file tree Collapse file tree 3 files changed +231
-195
lines changed
lib/Dialect/TritonInstrument Expand file tree Collapse file tree 3 files changed +231
-195
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,21 @@ bool canAllocBeInstrumented(Operation *op) {
134134}
135135
136136// Interpret local_allocs that are used in ttg.memdesc_index as multibuffered
137- bool isMultiBuffered (Operation *op) {
138- return llvm::any_of (op->getUsers (), [](Operation *user) {
139- return isa<MemDescIndexOp>(user);
140- });
137+ bool isMultiBuffered (Value v) {
138+ for (auto &use : v.getUses ()) {
139+ if (isa<MemDescIndexOp>(use.getOwner ())) {
140+ return true ;
141+ }
142+ if (auto wsOp = dyn_cast<WarpSpecializeOp>(use.getOwner ())) {
143+ int opNumber = use.getOperandNumber ();
144+ for (Region *region : wsOp.getPartitionRegions ()) {
145+ if (isMultiBuffered (region->getArguments ()[opNumber])) {
146+ return true ;
147+ }
148+ }
149+ }
150+ }
151+ return false ;
141152}
142153
143154uint64_t getAllocationOffset (LocalAllocOp op) {
You can’t perform that action at this time.
0 commit comments