Liad Mordekoviz via llvm-dev
2018-Jan-21 16:33 UTC
[llvm-dev] Splitting BB pre SelectionDAG
Hi everyone, I'm faily new to LLVM, I'm working on a new backend. In my backend, one of the requirements is to split a BB on every call, I considered putting some kind of pseudo instruction using the TargetLowering::LowerCall function. Before going said path, I was wondering if there is some way to split the BB before the SelectionDAG is generated, this way the call instruction would be last in the SelectionDAG would be last and won't get deleted during the combining stage. Thanks in advance, Liad. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180121/faec1422/attachment.html>
Matt Arsenault via llvm-dev
2018-Jan-21 17:40 UTC
[llvm-dev] Splitting BB pre SelectionDAG
> On Jan 21, 2018, at 11:33, Liad Mordekoviz via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Before going said path, I was wondering if there is some way to split the BB before the SelectionDAG is generated, this way the call instruction would be last in the SelectionDAG would be last and won't get deleted during the combining stage. >You can’t/shouldn’t do this before SelectionDAG, since an operation could be legalized using a call when there was no call present in the original IR. Additionally, you would still need to separate the code you emit for the call setup sequence. -Matt