It seems wrong<span></span> to prohibit hoisting an instruction which neither traps nor has side effects.<div><br></div><div>My gut feeling is that the bug lies elsewhere. Perhaps the hoisting allows another transform to happen?</div><div><br>On Thursday, October 20, 2016, Davide Italiano <<a href="mailto:dccitaliano@gmail.com">dccitaliano@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">davide added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D25847#575957" target="_blank">https://reviews.llvm.org/<wbr>D25847#575957</a>, @efriedma wrote:<br>
<br>
> "A shift is undefined if the second operand is equal or larger than the number of bits in the first operand."<br>
><br>
> Yes... but that's not undefined behavior.  LangRef just says "the result is undefined".<br>
<br>
<br>
hmm, does this change the fact that we don't want to speculate in this case or you're commenting on the wording?<br>
<br>
<br>
<a href="https://reviews.llvm.org/D25847" target="_blank">https://reviews.llvm.org/<wbr>D25847</a><br>
<br>
<br>
<br>
</blockquote></div>