<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 8, 2016 at 12:48 PM, Friedman, Eli via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    It's possible we could tweak your model a little to make poison a
    bit-wise property, so an i32 can be partially poison, sort of like
    how undef currently works.  Then we can consider on an operation by
    operation basis how it propagates poison bits.  In other words,
    let's pretend every Value has type <n x i1> for the purpose of
    poison until we actually do math on it.<br>
    <br>
    Under this model, we can say a non-vector icmp with any poisoned bit
    as input returns poison, but a load produces a value whose bits are
    poison only where the input is poison.  We can say "freeze(load
    i32)" does the same thing as "bitcast(freeze(load <32 x i1>)
    to i32)".  We can define lshr and trunc to allow merging two i8
    loads into an i16 load.  Not sure what the rules for arithmetic and
    logic operations would be off the top of my head; there are some
    tradeoffs here.<br></div></blockquote><div>This seems ok for bit-wise operations but what about more complex ones like multiplication?</div><div>We probably want to keep the fact that multiplying by a power of two is equivalent to a shift, no?</div><div><br></div><div>Anyway, I didn't follow the discussion. I understand that we want an undef with a proper semantic (it can be substituted by any value but only at it's definition and not at every use).</div><div>But I don't understand what is the semantic of poison, isn't poison a value that we can assume never arise? That is, if there are necessary constraints on the input of a function for poison to not happen,</div><div>then we can safely assume those constraints.</div><div><br></div><div>I don't understand why we want to mixup the semantic of poison and undef.</div><div>But then, I am lost anyway, you can safely disregard my comments on the subject. :-)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
    I'm not sure this is the right approach (this model is more
    complicated, and we probably lose a bit of optimization power in
    some cases), but it's definitely nicer from the perspective of SROA
    and GVN.<span class=""><br>
    <br>
    -Eli<br>
    <pre class="m_-7228629929245366965moz-signature" cols="72">-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
  </span></div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br></blockquote></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b>Alexandre Isoard</b><br></div></div>
</div></div>