Skip to content

Commit

Permalink
[BACKEND] Update to llvm/llvm-project@b5cc222d7429 (#4927)
Browse files Browse the repository at this point in the history
Upgrading LLVM to pick up the following changes for AMD backend:
* llvm/llvm-project#112237

Changes made:
- changed the signature of `visit` method in `ConstantAnalysis` - i.e.,
  accepts an instance of the `ProgramPoint`.
- updated calls to `getLatticeElementFor` -i.e., accepts an instance of
  the `ProgramPoint`.
- added the required last parameter to `LLVM::DISubprogramAttr::get` -
  i.e., an empty `annotations`.
  • Loading branch information
ravil-mobile authored Oct 16, 2024
1 parent d207894 commit 185299e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ jobs:
cp -r /usr/aarch64-linux-gnu/lib ./arm-sysroot
cp -r /usr/aarch64-linux-gnu/include ./arm-sysroot
LINKER=$(pwd)/arm-sysroot/lib/ld-linux-aarch64.so.1
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-defaults/gcc-aarch64-linux-gnu_14.1.0-2_amd64.deb
dpkg-deb -x gcc-aarch64-linux-gnu_14.1.0-2_amd64.deb ./arm-sysroot
wget http://ftp.de.debian.org/debian/pool/main/g/gcc-defaults/gcc-aarch64-linux-gnu_14.2.0-1_amd64.deb
dpkg-deb -x gcc-aarch64-linux-gnu_14.2.0-1_amd64.deb ./arm-sysroot
export LD_LIBRARY_PATH=$(pwd)/arm-sysroot/lib:$LD_LIBRARY_PATH
sudo ln -s $LINKER /lib/ld-linux-aarch64.so.1
SYSROOT="$(pwd)/arm-sysroot"
Expand Down
2 changes: 1 addition & 1 deletion cmake/llvm-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
61f8a7f618901797ee8663389a29722f29216a96
b5cc222d7429fe6f18c787f633d5262fac2e676f
5 changes: 3 additions & 2 deletions lib/Analysis/AxisInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,9 @@ LogicalResult AxisInfoAnalysis::visitOperation(

void AxisInfoAnalysis::visitForOpInductionVar(
scf::ForOp op, ArrayRef<dataflow::Lattice<AxisInfo> *> argLattices) {
auto lb = getLatticeElementFor(op, op.getLowerBound())->getValue();
auto step = getLatticeElementFor(op, op.getStep())->getValue();
ProgramPoint programPoint(op);
auto lb = getLatticeElementFor(&programPoint, op.getLowerBound())->getValue();
auto step = getLatticeElementFor(&programPoint, op.getStep())->getValue();

AxisInfo::DimVectorT knownContiguity(1, 1);
AxisInfo::DimVectorT knownDivisibility(1, 1);
Expand Down
7 changes: 4 additions & 3 deletions lib/Analysis/Utility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,15 +896,16 @@ class ConstantAnalysis : public DataFlowAnalysis {

LogicalResult initialize(Operation *top) override {
WalkResult result = top->walk([&](Operation *op) {
if (failed(visit(op)))
ProgramPoint programPoint(op);
if (failed(visit(&programPoint)))
return WalkResult::interrupt();
return WalkResult::advance();
});
return success(!result.wasInterrupted());
}

LogicalResult visit(ProgramPoint point) override {
Operation *op = point.get<Operation *>();
LogicalResult visit(ProgramPoint *point) override {
Operation *op = point->getOperation();
Attribute value;
if (matchPattern(op, m_Constant(&value))) {
auto *constant = getOrCreate<dataflow::Lattice<dataflow::ConstantValue>>(
Expand Down
3 changes: 2 additions & 1 deletion lib/Target/LLVMIR/LLVMDIScope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ struct LLVMDIScopePass : public LLVMDIScopeBase<LLVMDIScopePass> {
auto subprogramAttr = LLVM::DISubprogramAttr::get(
context, distinctId, compileUnitAttr, fileAttr, funcNameAttr,
funcNameAttr, fileAttr, /*line=*/line, /*scopeline=*/line,
subprogramFlags, subroutineTypeAttr, /*retainNodes=*/{});
subprogramFlags, subroutineTypeAttr, /*retainNodes=*/{},
/*annotations=*/{});
funcOp->setLoc(FusedLoc::get(context, {loc}, subprogramAttr));
}

Expand Down

0 comments on commit 185299e

Please sign in to comment.