[Mlir-commits] [mlir] [mlir][EmitC] Do not inline expressions used by ops with the CExpression trait (PR #93691)

Simon Camphausen llvmlistbot at llvm.org
Tue Jun 4 03:07:35 PDT 2024


================
@@ -303,7 +303,12 @@ static bool shouldBeInlined(ExpressionOp expressionOp) {
 
   // Do not inline expressions used by other expressions, as any desired
   // expression folding was taken care of by transformations.
-  return !user->getParentOfType<ExpressionOp>();
+  if (user->getParentOfType<ExpressionOp>())
+    return false;
+
+  // Do not inline expressions used by ops with the CExpression trait. If this
+  // was intended, the user could have been merged into the expression op.
+  return !user->hasTrait<OpTrait::emitc::CExpression>();
----------------
simon-camp wrote:

I think so. Removed the first check.

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


More information about the Mlir-commits mailing list