[Mlir-commits] [mlir] [MLIR] Fuse locations of hoisted / merged constants (PR #74670)
Mehdi Amini
llvmlistbot at llvm.org
Wed Dec 6 20:44:23 PST 2023
================
@@ -264,8 +303,10 @@ OperationFolder::processFoldResults(Operation *op,
// with. This may not automatically happen if the operation being folded
// was inserted before the constant within the insertion block.
Block *opBlock = op->getBlock();
- if (opBlock == constOp->getBlock() && &opBlock->front() != constOp)
+ if (opBlock == constOp->getBlock() && &opBlock->front() != constOp) {
constOp->moveBefore(&opBlock->front());
+ appendFoldedLocation(constOp, opBlock->getParent()->getLoc());
----------------
joker-eph wrote:
Same as before, I don't think this makes sense to me.
https://github.com/llvm/llvm-project/pull/74670
More information about the Mlir-commits
mailing list