<div dir="ltr">Can you figure out the induction variable range?<br><br>If it is within [0, signed-max], then both signed and unsigned operations produce the same result, no?<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 18, 2017 at 12:22 PM, David Chisnall via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 17 Nov 2017, at 21:11, Dounia Khaldi via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> The problem is that  CmpInst::ICMP_EQ and CmpInst::ICMP_NE are neither signed nor unsigned in LLVM. Also, I did not find a way to find out if the integer operands of the CmpInst are signed or unsigned. Apparently, LLVM does not distinguish in its type system between signed and unsigned variables. So, I am not able to generate the appropriate signed or unsigned ICMP_(S|U)LT or ICMP_(S|U)GT.<br>
<br>
</span>In what way would you expect a signed and unsigned integer to differ in equality comparison?  Two integers are equal if they have the same bit pattern, they are not equal if they do not.  If you want help in constructing a signed and unsigned notion of equality then you’ll first have to define what you want it to mean, or you are unlikely to find anyone able to help.<br>
<br>
David<br>
<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><br></div>