[llvm-dev] RFC: Killing undef and spreading poison

Daniel Berlin via llvm-dev llvm-dev at lists.llvm.org
Tue Oct 25 15:24:19 PDT 2016


On Tue, Oct 25, 2016 at 11:16 AM, Reid Kleckner <rnk at google.com> wrote:

> On Tue, Oct 25, 2016 at 10:44 AM, Daniel Berlin via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Easier is a relative term.
>> I expect optimally choosing  which freezes to eliminate where, etc,
>>  reduces to a covering problem variant (or just straight ILP) :)
>>
>
> I think it's fine for GVN to fold them all to the same thing.
>

Right, but folding them all to the same thing may be non-optimal compared
to folding them all to different things.

For example.

%y = freeze (%x)
%z = freeze (%x)

if (%y == %z)
{
}

Folding them all to the same keeps the branch, folding them all different
gets rid of it.


> The only difference between freeze(poison) and zero is that you can use a
> pre-existing register like RBP or RSP that says constant across the
> lifetime of the function so you don't need to materialize a zero if you
> don't have one already.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161025/cefea1c9/attachment.html>


More information about the llvm-dev mailing list