[PATCH] D87865: PR47468: Fix findPHICopyInsertPoint, so that copies aren't incorrectly inserted after an INLINEASM_BR.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 09:33:21 PDT 2020


jyknight marked 5 inline comments as done.
jyknight added inline comments.


================
Comment at: llvm/lib/CodeGen/PHIEliminationUtils.cpp:57
+    if ((EHPadSuccessor && I->isCall()) ||
+        I->getOpcode() == TargetOpcode::INLINEASM_BR) {
+      InsertPoint = I.getReverse();
----------------
void wrote:
> efriedma wrote:
> > Is it possible to have multiple INLINEASM_BR instructions in the same block?  If it is, we need to find the first one, not the last one.
> It shouldn't come to that. The `callbr` is a terminator, and an MBB with an INLINEASM_BR will have multiple successors, so there shouldn't be block merging.
Yes, both here and in SplitKit.cpp, we assume that there can only be one. (Note that this is not a _new_ assumption, it was also long the case that we assume only one invoke may be in a MBB,)

I'm not 100% happy with that, but it's definitely be the case for all MIR lowered from IR, and the blocks won't be merged so that property will be preserved.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87865



More information about the llvm-commits mailing list