Constraints

Can someone explain the Constraints system in X86*.td?

For example:

let Constraints = "$src1 = $dst"

This replaces isTwoAddress (according to svn logs), which I gather is how
two-address instructions used to be marked for X86.

Except isTwoAddress is still used in X86InstInfo.td.

So what gives? What do these two properties actually do?

                                           -Dave

Can someone explain the Constraints system in X86*.td?

For example:

let Constraints = "$src1 = $dst"

This replaces isTwoAddress (according to svn logs), which I gather is how
two-address instructions used to be marked for X86.

You're right. This is the same as isTwoAddress, just more flexible.

Except isTwoAddress is still used in X86InstInfo.td.

Because I haven't replaced all uses of isTwoAddress with constraints, that's all.

Evan

> Can someone explain the Constraints system in X86*.td?
>
> For example:
>
> let Constraints = "$src1 = $dst"
>
> This replaces isTwoAddress (according to svn logs), which I gather
> is how
> two-address instructions used to be marked for X86.

You're right. This is the same as isTwoAddress, just more flexible.

Ok, but what are the implications for the rest of llvm? What does this
constrait say to later phases? Is it a requirement that all two-address
instructions have this constraint or does it just enable more optimization?
That is, is functional correctness tied to using this constraint?

> Except isTwoAddress is still used in X86InstInfo.td.

Because I haven't replaced all uses of isTwoAddress with constraints,
that's all.

Gotcha. Thanks.

                                                -Dave

Can someone explain the Constraints system in X86*.td?

For example:

let Constraints = "$src1 = $dst"

This replaces isTwoAddress (according to svn logs), which I gather
is how
two-address instructions used to be marked for X86.

You're right. This is the same as isTwoAddress, just more flexible.

Ok, but what are the implications for the rest of llvm? What does this
constrait say to later phases? Is it a requirement that all two-address
instructions have this constraint or does it just enable more optimization?

It specify the two-address property. So two-address and later passes will honor the constraint. It's more a requirement rather than enabling more optimizations.

Evan