<div dir="ltr"><div><span style="font-size:12.8px">Hi James, all,</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">For all of these changes: why/where are they actually useful?</span></div><div><span style="font-size:12.8px">> </span><span style="font-size:12.8px">Previous enhancements of FileCheck have mostly been added when needed by a test. It would greatly help your case for adding these new enhancements to show some tests which would be improved, or have greater clarity, by the use of these features.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Let me clarify. Elena's proposals are driven by development and testing of </span><span style="font-size:12.8px">"downstream" </span><span style="font-size:12.8px">commercial</span><span style="font-size:12.8px"> </span><span style="font-size:12.8px">toolchain for embedded processors.</span></div><div><span style="font-size:12.8px">The proposed enhancements have practical use cases in internal code base. We did decide to upstream them.</span></div><div><span style="font-size:12.8px">However, we didn't look for </span><span style="font-size:12.8px">representative examples in upstream repository (yet).</span></div><div><br></div><div><div><span style="font-size:12.8px">"3. </span><span style="font-size:12.8px">Expressions repeat for CHECK</span><span style="font-size:12.8px">"</span><br></div><div><span style="font-size:12.8px">Tests containing duplicating CHECK lines: e.g. you want to match expression K times or maybe skip it to find specific expression.</span></div><div><span style="font-size:12.8px">Currently we have to duplicate CHECK or use grep and sed/awk scripts count patterns and then compare numbers later.</span></div><div><span style="font-size:12.8px">E.g. count number of LD instructions inside function or loop body</span><span style="font-size:12.8px">. </span><span style="font-size:12.8px">This extension can help to describe that as CHECK pattern.</span></div></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">"5. </span><span style="font-size:12.8px">CHECK-LABEL-DAG"</span><br></div><div><span style="font-size:12.8px">CHECK-LABEL is used to annotate top-level entities, e.g. functions.</span></div><div><span style="font-size:12.8px">Suppose your tool can reorder output fragments (e.g. functions in ASM) comparing to original source file.</span></div><div><span style="font-size:12.8px">LABEL-DAG can help.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">"8.</span><span style="font-stretch:normal;font-size:7pt;font-family:'Times New Roman'"> </span><u style="font-size:12.8px"></u><span style="font-size:12.8px">Prefix with regular expressions - If statement should be checked if prefix matches some regular expression, it should be used {{regex}}:, {{regex}}-NEXT and etc.</span><span style="font-family:Calibri,sans-serif;font-size:11pt"> "</span><br></div><div><span style="font-size:12.8px">Our processors are highly configurable and we compile/apply same test for many ISA extensions options.</span></div><div><span style="font-size:12.8px">Image 100s variants of the same CHECK statements for various ISA configurations.</span></div><div><span style="font-size:12.8px">CHECK regexp prefixes can explain logic in compact and readable way, making it easier to understand </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Use cases are similar to Daniel's example for MIPS:</span></div><div><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> {{MIPS32R[2-5]}} would match MIPS32R2 through to MIPS32R6<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> {{MIPS(32|64)R6}} would match MIPS32R6 and MIPS64R6<u></u><u></u></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> {{MIPS64.*}} would match any MIPS64</span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><br></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span style="font-family:Calibri,sans-serif;font-size:11pt">Thanks,</span><br></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:12pt;font-family:'Times New Roman',serif"><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">Sergey</span></p></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 26, 2016 at 7:13 PM, James Y Knight via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</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">For all of these changes: why/where are they actually useful?<div><br></div><div>Previous enhancements of FileCheck have mostly been added when needed by a test. It would greatly help your case for adding these new enhancements to show some tests which would be improved, or have greater clarity, by the use of these features.<br><div><br></div></div><div>I'm particularly skeptical about "3. <span style="font-size:12.8px">Expressions repeat for CHECK", "5. </span><span style="font-size:12.8px">CHECK-LABEL-DAG", and (as noted before "7. </span><span style="color:rgb(0,0,0);font-size:12.8px">Wildcard for prefixes" and "8. </span><span style="font-size:12.8px">Prefix with regular expressions"</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">For "6. </span><span style="font-size:12.8px">Check statement for words only" -- I think it might be better to just make that be the ONLY behavior, rather than an additional option -- if you intended to end a match in the middle of a word, stick {{[^ ]*}} on it.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, May 24, 2016 at 9:51 AM, Elena Lepilkina via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">Hi everyone,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">There was idea to add new directives to FileCheck:<u></u><u></u></p>
<p><u></u><span>1.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Directive to use some patterns as named template with or without parameters.<u></u><u></u></p>
<p><u></u><span>2.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>CHECK-INCLUDE - Directive to include other file with checks to another.<u></u><u></u></p>
<p><u></u><span>3.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Expressions repeat for CHECK - If statement should be checked several times repeat modifiers {n}, {n,m} , {,n}, {n,}, *, + can be used.<u></u><u></u></p>
<p><u></u><span>4.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Repeat in regexs - Repeat with current number should become available by using {n}, {n,m} , {,n}, {n,}<u></u><u></u></p>
<p><u></u><span>5.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>CHECK-LABEL-DAG - Not <span style="color:black">sequential order of labels.</span><u></u><u></u></p>
<p><u></u><span>6.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Check statement for words only - // CHECK-WORD, // CHECK-WORD-NEXT, // CHECK-WORD-SAME, // CHECK-WORD-DAG, // CHECK-WORD-NOT.<u></u><u></u></p>
<p><u></u><span>7.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u><span style="color:black">Wildcard for prefixes - If some statements should be checked regardless prefix, it should be used //{{*}}, //{{*}}-NEXT, //{{*}}-SAME and etc.</span><u></u><u></u></p>
<p><u></u><span>8.<span style="font:7.0pt "Times New Roman"">
</span></span><u></u>Prefix with regular expressions - If statement should be checked if prefix matches some regular expression, it should be used {{regex}}:, {{regex}}-NEXT and etc.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">More information in file <a href="https://docs.google.com/document/d/1wAKNzU7-S2EeK1-aADwgP8dEiKfByKNazonybCQW3zs/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/1wAKNzU7-S2EeK1-aADwgP8dEiKfByKNazonybCQW3zs/edit?usp=sharing</a>.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Now we have prototype with these features. It’s tested on LLVM 3.8.<u></u><u></u></p>
<p class="MsoNormal">There was found unsupported before directive in old test. Bug about this -
<a href="https://llvm.org/bugs/show_bug.cgi?id=27852" target="_blank">https://llvm.org/bugs/show_bug.cgi?id=27852</a>.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">There is about 6% slowdown with new features when we tested them on 3.8.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I see that there are some changes in FileCheck LLVM 3.9 with new features too. We can publish patch for 3.8 and it can be adapted for LLVM 3.9. Is it interesting for anyone? And how will be better to publish patch as for 3.8 or for 3.9?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Elena.<u></u><u></u></p>
</div>
</div>
<br></div></div><span class="">_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></span></blockquote></div><br></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>