Skip to content

Commit 52491a4

Browse files
Merge OpenAI Triton commit 407b8a3 (#5227)
This PR change the Triton base from 748a47e to 407b8a3 (Sep 24). Pass rate: 97.26%
2 parents ecc2808 + bfe5532 commit 52491a4

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)