[PATCH] D62555: [TailDuplicator] prevent tail duplication for INLINEASM_BR
Nick Desaulniers via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 15:39:29 PDT 2019
nickdesaulniers added a comment.
> Otherwise, conservatively do not allow INLINEASM_BR to be predicable. (I'm leaning more towards this, since such machinery would be rewriting the inline asm the user specified).
So I have a patch in hand that basically does this. When I then try to build an allyesconfig arm kernel, I get a failure in a different translation unit for a `BL` instruction. It seems that `BL` is not considered `isUncondBranchOpcode()` in `llvm/lib/Target/ARM/ARMBaseInstrInfo.h`. Looking at its `def` in `llvm/lib/Target/ARM/ARMInstrInfo.td`, `BL` seems defined differently than `Bcc` (for instance) causing `llvm::getMatchingCondBranchOpcode()` to choke. I'm not sure if this is worth pursuing at this point.
> The second issue which was first observed with Release builds is that TailDuplicator was leaving behind references to removed branches for INLINEASM_BR.
This is actually IfConverter (which only does transforms based on patterns from TailDuplicator, which is why the current patch as written works; block TailDuplicator then //IfConverter// can't mess up). I'm going to try now to see if I can find where this is going wrong; I think if we don't predicate MachineInstr`s when `isInlineAsm`, then don't remove address taken MachineBasicBlocks, that might be the ultimate solution.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62555/new/
https://reviews.llvm.org/D62555
More information about the llvm-commits
mailing list