Skip to content

Commit

Permalink
[BACKEND] Update llvm to llvm/llvm-project@56152fa377 (#4625)
Browse files Browse the repository at this point in the history
This bumps to llvm/llvm-project@56152fa377 to further
include the following fix
* llvm/llvm-project#105871

Which was fixing issues in a previous LLVM bump
* #4624
  • Loading branch information
antiagainst authored Sep 1, 2024
1 parent f42142a commit 634158b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cmake/llvm-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1115dee248e68a155001ac3712a189299d104863
56152fa377302fd8124e8be2a02dcb927a041f0a
8 changes: 4 additions & 4 deletions include/triton/Analysis/Alias.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ class SharedMemoryAliasAnalysis
ModRefResult getModRef(Operation *op, Value location);

void setToEntryState(dataflow::Lattice<AliasInfo> *lattice) override {
propagateIfChanged(
lattice, lattice->join(
AliasInfo::getPessimisticValueState(lattice->getPoint())));
propagateIfChanged(lattice,
lattice->join(AliasInfo::getPessimisticValueState(
lattice->getAnchor())));
}

/// Computes if the alloc set of the results are changed.
void
LogicalResult
visitOperation(Operation *op,
ArrayRef<const dataflow::Lattice<AliasInfo> *> operands,
ArrayRef<dataflow::Lattice<AliasInfo> *> results) override;
Expand Down
9 changes: 6 additions & 3 deletions lib/Analysis/Alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AliasInfo AliasInfo::join(const AliasInfo &lhs, const AliasInfo &rhs) {
return ret;
}

void SharedMemoryAliasAnalysis::visitOperation(
LogicalResult SharedMemoryAliasAnalysis::visitOperation(
Operation *op, ArrayRef<const dataflow::Lattice<AliasInfo> *> operands,
ArrayRef<dataflow::Lattice<AliasInfo> *> results) {
AliasInfo aliasInfo;
Expand All @@ -31,7 +31,7 @@ void SharedMemoryAliasAnalysis::visitOperation(
if (auto memdescTy = dyn_cast<triton::MemDescType>(result.getType())) {
if (!isa_and_nonnull<triton::gpu::SharedMemorySpaceAttr>(
memdescTy.getMemorySpace()))
return;
return success();
}

// Only LocalAllocOp creates a new buffer.
Expand All @@ -49,11 +49,14 @@ void SharedMemoryAliasAnalysis::visitOperation(
}

if (pessimistic) {
return setAllToEntryStates(results);
setAllToEntryStates(results);
return success();
}
// Join all lattice elements
for (auto *result : results)
propagateIfChanged(result, result->join(aliasInfo));

return success();
}

AliasResult SharedMemoryAliasAnalysis::alias(Value lhs, Value rhs) {
Expand Down
20 changes: 12 additions & 8 deletions lib/Analysis/AxisInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ class AxisInfoAnalysis : public dataflow::SparseForwardDataFlowAnalysis<

void setToEntryState(dataflow::Lattice<AxisInfo> *lattice) override {
propagateIfChanged(
lattice,
lattice->join(AxisInfo::getPessimisticValueState(lattice->getPoint())));
lattice, lattice->join(
AxisInfo::getPessimisticValueState(lattice->getAnchor())));
}

void visitNonControlFlowArguments(
Expand All @@ -195,9 +195,10 @@ class AxisInfoAnalysis : public dataflow::SparseForwardDataFlowAnalysis<
dataflow::Lattice<AxisInfo>>::getLatticeElement;
using FuncAxisInfoMapT = DenseMap<FunctionOpInterface, AxisInfo>;

void visitOperation(Operation *op,
ArrayRef<const dataflow::Lattice<AxisInfo> *> operands,
ArrayRef<dataflow::Lattice<AxisInfo> *> results) override;
LogicalResult
visitOperation(Operation *op,
ArrayRef<const dataflow::Lattice<AxisInfo> *> operands,
ArrayRef<dataflow::Lattice<AxisInfo> *> results) override;
void
visitForOpInductionVar(scf::ForOp op,
ArrayRef<dataflow::Lattice<AxisInfo> *> argLattices);
Expand Down Expand Up @@ -1039,7 +1040,7 @@ AxisInfoAnalysis::AxisInfoAnalysis(DataFlowSolver &solver)
visitors.append<LoadOpAxisInfoVisitor>();
}

void AxisInfoAnalysis::visitOperation(
LogicalResult AxisInfoAnalysis::visitOperation(
Operation *op, ArrayRef<const dataflow::Lattice<AxisInfo> *> operands,
ArrayRef<dataflow::Lattice<AxisInfo> *> results) {
// TODO: For sure not the right way to do this
Expand All @@ -1048,8 +1049,10 @@ void AxisInfoAnalysis::visitOperation(
if (op->getValue().getRank() == 0)
setToEntryState((dataflow::Lattice<AxisInfo> *)op);
AxisInfo curr = visitors.apply(op, operands);
if (curr.getRank() == 0)
return setAllToEntryStates(results);
if (curr.getRank() == 0) {
setAllToEntryStates(results);
return success();
}
// override with hint
auto newContiguity = curr.getContiguity();
auto newDivisibility = curr.getDivisibility();
Expand All @@ -1071,6 +1074,7 @@ void AxisInfoAnalysis::visitOperation(
// join all lattice elements
for (auto *result : results)
propagateIfChanged(result, result->join(curr));
return success();
}

void AxisInfoAnalysis::visitForOpInductionVar(
Expand Down
5 changes: 2 additions & 3 deletions lib/Target/LLVMIR/LLVMDIScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ struct LLVMDIScopePass : public LLVMDIScopeBase<LLVMDIScopePass> {
// the column offset
auto subprogramAttr = LLVM::DISubprogramAttr::get(
context, distinctId, compileUnitAttr, fileAttr, funcNameAttr,
funcNameAttr, fileAttr,
/*line=*/line,
/*scopeline=*/line, subprogramFlags, subroutineTypeAttr);
funcNameAttr, fileAttr, /*line=*/line, /*scopeline=*/line,
subprogramFlags, subroutineTypeAttr, /*retainNodes=*/{});
funcOp->setLoc(FusedLoc::get(context, {loc}, subprogramAttr));
}

Expand Down
2 changes: 2 additions & 0 deletions python/src/ir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "mlir/Dialect/Index/IR/IndexDialect.h"
#include "mlir/Dialect/Index/IR/IndexOps.h"
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
#include "mlir/Dialect/LLVMIR/Transforms/InlinerInterfaceImpl.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Diagnostics.h"
Expand Down Expand Up @@ -226,6 +227,7 @@ void init_triton_ir(py::module &&m) {
cf::ControlFlowDialect, LLVM::LLVMDialect>();
registerBuiltinDialectTranslation(registry);
registerLLVMDialectTranslation(registry);
mlir::LLVM::registerInlinerInterface(registry);
context.appendDialectRegistry(registry);
context.loadAllAvailableDialects();
});
Expand Down

0 comments on commit 634158b

Please sign in to comment.