Skip to content

Commit 4a63ec9

Browse files
AlexAUTneildharantiagainst
authored andcommitted
[Backend] Bump LLVM to 2eb709b95d8f (triton-lang#9264)
Bumps LLVM to `2eb709b95d8f` to consume 2 fixes related to `gfx1250`: - llvm/llvm-project#176206 - llvm/llvm-project#176355 --------- Co-authored-by: neildhar <neildhar@users.noreply.github.com> Co-authored-by: Lei Zhang <antiagainst@gmail.com>
1 parent 31b9d31 commit 4a63ec9

13 files changed

Lines changed: 67 additions & 27 deletions

File tree

cmake/llvm-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0729a74e66aeeb7a9839d80bfd64fc49b2e69f52
1+
2eb709b95d8f521aa15401e159fac0729d56a677

include/triton/Analysis/Alias.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class SharedMemoryAliasAnalysis
9292

9393
void visitNonControlFlowArguments(
9494
Operation *op, const RegionSuccessor &successor,
95+
ValueRange successorInputs,
9596
ArrayRef<dataflow::Lattice<AliasInfo> *> argLattices,
9697
unsigned firstIndex) override;
9798
};

include/triton/Dialect/TritonGPU/IR/TritonGPUOps.td

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def TTG_GlobalScratchAllocOp : TTG_Op<"global_scratch_alloc"> {
454454

455455
def TTG_WarpSpecializeOp : TTG_Op<"warp_specialize", [
456456
RecursiveMemoryEffects, RecursivelySpeculatable, AsyncRegions,
457-
DeclareOpInterfaceMethods<RegionBranchOpInterface>
457+
DeclareOpInterfaceMethods<RegionBranchOpInterface, ["getSuccessorInputs"]>
458458
]> {
459459
let summary = "asynchronously execute code on multiple warpgroups";
460460
let description = [{
@@ -527,10 +527,13 @@ def TTG_WarpSpecializeOp : TTG_Op<"warp_specialize", [
527527
let hasCanonicalizeMethod = 1;
528528
}
529529

530-
def TTG_WarpSpecializePartitionsOp : TTG_Op<"warp_specialize.partitions", [
531-
IsolatedFromAbove, RecursiveMemoryEffects, RecursivelySpeculatable,
532-
Terminator, HasParent<"WarpSpecializeOp">
533-
]> {
530+
def TTG_WarpSpecializePartitionsOp
531+
: TTG_Op<"warp_specialize.partitions",
532+
[IsolatedFromAbove, RecursiveMemoryEffects,
533+
RecursivelySpeculatable, Terminator,
534+
HasParent<"WarpSpecializeOp">,
535+
DeclareOpInterfaceMethods<
536+
RegionBranchOpInterface, ["getSuccessorInputs"]>]> {
534537
let summary = "container op for `ttg.warp_specialize`";
535538
let description = [{
536539
Because MLIR requires entire operations be isolated from above, this op

lib/Analysis/Alias.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ LogicalResult SharedMemoryAliasAnalysis::visitOperation(
6060

6161
void SharedMemoryAliasAnalysis::visitNonControlFlowArguments(
6262
Operation *op, const RegionSuccessor &successor,
63+
ValueRange successorInputs,
6364
ArrayRef<dataflow::Lattice<AliasInfo> *> argLattices, unsigned firstIndex) {
6465
auto wsOp = dyn_cast<triton::gpu::WarpSpecializePartitionsOp>(op);
6566
if (!wsOp) {
6667
setAllToEntryStates(argLattices.take_front(firstIndex));
6768
setAllToEntryStates(argLattices.drop_front(
68-
firstIndex + successor.getSuccessorInputs().size()));
69+
firstIndex + successorInputs.size()));
6970
return;
7071
}
7172

lib/Analysis/AxisInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class AxisInfoAnalysis : public dataflow::SparseForwardDataFlowAnalysis<
146146

147147
void visitNonControlFlowArguments(
148148
Operation *op, const RegionSuccessor &successor,
149+
ValueRange successorInputs,
149150
ArrayRef<dataflow::Lattice<AxisInfo> *> argLattices,
150151
unsigned firstIndex) override {
151152
if (auto forOp = dyn_cast<scf::ForOp>(op)) {
@@ -154,8 +155,8 @@ class AxisInfoAnalysis : public dataflow::SparseForwardDataFlowAnalysis<
154155
visitWarpSpecializeExplicitCaptures(ws, successor, argLattices);
155156
} else {
156157
setAllToEntryStates(argLattices.take_front(firstIndex));
157-
setAllToEntryStates(argLattices.drop_front(
158-
firstIndex + successor.getSuccessorInputs().size()));
158+
setAllToEntryStates(
159+
argLattices.drop_front(firstIndex + successorInputs.size()));
159160
}
160161
}
161162

lib/Dialect/TritonGPU/IR/Ops.cpp

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -929,9 +929,30 @@ void WarpSpecializeOp::getSuccessorRegions(
929929
return;
930930
}
931931
// And the default region branches transparently back to the parent.
932-
assert(src.getTerminatorPredecessorOrNull()->getParentRegion() ==
933-
&getDefaultRegion());
934-
successors.push_back(RegionSuccessor(getOperation(), getResults()));
932+
if (src.getTerminatorPredecessorOrNull()->getParentRegion() ==
933+
&getDefaultRegion())
934+
successors.push_back(RegionSuccessor::parent());
935+
}
936+
937+
ValueRange WarpSpecializeOp::getSuccessorInputs(RegionSuccessor successor) {
938+
// When returning to parent, the successor inputs are the op results.
939+
return successor.isParent() ? getResults() : ValueRange();
940+
}
941+
942+
void WarpSpecializePartitionsOp::getSuccessorRegions(
943+
RegionBranchPoint src, SmallVectorImpl<RegionSuccessor> &successors) {
944+
// The parent branches to each of the partition regions, but nothing flows out
945+
// of the partition regions.
946+
if (src.isParent())
947+
for (Region &region : getPartitionRegions())
948+
successors.emplace_back(&region);
949+
}
950+
951+
ValueRange
952+
WarpSpecializePartitionsOp::getSuccessorInputs(RegionSuccessor successor) {
953+
// The successor inputs are the block arguments of the partition region.
954+
Region *region = successor.getSuccessor();
955+
return region ? region->getArguments() : ValueRange();
935956
}
936957

937958
LogicalResult WarpSpecializeOp::verify() {

lib/Dialect/TritonGPU/Transforms/WarpSpecialization/OptimizePartitionWarps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void OptimizePartitionWarps::runOnOperation() {
305305
// The module must be directly nested under the current op for `runPipeline`
306306
// to work.
307307
getOperation().push_back(container);
308-
auto remove = llvm::make_scope_exit([&] { container->remove(); });
308+
llvm::scope_exit remove([&] { container->remove(); });
309309
return runPipeline(pm, container);
310310
};
311311

lib/Instrumentation/PrintLoadStoreMemSpaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "llvm/IR/Module.h"
22
#include "llvm/IR/PassManager.h"
33
#include "llvm/Passes/PassBuilder.h"
4-
#include "llvm/Passes/PassPlugin.h"
4+
#include "llvm/Plugins/PassPlugin.h"
55
#include <map>
66

77
using namespace llvm;

python/src/llvm.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#include "llvm/Pass.h"
1818
#include "llvm/Passes/OptimizationLevel.h"
1919
#include "llvm/Passes/PassBuilder.h"
20-
#include "llvm/Passes/PassPlugin.h"
2120
#include "llvm/Passes/StandardInstrumentations.h"
21+
#include "llvm/Plugins/PassPlugin.h"
2222
#include "llvm/Support/CodeGen.h"
2323
#include "llvm/Support/Signals.h"
2424
#include "llvm/Support/SourceMgr.h"

test/lib/Instrumentation/GPUHello.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "llvm/IR/PassManager.h"
44
#include "llvm/Pass.h"
55
#include "llvm/Passes/PassBuilder.h"
6-
#include "llvm/Passes/PassPlugin.h"
6+
#include "llvm/Plugins/PassPlugin.h"
77
#include "llvm/Support/raw_ostream.h"
88
#include <iostream>
99
#include <vector>

0 commit comments

Comments
 (0)