[Mlir-commits] [mlir] [MLIR] Erase location of folded constants (PR #75415)

Mehdi Amini llvmlistbot at llvm.org
Thu Dec 14 13:27:33 PST 2023


================
@@ -154,6 +154,7 @@ bool OperationFolder::insertKnownConstant(Operation *op, Attribute constValue) {
                                  !isFolderOwnedConstant(op->getPrevNode())))
     op->moveBefore(&insertBlock->front());
 
+  op->setLoc(erasedFoldedLocation);
----------------
joker-eph wrote:

> The benefit with the latter of course is for constants that are already at the top of a block, they're unaffected.

Yes that is what I had in mind: the folder taking "ownership" of a constant, but this one never being moved.

https://github.com/llvm/llvm-project/pull/75415


More information about the Mlir-commits mailing list