[Polygeist][LLVM] Bye Bye Polygeist & Bump LLVM to 9d1b578#654
[Polygeist][LLVM] Bye Bye Polygeist & Bump LLVM to 9d1b578#654
Conversation
murphe67
left a comment
There was a problem hiding this comment.
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). |
| 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.
slightly confused here of the two dicts
There was a problem hiding this comment.
first one checks if a pointer if in a map to memrefs, otherwise the pointer is mapped to a value?
|
|
||
| #if 0 |
There was a problem hiding this comment.
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.
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.
should this be inside the if statement?
|
|
||
| mlir::Value indexOp; | ||
|
|
||
| if (getInstToMemRefMap.count(instAddr)) { |
There was a problem hiding this comment.
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)) { |
| /// | ||
| /// 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.
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
df6f73d to
f4b41d4
Compare
This reverts commit f44acf20eeedba5ea6b02f366ed89d918eadca73.
f4b41d4 to
6a3c114
Compare
Changes: