[PATCH] [AArch64] MachO large code-model: Materialize FP constants in code.

Tim Northover t.p.northover at gmail.com
Wed Dec 10 10:24:53 PST 2014


Hi Juergen,

On 9 December 2014 at 16:14, Juergen Ributzka <juergen at apple.com> wrote:
> I used a custom inserter to attach a vreg to the pseudo instruction that materializes the FP constant, because I couldn’t find a way to do it in the tblgen pattern. Do you know a trick to accomplish that?

There are a couple of things we could do, but I don't think a custom
inserter is necessary. What we're essentially doing is converting
fpimm:$imm into "(f32 (bitcast i32imm:$imm))".

I think this could be accomplished at either ISelLowering (Custom
method for ConstantFP), or ISelDAGToDAG time without needing a
pseudo-instruction like that. You might be able to do it in TableGen
if SDNodeXForms can change the type of the node, but I can't remember
whether that actually works:

def : Pat<(fpimm f32:$in), (COPY_TO_REGCLASS (MOVi32imm (XFORM_bitcast
f32:$in)), FPR32)>;

Cheers.

Tim.




More information about the llvm-commits mailing list