<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 7, 2010, at 12:27 PM, Jim Grosbach wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On Dec 7, 2010, at 11:53 AM, Eric Christopher wrote:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">On Dec 7, 2010, at 11:35 AM, Jim Grosbach wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Author: grosbach<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Date: Tue Dec  7 13:35:36 2010<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">New Revision: 121166<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=121166&view=rev">http://llvm.org/viewvc/llvm-project?rev=121166&view=rev</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Log:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Change assert to diagnostic. Message still needs work, but it's better than<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">an assert, at least.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">    };<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-    assert(!SimplePatterns[Operands][OpcodeName][VT][RetVT]<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-            .count(PredicateCheck) &&<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">-           "Duplicate pattern!");<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    // FIXME: Source location information for the diagnostic.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    if (SimplePatterns[Operands][OpcodeName][VT][RetVT]<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+            .count(PredicateCheck)) {<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+      SmallString<128> PatText;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+      raw_svector_ostream OS(PatText);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+      Pattern.SrcPattern->print(OS);<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+      throw "Duplicate record: " + OS.str().str();<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">+    }<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">    SimplePatterns[Operands][OpcodeName][VT][RetVT][PredicateCheck] = Memo;<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">  }<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">}<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Hmm? What's going on here?<br></blockquote><br><br>If two tblgen records have the same pattern, they hit this. copy/paste errors or somesuch, usually. E.g.,<br><br>def Pat<(add GPR:$Rd, GPR:$Rn, GPR:$Rm)<br><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>(ADD GPR:$Rd, GPR:$Rn, GPR:$Rm)>;<br>def Pat<(add GPR:$Rd, GPR:$Rn, GPR:$Rm)<br><span class="Apple-tab-span" style="white-space:pre">  </span><span class="Apple-tab-span" style="white-space:pre">    </span>(SUB GPR:$Rd, GPR:$Rn, GPR:$Rm)>;<br><br>These patterns have the same source pattern, and so will trigger this condition. The assert was only marginally helpful and darned ugly. The diagnostic is slightly more helpful, though still not what we really want (see FIXME), and a lot less ugly.<br></div></blockquote></div><br><div>OK I guess. The assert meant such things wouldn't be missed, but seeing the message for each duplicate pattern may outweigh that :)</div><div><br></div><div>-eric</div></body></html>