[PATCH] D136497: [Clang] support for outputs along indirect edges of asm goto

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 31 14:46:33 PDT 2022


nickdesaulniers planned changes to this revision.
nickdesaulniers added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:2867
+    for (unsigned i = 0, e = CBR->getNumIndirectDests(); i != e; ++i) {
+      assert(CBRRegResults[i].size() == ResultRegTypes.size());
+      // If we happen to share the same indirect and default dest, don't re-add
----------------
Oh, I can remove this now, I moved it into `EmitAsmStores`.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:2868-2873
+      // If we happen to share the same indirect and default dest, don't re-add
+      // stores. That was done for the default destination in the above call to
+      // EmitAsmStores.
+      llvm::BasicBlock *Succ = CBR->getIndirectDest(i);
+      if (Succ == CBR->getDefaultDest())
+        continue;
----------------
I'm not sure that I need to handle this case (of a callbr with the same indirect destination as the default destination).  That might result from optimizations, but I don't think clang can or will generate such IR.  Maybe I should turn this into an: `assert(CBR->getIndirectDest(i) != CBR->getDefaultDest(i) && "We already emitted asm stores in the default dest");`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136497/new/

https://reviews.llvm.org/D136497



More information about the cfe-commits mailing list