<div dir="ltr"><div dir="ltr">On Sun, May 2, 2021 at 12:34 PM Roman Lebedev <<a href="mailto:lebedev.ri@gmail.com">lebedev.ri@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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></blockquote><div><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> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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>
</blockquote></div></div>