[LLVMdev] Best way to get direct memory for intrinsics in tblgen?

Ryan Taylor ryta1203 at gmail.com
Mon Jun 15 07:05:40 PDT 2015


To be more specific:

We have some operators that we are currently implementing as intrinsics,
for example things like: abs, min, max, etc.....

for some code:

int a;

int food()
{
    return abs(a);
}

the corresponding operator should look something like:

abs $a, r0

however, it looks like since intrinsics are handled as 'calls', we end up
with something like:

mov $a, r0
abs r0, r0

Would it be better to make 'abs' an operator as opposed to an intrinsic, or
is it possible in LLVM to support direct mem loads/stores via intrinsics?

I realize that we could resolve this with some peephole opts, I just want
to know if there is a way in LLVM to get the 'abs $a, r0' match directly
through tblgen?

Thanks.

On Wed, Jun 10, 2015 at 8:19 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:

> What's the best way to get direct memory accesses for intrinsics via
> tblgen?
>
> We have some instructions represented as intrinsics. These instructions
> allow direct memory access, I've tried multiclasses but they won't match.
> I've also tried "def : Pat<....> but it won't recognize the complex pattern
> as a valid operand?
>
> Thanks.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150615/b46ef8f4/attachment.html>


More information about the llvm-dev mailing list