[LLVMdev] variant generation question

Chris Lattner sabre at nondot.org
Fri Feb 9 19:42:52 PST 2007

On Fri, 9 Feb 2007, Scott Michel wrote:
> I would have expected four additional patterns, each with the (and $rC, $rA) 
> variant in it. But I only get the above four.
> Is this a bug or a feature? :-)

This is a feature.  They would match the same pattern, so it would just be 
generating dead code.  For the same reason, if you write something like:

(set $rd, (and $rs, 123))

you will only  get matching code for that pattern, and not for:

(set $rd, (and 123, $rs))

which is always canonicalized to the former.



More information about the llvm-dev mailing list