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

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to