<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/86827>86827</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp:1097: faulty compare ?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dcb314
</td>
</tr>
</table>
<pre>
Static analyser cppcheck says:
llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp:1097:30: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError]
Source code is
bool AIsConstantInsn = AOM && AOM->getInsnMatcher().isConstantInstruction();
bool BIsConstantInsn = BOM && BOM->getInsnMatcher().isConstantInstruction();
if (AOM && BOM) {
// The relative priorities between a G_CONSTANT and any other instruction
// don't actually matter but this code is needed to ensure a strict weak
// ordering. This is particularly important on Windows where the rules will
// be incorrectly sorted without it.
if (AIsConstantInsn != BIsConstantInsn)
return AIsConstantInsn < BIsConstantInsn;
I am not aware of any ordering that can be applied to bool values. Suggest code rework.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2T4jgM_TXmopoUOIHAIQc-mq4-zPQBqua4pTiCeNvYKVmB4t9vOTDdzfTcdi7YWJHe03u2MEZ79ESVmq7UdDPCXtrAVWPqfFKM6tBcq52gWAPo0V0jMZiuMy2ZN4h4jSpfqvFGje-_zp1PSm97sS4qvd1j7eiZvNLbdTidQto8u1Cje9mRe_jzHcW0w_eZ6TqVLyfjRanyZT5W-RKiXB2lzTqcOmQbg4dwAIQzsk1J0OLZ-iPUIThCD2d0PUEf0xmTQ7HBowOl5ypfK70GlT_dlrXKNxB4OMg3Si8gdMQogTNQ05V5B3w9rEJwP620aX1iDqymm8_d70LPhsCEhsDGzxEYiMHyJa6Dj4JeXnz0kKCXr99B6ZnSs7T9pvKnIw3RQRHiRFkvMvs5U7g3qaNbTOWrB5TVH1BWHyir_4nyC8sekpzLh8JJPlW-0wFQeqv0FvYt3W04E3RsA1uxFKEmuRB5QHj-Z_36Y7df_tgD-gbQXyFISwz2E5HfyzaJXCmARnp07gonFCGGuheQ1sZfVoAnaqgBCUA-9kyAEIWtEbgQvn2pG7ghtv6YwT5VsRE6ZLGmd8juCvbUBU4iQfDw0_omXCJcWmICSY32jiJcrHNfCtcE1pvATEbcFWJgoQYuVtrQC1jJPjLu8v7upZ4Mdj4eJ3veEwGYpGf_h9u2_pL4aOoL4Al8EMALMg0vLPlwVwOkRQGDPrWBXefsTdLh0g0PLmaw649HinJTnukS-O3e1Kip8maRL3BE1aScTKbTcjKbj9qqmJZmQU0xnxY16SKf68msbMZlU9Q1ldN6ZCs91sU41-VkluuiyJC0ns0PC5PrsjGoVTGmE1qXpfmTBT6ObIw9VfPZXJcjhzW5OEw4rT1dYAgqrdPA4yrlfKv7Y1TF2Nko8aOKWHFU_f2hBgfsnVzhNlwIVL4d9eyqVqQbRupwW45W2r7OTEjodxID2Y7Dv2RE6e3QSSI1dPpfAAAA__8S3Njl">