-
Notifications
You must be signed in to change notification settings - Fork 42
[Polygeist][LLVM] Bye Bye Polygeist & Bump LLVM to 9d1b578 #654
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
base: main
Are you sure you want to change the base?
Conversation
murphe67
left a comment
There was a problem hiding this 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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
| mlir::Value baseAddress; | ||
| if (this->getInstToMemRefMap.count(gepInst->getPointerOperand())) { | ||
| baseAddress = this->getInstToMemRefMap[gepInst->getPointerOperand()]; | ||
| } else { | ||
| baseAddress = valueMap[gepInst->getPointerOperand()]; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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()]; |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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)) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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]?
5b8af21 to
df6f73d
Compare
This reverts commit f44acf20eeedba5ea6b02f366ed89d918eadca73.
df6f73d to
f4b41d4
Compare
Changes: