Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/llvm-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f6ded0be897e2878612dd903f7e8bb85448269e5
49d5bb0ad0cb31410184c462801c5049ad671517
5 changes: 3 additions & 2 deletions lib/Dialect/TritonGPU/IR/Ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,9 @@ void WarpSpecializeOp::getSuccessorRegions(
return;
}
// And the default region branches transparently back to the parent.
assert(src.getRegionOrNull() == &getDefaultRegion());
successors.push_back(RegionSuccessor(getResults()));
assert(src.getTerminatorPredecessorOrNull()->getParentRegion() ==
&getDefaultRegion());
successors.push_back(RegionSuccessor(getOperation(), getResults()));
}

LogicalResult WarpSpecializeOp::verify() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ void cloneOpsInBlock(Block *block, SmallVector<WarpGroupBuilder> &builders,
builder.mapping.lookupOrDefault(yieldOp.getOperand(i)));
}

builder.create<scf::YieldOp>(op->getLoc(), newYieldOperands);
scf::YieldOp::create(builder, op->getLoc(), newYieldOperands);
}
} else {
assert(hasPartition(op));
Expand Down Expand Up @@ -449,7 +449,7 @@ LogicalResult triton::gpu::partitionLoop(scf::ForOp loop) {
for (auto [b, region, partition] : llvm::zip(
builders, wgOp.getPartitionRegions(), partitions.getPartitions())) {
if (!llvm::is_contained(getPartitionIds(loop), b.partitionId)) {
b.create<nvws::WarpGroupYieldOp>(wgOp.getLoc(), SmallVector<Value>{});
nvws::WarpGroupYieldOp::create(b, wgOp.getLoc(), SmallVector<Value>{});
continue;
}
auto newForOp = *region.front().getOps<scf::ForOp>().begin();
Expand Down
1 change: 0 additions & 1 deletion python/src/llvm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ createTargetMachine(llvm::Module *module, std::string proc,
bool disableLLVMOpt = mlir::triton::tools::getBoolEnv("DISABLE_LLVM_OPT");
if (enable_fp_fusion)
opt.AllowFPOpFusion = llvm::FPOpFusion::Fast;
opt.UnsafeFPMath = false;
opt.NoInfsFPMath = false;
opt.NoNaNsFPMath = true;
opt.TrapUnreachable = true;
Expand Down
4 changes: 2 additions & 2 deletions test/Conversion/tritonnvidiagpu_to_llvm.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ module attributes {"ttg.num-ctas" = 1 : i32, "ttg.num-warps" = 4 : i32, ttg.targ
// CHECK-LABEL: async_copy_mbarrier_arrive
module attributes {"ttg.num-ctas" = 1 : i32, "ttg.num-warps" = 4 : i32, ttg.target = "cuda:90", "ttg.threads-per-warp" = 32 : i32} {
tt.func public @async_copy_mbarrier_arrive(%arg0: !ttg.memdesc<1xi64, #shared, #ttg.shared_memory>) attributes { noinline = false } {
// CHECK: nvvm.cp.async.mbarrier.arrive.shared %{{.*}} : !llvm.ptr<3>
// CHECK: nvvm.cp.async.mbarrier.arrive %{{.*}} : !llvm.ptr<3>
ttng.async_copy_mbarrier_arrive %arg0 : !ttg.memdesc<1xi64, #shared, #ttg.shared_memory>
// CHECK: nvvm.cp.async.mbarrier.arrive.shared %{{.*}} {noinc = true} : !llvm.ptr<3>
// CHECK: nvvm.cp.async.mbarrier.arrive %{{.*}} {noinc = true} : !llvm.ptr<3>
ttng.async_copy_mbarrier_arrive %arg0 { noIncrement } : !ttg.memdesc<1xi64, #shared, #ttg.shared_memory>
tt.return
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/amd/include/Analysis/RangeAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct TritonIntegerRangeAnalysis : dataflow::IntegerRangeAnalysis {
/// the loop operands and all users and all users of the results of the loop.
void visitRegionSuccessors(
ProgramPoint *point, RegionBranchOpInterface branch,
RegionBranchPoint successor,
RegionSuccessor successor,
ArrayRef<dataflow::AbstractSparseLattice *> abstractLattices) override;

/// Collect all operands that participate in assumptions (see description of
Expand Down
11 changes: 6 additions & 5 deletions third_party/amd/lib/Analysis/RangeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ void TritonIntegerRangeAnalysis::initializeFuncOp(tt::FuncOp op) {

void TritonIntegerRangeAnalysis::visitRegionSuccessors(
ProgramPoint *point, RegionBranchOpInterface branch,
RegionBranchPoint successor,
RegionSuccessor successor,
ArrayRef<dataflow::AbstractSparseLattice *> abstractLattices) {
LLVM_DEBUG({
DBGS() << "Visit Region Succesors of ";
Expand Down Expand Up @@ -715,10 +715,11 @@ void TritonIntegerRangeAnalysis::visitRegionSuccessors(
if (!inputs.empty()) {
firstIndex = cast<OpResult>(inputs.front()).getResultNumber();
}
visitNonControlFlowArguments(branch,
RegionSuccessor(branch->getResults().slice(
firstIndex, inputs.size())),
lattices, firstIndex);
visitNonControlFlowArguments(
branch,
RegionSuccessor(
branch, branch->getResults().slice(firstIndex, inputs.size())),
lattices, firstIndex);
} else {
if (!inputs.empty()) {
firstIndex = cast<BlockArgument>(inputs.front()).getArgNumber();
Expand Down
4 changes: 2 additions & 2 deletions third_party/amd/lib/TritonAMDGPUToLLVM/MemoryOpToLLVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ class LocalBarrierOpConversion
// amdgpu::MemoryCounterWaitOp will lower s_waitcnt
// - s_barrier syncronizes the execution for the CTA
auto dsAttr = rewriter.getI32IntegerAttr(0);
rewriter.create<amdgpu::MemoryCounterWaitOp>(
op->getLoc(), /* load= */ nullptr, /* store= */ nullptr,
amdgpu::MemoryCounterWaitOp::create(
rewriter, op->getLoc(), /* load= */ nullptr, /* store= */ nullptr,
/* ds= */ dsAttr);
rewriter.replaceOpWithNewOp<ROCDL::SBarrierOp>(op);

Expand Down
70 changes: 0 additions & 70 deletions third_party/intel/cmake/FindSPIRVToLLVMTranslator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,76 +75,6 @@ if (NOT SPIRVToLLVMTranslator_FOUND)
if(NOT PATCH_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to apply 3388.patch to SPIRV-LLVM-Translator")
endif()

# FIXME: Don't apply patch when LLVM commit update to 6cba572.
execute_process(
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/revert_3385.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
ERROR_QUIET
RESULT_VARIABLE PATCH_RESULT
)
if(PATCH_RESULT EQUAL 0)
execute_process(
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/revert_3385.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
else()
execute_process( # Check if the patch is already applied
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/revert_3385.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
endif()
if(NOT PATCH_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to apply revert_3385.patch to SPIRV-LLVM-Translator")
endif()

# FIXME: Don't apply patch when LLVM commit update to 573ca36.
execute_process(
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/revert_3406.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
ERROR_QUIET
RESULT_VARIABLE PATCH_RESULT
)
if(PATCH_RESULT EQUAL 0)
execute_process(
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/revert_3406.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
else()
execute_process( # Check if the patch is already applied
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/revert_3406.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
endif()
if(NOT PATCH_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to apply revert_3406.patch to SPIRV-LLVM-Translator")
endif()
execute_process(
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
ERROR_QUIET
RESULT_VARIABLE PATCH_RESULT
)
if(PATCH_RESULT EQUAL 0)
execute_process(
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
else()
execute_process( # Check if the patch is already applied
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/revert_3407.patch
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
)
endif()
if(NOT PATCH_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to apply revert_3407.patch to SPIRV-LLVM-Translator")
endif()
endif()

set(SPIRVToLLVMTranslator_INCLUDE_DIR "${SPIRVToLLVMTranslator_SOURCE_DIR}/include"
Expand Down
15 changes: 0 additions & 15 deletions third_party/intel/cmake/revert_3385.patch

This file was deleted.

69 changes: 0 additions & 69 deletions third_party/intel/cmake/revert_3406.patch

This file was deleted.

66 changes: 0 additions & 66 deletions third_party/intel/cmake/revert_3407.patch

This file was deleted.

Loading
Loading