<div dir="ltr"><div>Thanks!</div><div><br></div><div>That reduces even further (I'll add this as a regression test soon):</div><div>define i8 @widget(i64 %x) {<br>  %a1 = and i64 %x, 128<br>  %t4 = icmp eq i64 %a1, 0<br>  %t6 = zext i1 %t4 to i8<br>  ret i8 %t6<br>}</div><div><br></div><div>So we would need to invert more of the related folds to make sure we're not creating conflicting transforms...</div><div><br></div><div>I'll split this patch up. We can solve the motivating bug simply by removing a transform without adding another. Then, I'll see if I can undo others that would conflict.<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 17, 2022 at 4:20 AM Florian Hahn <<a href="mailto:florian_hahn@apple.com">florian_hahn@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><br><div><br><blockquote type="cite"><div>On May 16, 2022, at 22:54, Sanjay Patel via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:</div><br><div><div dir="ltr"><div>Thanks for letting me know. Reverted:</div><div><a href="https://reviews.llvm.org/rG07d549bce94f" rel="noreferrer" target="_blank">https://reviews.llvm.org/rG07d549bce94f</a></div><div><br></div><div>If you can get the IR for that file, that would be great. Otherwise, I'll try to set up a system to extract that.<br></div></div></div></blockquote></div><br><div><br></div><div>Sure, the IR below should hang with this patch and `opt -passes=instcombine`</div><div><br></div><div><div>define i8 @widget(i64 %arg) {</div><div>bb:</div><div>  %tmp = lshr i64 %arg, 7</div><div>  %tmp1 = and i64 %tmp, 1</div><div>  %tmp2 = trunc i64 %tmp1 to i32</div><div>  %tmp3 = icmp ne i32 %tmp2, 0</div><div>  %tmp4 = xor i1 %tmp3, true</div><div>  %tmp5 = zext i1 %tmp4 to i8</div><div>  ret i8 %tmp5</div><div>}</div></div><div><br></div><div><br></div></div></blockquote></div>