[Mlir-commits] [mlir] [mlir][emitc] Deferred emission as expressions (PR #159975)

Marius Brehler llvmlistbot at llvm.org
Thu Sep 25 06:05:25 PDT 2025


================
@@ -1288,44 +1371,14 @@ CppEmitter::CppEmitter(raw_ostream &os, bool declareVariablesAtTop,
   labelInScopeCount.push(0);
 }
 
-std::string CppEmitter::getSubscriptName(emitc::SubscriptOp op) {
-  std::string out;
-  llvm::raw_string_ostream ss(out);
-  ss << getOrCreateName(op.getValue());
-  for (auto index : op.getIndices()) {
-    ss << "[" << getOrCreateName(index) << "]";
-  }
-  return out;
-}
-
-std::string CppEmitter::createMemberAccess(emitc::MemberOp op) {
-  std::string out;
-  llvm::raw_string_ostream ss(out);
-  ss << getOrCreateName(op.getOperand());
-  ss << "." << op.getMember();
-  return out;
-}
-
-std::string CppEmitter::createMemberAccess(emitc::MemberOfPtrOp op) {
-  std::string out;
-  llvm::raw_string_ostream ss(out);
-  ss << getOrCreateName(op.getOperand());
-  ss << "->" << op.getMember();
-  return out;
-}
-
-void CppEmitter::cacheDeferredOpResult(Value value, StringRef str) {
-  if (!valueMapper.count(value))
-    valueMapper.insert(value, str.str());
+void CppEmitter::setName(Value val, StringRef name) {
----------------
marbre wrote:

I don't have a strong preferrence with regards to bring back the name `cacheDeferredOpResult` but maybe we find something more descriptive than `setName`?

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


More information about the Mlir-commits mailing list