[Mlir-commits] [mlir] [mlir][Transforms] --remove-dead-values: keep values used in public function calls (PR #83249)
Artem Tyurin
llvmlistbot at llvm.org
Thu Feb 29 00:25:57 PST 2024
================
@@ -178,6 +181,12 @@ static void cleanSimpleOp(Operation *op, RunLivenessAnalysis &la) {
if (!isMemoryEffectFree(op) || hasLive(op->getResults(), la))
return;
+ for (OpOperand &use : op->getUses())
+ if (auto callOp = dyn_cast<CallOpInterface>(use.getOwner()))
+ if (auto funcOp = dyn_cast<FunctionOpInterface>(callOp.resolveCallable()))
+ if (funcOp.isPublic())
+ return;
----------------
agentcooper wrote:
I see `llvm.mlir.undef` and `spirv.Undef`. Is there a generic "undef" value that I can use here?
https://github.com/llvm/llvm-project/pull/83249
More information about the Mlir-commits
mailing list