[Mlir-commits] [mlir] [mlir][Transforms] --remove-dead-values: keep values used in public function calls (PR #83249)

Mehdi Amini llvmlistbot at llvm.org
Wed Feb 28 15:36:10 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;
----------------
joker-eph wrote:

How does this work transitively though?

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


More information about the Mlir-commits mailing list