[LLVMdev] Load/Store Instruction Error

Ramin Guner webvlkn at gmail.com
Sat Jun 7 12:53:32 PDT 2014


In the first definition, I think you defined that the loaded data contains
an i32. But the second definition (Pat) is not clear.
Actually, I do not too much knowledge about Patters, PatFrags and
ComplexPatterns etc. and there is no document about them.
Some explanation will be good for me.

Thanks.


2014-06-07 21:39 GMT+03:00 Tim Northover <t.p.northover at gmail.com>:

> Hi Ramin,
>
> On 7 June 2014 09:04, Ramin Guner <webvlkn at gmail.com> wrote:
> > Error Message:
> > LDRAM: (set GPRegs:{i32:f32}:$dst, (ld:{i32:f32}
> > addr:iPTR:$src)<<P:Predicate_unindexedload>><<P:Predicate_load>>)
> > Included from
>
> Each particular instance of a pattern has to be well-typed. In this
> case you can see that LLVM can't decide whether you intended the
> pattern to be loading i32 or f32 (the "{i32:f32}" tags).
>
> So you have to explicitly pick one and annotate the type. In this case
> (and for the LD only), you'd probably end up writing something like:
>
> def LDRAM : FG1<0b000001, (outs GPRegs:$dst), (ins mem:$src), "ldram
> $dst,$src", [(set GPRegs:$dst, (i32 (load addr:$src)))]>;
> def : Pat<(f32 (load addr:$src)), (LDRAM addr:$src)>;
>
> using the second "Pat" instantiation to get the other version of the load.
>
> Cheers.
>
> Tim.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140607/d4f53ba4/attachment.html>


More information about the llvm-dev mailing list