[llvm-dev] Adding fix-up information to an instruction created with BuildMI

Chris.Dewhurst via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 20 06:22:30 PDT 2016


I'm trying to work out how to add fix-up information to an instruction that is built with BuildMI.

The instruction is taking a local label (MBB), also created in the same piece code and needs to store its address. This address is fixed-up later in the compilation process.

Here's the essential fragment of code. This is custom lowering of an instruction (__builtin_setjmp), so I can't rely on the features provided by DAG legalization to help with fix-ups. I need to mark these instructions as needing later fix-ups here. I can't find any equivalent piece of code.

  MIB = BuildMI(*thisMBB, MI, DL, TII->get(SP::SETHIi), LabelReg)
            .addMBB(restoreMBB);
  // Need some code here to mark that a Sparc HI22 fix-up is needed on this instruction

  MIB = BuildMI(*thisMBB, MI, DL, TII->get(SP::ADDri), LabelReg)
            .addMBB(restoreMBB)
            .addReg(LabelReg);
  // Need some code here to mark that a Sparc LO10 fix-up is needed on this instruction

/ Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160420/199c71d8/attachment.html>


More information about the llvm-dev mailing list