[Mlir-commits] [mlir] [mlir][emitc] Mark emitc.literal with CExpression (PR #155582)
Jacques Pienaar
llvmlistbot at llvm.org
Tue Sep 2 23:50:57 PDT 2025
================
@@ -38,7 +38,7 @@ struct FormExpressionsPass
auto matchFun = [&](Operation *op) {
if (isa<emitc::CExpressionInterface>(*op) &&
!op->getParentOfType<emitc::ExpressionOp>() &&
- op->getNumResults() == 1)
+ !isa<emitc::LiteralOp>(op) && op->getNumResults() == 1)
----------------
jpienaar wrote:
I was wondering about the ordering here, I think op->getNumResults() may be cheaper than getParentOfType (as it could keep walking until top) and even checking for interface is linear scan compared to checking if isa LiteralOp. Probably not crazy significant time wise though.
https://github.com/llvm/llvm-project/pull/155582
More information about the Mlir-commits
mailing list