Compiling CIRCT with standard LLVM and MLIR packages (original) (raw)

Hi,

I’m involved in the development of a research compiler that is based on the conventional LLVM and MLIR packages. Currently, we have a dependency on CIRCT where I have created a version that compiles against the standard LLVM/MLIR-16 packages.

The 16 version can be found here if anyone is interested in it:
https://github.com/EECS-NTNU/circt/tree/mlir-16

We are now looking into porting the compiler to LLVM/MLIR-17, which causes issues, as a new CIRCT version that compiles with the v17 set of packages has to be created. I’ve made a new attempt at this, but currently duplicated PortList definitions get generated, but manual removal of these makes it build and all the tests to pass. However, there are still some issues as it fails to link with our research compiler.

The attempted 17 version can be found here:
https://github.com/EECS-NTNU/circt/tree/mlir-17

The lack of support for building CIRCT against standard LLVM/MLIR packages raises the concern of creating dependencies on CIRCT. Therefore, we are currently considering removing this dependency.

My question to the community is, therefore, has anybody else created similar versions of CIRCT that are publically available or are there any plans by the CIRCT community to provide such versions?

I realize that there can be a lot of work maintaining such releases, and CIRCT might still be in an experimental/research phase. But I’m not asking for anything of “industrial” grade quality. I simply would like a starting point such that I don’t have to, for each new version, find a suitable CIRCT commit and try to patch it to at all compile.

/Magnus

Are you depending on MLIR co-incidental with the llvm release?

If so, there should be a circt version within a few days of that branch which builds. I think a ToT circt building with an llvm release is mostly dependent on a ToT MLIR building with an llvm release.

You should be able to take a circt snapshot close to the llvm release branch and use that. Circt synchronizes to mlir weekly. It would be a larger effort to get a ToT circt building with an older MLIR snapshot from the time of a LLVM release. So as long as you are fine with an MLIR and Circt version from the time of the llvm release, you should be good.

I think we would be happy to make a “release branch” which builds against the mlir co-incidental with the llvm release, but I don’t know that there is man power to have any newer circt development backported.

If you want to make a PR relative to an old Circt commit at the time of llvm branching which bumps mlir to the correct version, we can use that as a base.

I ended up with trying to build different CIRCT commits with the standard LLVM/MLIR packages until I found one that compiled with only minor modifications. Some tests unfortunately fails, but the firrtl dialect seems fine, which is enough for our purposes.

We don’t use the latest features, and currently do not have a need for backporting new features.