bug 20542

Norman Rink nrink at broadcom.com
Mon Aug 18 07:05:18 PDT 2014


Hi Tim,

The comment 

"// fold !(x cc y) -> (x !cc y)"

in DAGCombiner.cpp suggests to me that the intended transformation here is

"xor (x cc y), 1" --> "(x !cc y)".

In other words, the "xor ?, 1" is treated like a "not" operation, which is blatantly wrong if the argument is wider than one bit. I might be missing something too though.

Best,

Norman


-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com] 
Sent: 18 August 2014 14:57
To: Norman Rink
Cc: llvm-commits at cs.uiuc.edu
Subject: Re: bug 20542

Hi Norman,

On 18 August 2014 14:39, Norman Rink <nrink at broadcom.com> wrote:
> Emailing patch as requested by Nick Lewycky (including test case).

This looks too conservative to me. An iN setcc-like node is going to
return the getBooleanContents of the target. If this is ZeroOrOne then
the transformation is correct. If it's ZeroOrNegativeOne then we want
to look for an xor with -1 instead of 1, but the idea behind the
transformation is still OK.

Or am I missing something?

Cheers.

Tim.




More information about the llvm-commits mailing list