[LLVMdev] Load/Store Instruction Error
Tim Northover
t.p.northover at gmail.com
Sat Jun 7 11:39:22 PDT 2014
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.
More information about the llvm-dev
mailing list