<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 3, 2021 at 8:40 AM Roman Lebedev via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@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">Doesn't verifier run on the fully constructed IR?<br>
I.e. won't it always run after said constructor has run?<br>
I'm not really sure how we can perform that verifier check earlier?<br>
<br>
Roman<br></blockquote><div><br></div><div>I think you need to either drop the assert, or check this condition already in LLParser, maybe somewhere around <a href="https://github.com/llvm/llvm-project/blob/1f8963c80195aa86d02e81acedcf1ff3da127842/llvm/lib/AsmParser/LLParser.cpp#L7175">https://github.com/llvm/llvm-project/blob/1f8963c80195aa86d02e81acedcf1ff3da127842/llvm/lib/AsmParser/LLParser.cpp#L7175</a>. And possibly the Bitcode parser as well?<br></div><div><br></div><div>Nikita<br></div><div>Â </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On Sun, May 2, 2021 at 10:46 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
><br>
> On Sun, May 2, 2021 at 12:34 PM Roman Lebedev <<a href="mailto:lebedev.ri@gmail.com" target="_blank">lebedev.ri@gmail.com</a>> wrote:<br>
>><br>
>> Originally we had a verifier check for phis with token type,<br>
>> i made the PHINode constructor assert if the type is a token,<br>
>> which obviously broke the verifier test.<br>
><br>
><br>
> Sounds like the verifier may need to be changed to check this condition earlier, then? We shouldn't be able to reach/fire an assertion on any input when running the verifier, I think.<br>
><br>
>><br>
>> If we drop the test for what happens without assertions,<br>
>> that implies we no longer care what the verifier does<br>
>> about such PHI's. Is that really so?<br>
>><br>
>> Roman<br>
>><br>
>> On Sun, May 2, 2021 at 10:11 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>> ><br>
>> > Could you explain the purpose of these two tests a bit more?<br>
>> ><br>
>> > In general I don't think we should be testing the behavior of assertions except in pretty narrow cases (like checking that the Error API asserts in certain ways that are critical to its usability) - since they represent essentially "undefined behavior".<br>
>> ><br>
>> > And if we are testing the behavior of an assertion, we shouldn't be testing what happens without assertions - because, again, if an assertion can be triggered then the behavior "behind" the assert is undefined, we shouldn't expect any particular behavior. (if we expect particular behavior, we shouldn't assert)<br>
>> ><br>
>> > On Wed, Apr 28, 2021 at 3:59 AM Roman Lebedev via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>> >><br>
>> >><br>
>> >> Author: Roman Lebedev<br>
>> >> Date: 2021-04-28T13:58:38+03:00<br>
>> >> New Revision: b01f499861235f414f6740bbf950d095bceada4d<br>
>> >><br>
>> >> URL: <a href="https://github.com/llvm/llvm-project/commit/b01f499861235f414f6740bbf950d095bceada4d" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b01f499861235f414f6740bbf950d095bceada4d</a><br>
>> >> DIFF: <a href="https://github.com/llvm/llvm-project/commit/b01f499861235f414f6740bbf950d095bceada4d.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/b01f499861235f414f6740bbf950d095bceada4d.diff</a><br>
>> >><br>
>> >> LOG: [NFC][Verifier] Split token1.ll into two, assert/non-assert versions<br>
>> >><br>
>> >> Added:<br>
>> >>Â Â Â llvm/test/Verifier/token1-with-asserts.ll<br>
>> >>Â Â Â llvm/test/Verifier/token1-without-asserts.ll<br>
>> >><br>
>> >> Modified:<br>
>> >><br>
>> >><br>
>> >> Removed:<br>
>> >>Â Â Â llvm/test/Verifier/token1.ll<br>
>> >><br>
>> >><br>
>> >> ################################################################################<br>
>> >> diff --git a/llvm/test/Verifier/token1.ll b/llvm/test/Verifier/token1-with-asserts.ll<br>
>> >> similarity index 100%<br>
>> >> rename from llvm/test/Verifier/token1.ll<br>
>> >> rename to llvm/test/Verifier/token1-with-asserts.ll<br>
>> >><br>
>> >> diff --git a/llvm/test/Verifier/token1-without-asserts.ll b/llvm/test/Verifier/token1-without-asserts.ll<br>
>> >> new file mode 100644<br>
>> >> index 000000000000..ef2d25c045d2<br>
>> >> --- /dev/null<br>
>> >> +++ b/llvm/test/Verifier/token1-without-asserts.ll<br>
>> >> @@ -0,0 +1,12 @@<br>
>> >> +; REQUIRES: !asserts<br>
>> >> +; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s<br>
>> >> +<br>
>> >> +define void @f(token %A, token %B) {<br>
>> >> +entry:<br>
>> >> +Â br label %bb<br>
>> >> +<br>
>> >> +bb:<br>
>> >> +Â %phi = phi token [ %A, %bb ], [ %B, %entry]<br>
>> >> +; CHECK: PHI nodes cannot have token type!<br>
>> >> +Â br label %bb<br>
>> >> +}<br>
>> >><br>
>> >><br>
>> >><br>
>> >> _______________________________________________<br>
>> >> llvm-commits mailing list<br>
>> >> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>> >> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>