<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Nov 16, 2013 at 3:39 PM, Kay Tiong Khoo <span dir="ltr"><<a href="mailto:kkhoo@perfwizard.com" target="_blank">kkhoo@perfwizard.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>I need to read up on how nsw would make this different, but I see your point about the shift:<br>
</div></div></div></div></blockquote><div> </div><div>If the nsw flag is set, we can assume the sign bit isn't affected and apply the simplification.<br></div><div>If the nuw flag is set, we can assume no bits are shifted out and apply the simplification if the comparison is unsigned.<br>
</div>If no flag is set (and no flag is settable), then I don't think there's anything to be done.<br></div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div><div><div><br>  %bf.result.shl = shl i8 %bf.value, 5<br>  %bf.result.ashr = ashr i8 %bf.result.shl, 5<br>
<br></div>This should have splatted the sign bit across the upper 5 bits of the char, so the subsequent compare:<br> %cmp = icmp slt i32 %bf.cast, 1<br><br></div>Can't be transformed to a check for 'equal to 0'.<br>

<br></div>Thanks!<br></div></blockquote><div><br></div><div>H. <br></div></div></div></div>