Skip to content

Commit 4a8e508

Browse files
authored
[BACKEND] Apply patches for LLVM version up to llvm/llvm-project@2bc22ea (#8707)
1 parent de3689d commit 4a8e508

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

lib/Dialect/TritonGPU/IR/Ops.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -933,8 +933,9 @@ void WarpSpecializeOp::getSuccessorRegions(
933933
return;
934934
}
935935
// And the default region branches transparently back to the parent.
936-
assert(src.getRegionOrNull() == &getDefaultRegion());
937-
successors.push_back(RegionSuccessor(getResults()));
936+
assert(src.getTerminatorPredecessorOrNull()->getParentRegion() ==
937+
&getDefaultRegion());
938+
successors.push_back(RegionSuccessor(getOperation(), getResults()));
938939
}
939940

940941
LogicalResult WarpSpecializeOp::verify() {

python/src/llvm.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ createTargetMachine(llvm::Module *module, std::string proc,
5353
bool disableLLVMOpt = mlir::triton::tools::getBoolEnv("DISABLE_LLVM_OPT");
5454
if (enable_fp_fusion)
5555
opt.AllowFPOpFusion = llvm::FPOpFusion::Fast;
56-
opt.UnsafeFPMath = false;
5756
opt.NoInfsFPMath = false;
5857
opt.NoNaNsFPMath = true;
5958
opt.TrapUnreachable = true;

third_party/amd/include/Analysis/RangeAnalysis.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct TritonIntegerRangeAnalysis : dataflow::IntegerRangeAnalysis {
8484
/// the loop operands and all users and all users of the results of the loop.
8585
void visitRegionSuccessors(
8686
ProgramPoint *point, RegionBranchOpInterface branch,
87-
RegionBranchPoint successor,
87+
RegionSuccessor successor,
8888
ArrayRef<dataflow::AbstractSparseLattice *> abstractLattices) override;
8989

9090
/// Collect all operands that participate in assumptions (see description of

third_party/amd/lib/Analysis/RangeAnalysis.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ void TritonIntegerRangeAnalysis::initializeFuncOp(tt::FuncOp op) {
702702

703703
void TritonIntegerRangeAnalysis::visitRegionSuccessors(
704704
ProgramPoint *point, RegionBranchOpInterface branch,
705-
RegionBranchPoint successor,
705+
RegionSuccessor successor,
706706
ArrayRef<dataflow::AbstractSparseLattice *> abstractLattices) {
707707
LLVM_DEBUG({
708708
DBGS() << "Visit Region Succesors of ";
@@ -787,10 +787,11 @@ void TritonIntegerRangeAnalysis::visitRegionSuccessors(
787787
if (!inputs.empty()) {
788788
firstIndex = cast<OpResult>(inputs.front()).getResultNumber();
789789
}
790-
visitNonControlFlowArguments(branch,
791-
RegionSuccessor(branch->getResults().slice(
792-
firstIndex, inputs.size())),
793-
lattices, firstIndex);
790+
visitNonControlFlowArguments(
791+
branch,
792+
RegionSuccessor(
793+
branch, branch->getResults().slice(firstIndex, inputs.size())),
794+
lattices, firstIndex);
794795
} else {
795796
if (!inputs.empty()) {
796797
firstIndex = cast<BlockArgument>(inputs.front()).getArgNumber();

third_party/nvidia/lib/TritonNVIDIAGPUToLLVM/ElementwiseOpToLLVM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ struct ExpOpConversionApprox
650650
Value prod = b.fmul(f32_ty, operands[0][0], b.f32_val(log2e));
651651

652652
Type resultTy = operands[0][0].getType();
653-
StringRef name = "llvm.nvvm.ex2.approx.f";
653+
StringRef name = "llvm.nvvm.ex2.approx.f32";
654654
auto callOp =
655655
LLVM::createLLVMIntrinsicCallOp(rewriter, loc, name, resultTy, {prod});
656656
return {callOp.getResult(0)};

0 commit comments

Comments
 (0)