Skip to content

Bump LLVM to 945ce1aa3d29e24c49720ae9e0bcfbac88f2defd. #8589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mikeurbach
Copy link
Contributor

Update CondBranchOp builders that now require branch weights.

This is required since llvm/llvm-project@70343c8.

@mikeurbach
Copy link
Contributor Author

I'm still seeing a compile error for FIRRTLReductions:

[3/6] Building CXX object tools/circt/lib/Dialect/FIRRTL/CMakeFiles/obj.CIRCTFIRRTLReductions.dir/FIRRTLReductions.cpp.o
FAILED: tools/circt/lib/Dialect/FIRRTL/CMakeFiles/obj.CIRCTFIRRTLReductions.dir/FIRRTLReductions.cpp.o 
/sifive/tools/clang/12.0.1/bin/clang++ -DCIRCT_INCLUDE_TESTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/scratch/verif/mikeu/circt/build/tools/circt/lib/Dialect/FIRRTL -I/scratch\
/verif/mikeu/circt/lib/Dialect/FIRRTL -I/scratch/verif/mikeu/circt/build/include -I/scratch/verif/mikeu/circt/llvm/llvm/include -I/scratch/verif/mikeu/circt/include -I/scratch/verif/mikeu/circt/build/tools/circt/include -I/scratch/verif/mikeu/circt/lib/Dialect/FIRRTL/. -\
isystem /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include -isystem /scratch/verif/mikeu/circt/build/tools/mlir/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qua\
l -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-\
unsupported -fdiagnostics-color -g -std=c++17 -fvisibility-inlines-hidden  -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/circt/lib/Dialect/FIRRTL/CMakeFiles/obj.CIRCTFIRRTLReductions.dir/FIRRTLReductions.cpp.o -MF tools/circt/lib/Dialect/FIRRTL/CMakeFiles/obj.C\
IRCTFIRRTLReductions.dir/FIRRTLReductions.cpp.o.d -o tools/circt/lib/Dialect/FIRRTL/CMakeFiles/obj.CIRCTFIRRTLReductions.dir/FIRRTLReductions.cpp.o -c /scratch/verif/mikeu/circt/lib/Dialect/FIRRTL/FIRRTLReductions.cpp
In file included from /scratch/verif/mikeu/circt/lib/Dialect/FIRRTL/FIRRTLReductions.cpp:9:
In file included from /scratch/verif/mikeu/circt/include/circt/Dialect/FIRRTL/FIRRTLReductions.h:12:
In file included from /scratch/verif/mikeu/circt/include/circt/Reduce/Reduction.h:17:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/BuiltinOps.h:16:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/Bytecode/BytecodeOpInterface.h:17:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/Bytecode/BytecodeImplementation.h:17:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/Attributes.h:12:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/AttributeSupport.h:17:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/StorageUniquerSupport.h:16:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/AttrTypeSubElements.h:19:
In file included from /scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/Support/CyclicReplacerCache.h:18:
/scratch/verif/mikeu/circt/llvm/llvm/include/llvm/ADT/DenseMap.h:505:43: error: call to deleted constructor of 'std::unique_ptr<mlir::SymbolTable>'
          ::new (&Buckets[I].getSecond()) ValueT(OtherBuckets[I].getSecond());
                                          ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/scratch/verif/mikeu/circt/llvm/llvm/include/llvm/ADT/DenseMap.h:847:20: note: in instantiation of function template specialization 'llvm::DenseMapBase<llvm::DenseMap<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>, llvm::DenseMapInfo<mlir::Operation *>, llvm::detail::DenseMapPair<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>>>, mlir::Operation *, std::unique_ptr<mlir::SymbolTable>, llvm::DenseMapInfo<mlir::Operation *>, llvm::detail::DenseMapPair<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>>>::copyFrom<llvm::DenseMap<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>, llvm::DenseMapInfo<mlir::Operation *>, llvm::detail::DenseMapPair<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>>>>' requested here
      this->BaseT::copyFrom(other);
                   ^
/scratch/verif/mikeu/circt/llvm/llvm/include/llvm/ADT/DenseMap.h:831:7: note: in instantiation of member function 'llvm::DenseMap<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>, llvm::DenseMapInfo<mlir::Operation *>, llvm::detail::DenseMapPair<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>>>::copyFrom' requested here
      copyFrom(other);
      ^
/scratch/verif/mikeu/circt/llvm/llvm/../mlir/include/mlir/IR/SymbolTable.h:283:7: note: in instantiation of member function 'llvm::DenseMap<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>, llvm::DenseMapInfo<mlir::Operation *>, llvm::detail::DenseMapPair<mlir::Operation *, std::unique_ptr<mlir::SymbolTable>>>::operator=' requested here
class SymbolTableCollection {
      ^
/sifive/tools/gcc/gcc/11.2.0/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../include/c++/11.2.0/bits/unique_ptr.h:468:7: note: 'unique_ptr' has been explicitly marked deleted here
      unique_ptr(const unique_ptr&) = delete;
      ^
1 error generated.

I'm not sure what changed here that is affecting us yet...

@mikeurbach
Copy link
Contributor Author

Maybe related to this? llvm/llvm-project@b4ded99

That's the only change I saw in SymbolTableCollection that seemed relevant.

@fabianschuiki
Copy link
Contributor

Very strange 🤔 Maybe we need to mark the SymbolCache as non-copyable, something like SymbolCache(const SymbolCache &) = delete;. Or it might be that tables = SymbolTableCollection(); assignment in there 🤔

struct SymbolCache {
SymbolTable &getSymbolTable(Operation *op) {
return tables.getSymbolTable(op);
}
SymbolTable &getNearestSymbolTable(Operation *op) {
return getSymbolTable(SymbolTable::getNearestSymbolTable(op));
}
SymbolUserMap &getSymbolUserMap(Operation *op) {
auto it = userMaps.find(op);
if (it != userMaps.end())
return it->second;
return userMaps.insert({op, SymbolUserMap(tables, op)}).first->second;
}
SymbolUserMap &getNearestSymbolUserMap(Operation *op) {
return getSymbolUserMap(SymbolTable::getNearestSymbolTable(op));
}
void clear() {
tables = SymbolTableCollection();
userMaps.clear();
}
private:
SymbolTableCollection tables;
SmallDenseMap<Operation *, SymbolUserMap, 2> userMaps;
};

@mikeurbach
Copy link
Contributor Author

Maybe we need to mark the SymbolCache as non-copyable

Yeah, I tried adding that, and the compile failed that it has no default constructor, so I added an explicit default constructor, and then it was back to square one.

Or it might be that tables = SymbolTableCollection(); assignment in there

Yeah perhaps, let me look into that.

@mikeurbach
Copy link
Contributor Author

Or it might be that tables = SymbolTableCollection(); assignment in there

Ok yep that is the smoking gun, curious why it didn't show up in the error, but that is the issue. If I remove that line, we're good.

@fabianschuiki
Copy link
Contributor

I'm wondering if that creates a copy under the hood for some reason. Maybe the following would help:

tables = std::move(SymbolTableCollection());

@mikeurbach
Copy link
Contributor Author

Yeah maybe something like that. I think we'd need tables to actually be a reference for std::move to be meaningful here, but I can look into something along these lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants