[llvm-dev] How to use bugpoint for backend native code generation?

Eli Friedman via llvm-dev llvm-dev at lists.llvm.org
Mon Mar 25 17:29:31 PDT 2019


Comments inline.

From: Jie Zhou <jzhou41 at cs.rochester.edu>
Sent: Monday, March 25, 2019 5:00 PM
To: Eli Friedman <efriedma at quicinc.com>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: [EXT] Re: [llvm-dev] How to use bugpoint for backend native code generation?




On Mar 25, 2019, at 19:27, Eli Friedman <efriedma at quicinc.com<mailto:efriedma at quicinc.com>> wrote:

Currently bugpoint doesn’t support backend passes.  We didn’t have any support for serializing MachineFunctions until relatively recently, and that support still isn’t really complete.  Depending on the nature of your issue, opt-bisect-limit might be helpful; see http://llvm.org/docs/OptBisect.html<https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_OptBisect.html&d=DwMGaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=KAtyTEI8n3FritxDpKpR7rv3VjdmUs0luiVKZLb_bNI&m=N8T9xou8gKEMYjs_z4t_ajAvxVNR0Gi7DSTGkmK3UMU&s=i7-oSWHTWDhAbbHVN9ADDhdRRvguklobURQzSWuFVWM&e=> .

That said, there’s probably a more straightforward way to track down your particular issue: you should be able to get a readable error message by just emitting assembly, then feeding the output to clang.  And my first guess for the cause of the problem is that your pass is running after ARMConstantIslands, which is almost never what you want.

Hi Eli,

Can you be more specific on “emitting assembly”? I know how to generate asm code from source code, but is there a way to generate native asm code after running machine function passes?

- Jie

I mean, like clang -S or llc -filetype=asm.  The “out of range pc-relative fixup value” only triggers when you’re trying to emit an object file directly (clang -c or llc -filetype=obj).

It isn’t really meaningful to generate assembly at some arbitrary point in the backend.  (You can always use dump() on a MachineFunction, but that’s not the same thing.)

-Eli

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190326/9d4961cb/attachment.html>


More information about the llvm-dev mailing list