[LLVMdev] Backend optimizations

Tim Northover t.p.northover at gmail.com
Mon Jan 26 06:52:40 PST 2015


On 26 January 2015 at 06:18, mats petersson <mats at planetcatfish.com> wrote:
> From the department of ignorance and stupid suggestions: Run this
> conversion after other passes that deal with call instructions?

This is almost certainly the way to do it.

The immediate problem is probably that the jmp isn't being marked with
the usual call operands telling LLVM that it uses that
argument-marshalling registers and defines the result ones. But even
if you fix that x86's JMP is marked isTerminator, isBarrier and so on;
that means LLVM's optimisers assume it only comes at the end of a
basic block. Putting it in the middle is just wrong code waiting to
happen.

So I'd suggest either expanding a normal call in X86MCInstLower.cpp,
or creating a new call pseudo-instruction (with sensible flags) that
gets expanded there.

Cheers.

Tim.



More information about the llvm-dev mailing list