[Mlir-commits] [mlir] [MLIR] Fuse locations of hoisted / merged constants (PR #74670)
Mehdi Amini
llvmlistbot at llvm.org
Wed Dec 6 20:44:21 PST 2023
================
@@ -112,8 +146,10 @@ bool OperationFolder::insertKnownConstant(Operation *op, Attribute constValue) {
// If this is a constant we unique'd, we don't need to insert, but we can
// check to see if we should rehoist it.
if (isFolderOwnedConstant(op)) {
- if (&opBlock->front() != op && !isFolderOwnedConstant(op->getPrevNode()))
+ if (&opBlock->front() != op && !isFolderOwnedConstant(op->getPrevNode())) {
op->moveBefore(&opBlock->front());
+ appendFoldedLocation(op, opBlock->getParent()->getLoc());
----------------
joker-eph wrote:
Same.
https://github.com/llvm/llvm-project/pull/74670
More information about the Mlir-commits
mailing list