<div dir="ltr"><div>There can only be one "set" operator per pattern list. I think we usually do "(implicit EFLAGS)" after the set, but I don't think it is required. I think it allows tablegen to infer Defs = [EFLAGS] from the (implicit EFLAGS), but I don't know of any place that doesn't just list the Defs explicitly.</div><div><br></div><div>~Craig<br></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jan 20, 2021 at 11:14 AM Chris Sears via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</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 dir="ltr">What is the difference between<br><br><span class="gmail_default" style="font-size:small"> </span>Uses = [EFLAGS] <span class="gmail_default" style="font-size:small">+</span> Defs = [EFLAGS]<br><br>and their mention in selection patterns?<br><br><span class="gmail_default" style="font-size:small"> </span>[(set GR64:$dst, EFLAGS, (X86smul_flag GR64:$src1, GR64:$src2))]<br><br>Basically, my problem is that I have weird instructions which undef the EFLAGS register, leaving EFLAGS in an unknown state. For example:<br><br> cmp x, y<br> beq z ; <span class="gmail_default" style="font-size:small">this is </span>good<span class="gmail_default" style="font-size:small"> because EFLAGS is defined</span><br><br> cmp x, y<br> weird_inst. ; undef<span class="gmail_default" style="font-size:small"></span>s EFLAGS<span class="gmail_default" style="font-size:small">, leaves EFLAGS in a undefined state</span><br> beq z ; <span class="gmail_default" style="font-size:small">this is </span>bad<span class="gmail_default" style="font-size:small"> because</span> EFLAGS is undefined<br><br>Is it enough to just say Defs = [EFLAGS] for the Instruction def of weird_inst?<span class="gmail_default" style="font-size:small"> </span>Or is it necessary for the <span class="gmail_default" style="font-size:small">pattern</span> to say something like [(set EFLAGS, undef)]<span class="gmail_default" style="font-size:small"> as well</span>?</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>