Skip to content

Conversation

@Jiahui17
Copy link
Member

@Jiahui17 Jiahui17 commented Nov 22, 2025

Changes:

  • Removed Polygeist
  • Bumped LLVM to 9d1b578
  • Fixed many deprecated MLIR API usages
  • CfToHandshake: When constructing MC/LSQ, use the merge outputs directly rather than the block arguments for GAs and the number of stores.
  • translate-llvm-to-std: Now directly translate MD arrays into 1D, GEPs to adds and muls.
  • Disabled check-dynamatic: I think these tests are very artificial and do not provide any real values (plus I don't know how to fix them with all the changes...)

@Jiahui17 Jiahui17 added the critical Touches on core Dynamatic functionnality label Nov 22, 2025
@Jiahui17 Jiahui17 changed the title [Polygeist] Bye Bye Polygeist & Bump LLVM to 9d1b578 [Polygeist][LLVM] Bye Bye Polygeist & Bump LLVM to 9d1b578 Nov 22, 2025
Copy link
Collaborator

@murphe67 murphe67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, very exciting!

Left comments anywhere I didnt understand, but the logic looks correct, so I think we can approve already anyway :)

if (inst->mayReadOrWriteMemory()) {

// NOTE (@Jiahui17: the call `memcpy` in the main function might be
// analyzed here and trigger an assertion error).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean?

Comment on lines +550 to +554
mlir::Value baseAddress;
if (this->getInstToMemRefMap.count(gepInst->getPointerOperand())) {
baseAddress = this->getInstToMemRefMap[gepInst->getPointerOperand()];
} else {
baseAddress = valueMap[gepInst->getPointerOperand()];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slightly confused here of the two dicts

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first one checks if a pointer if in a map to memrefs, otherwise the pointer is mapped to a value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does that mean?


#if 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

point of git is we can pull old code easily from old versions without keeping it in the file, should we kill this?

}
this->getInstToMemRefMap[gepInst] = baseAddress;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the pointers wasnt in the memref map, it gets added to it? do we need this memref map check then here? or can we always pull from value?

auto memrefAndIndices = this->gepInstToMemRefAndIndicesMap[instAddr];
memref = memrefAndIndices.first;
indices = memrefAndIndices.second;
mlir::Value index = valueMap[loadInst->getPointerOperand()];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be inside the if statement?


mlir::Value indexOp;

if (getInstToMemRefMap.count(instAddr)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess comment here of the two types of memrefs a lot can get? dont understand a load without a memref....


mlir::Value indexOp;

if (getInstToMemRefMap.count(instAddr)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here as on load

///
/// We use this data structure to store the mapping between the GEP
/// instruction and the corresponding base address.
mlir::DenseMap<llvm::Value *, mlir::Value> getInstToMemRefMap;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so if there is no gep instruction before a load, then we use value?

like pointer deref or a a[0]?

@Jiahui17 Jiahui17 force-pushed the feature/jiahui/bye-polygeist branch 2 times, most recently from 5b8af21 to df6f73d Compare November 27, 2025 11:47
@Jiahui17 Jiahui17 marked this pull request as draft November 27, 2025 14:56
@Jiahui17 Jiahui17 marked this pull request as ready for review November 27, 2025 14:56
@Jiahui17 Jiahui17 force-pushed the feature/jiahui/bye-polygeist branch from df6f73d to f4b41d4 Compare November 27, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

critical Touches on core Dynamatic functionnality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants