Skip to content

Commit bfe5532

Browse files
Merge commit '407b8a3b535067beb5f0c5b2da2c09fd49609867'
2 parents 0839db8 + 407b8a3 commit bfe5532

File tree

3 files changed

+231
-195
lines changed

3 files changed

+231
-195
lines changed

lib/Dialect/TritonInstrument/IR/Utility.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff 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

143154
uint64_t getAllocationOffset(LocalAllocOp op) {

0 commit comments

Comments
 (0)