<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60608>60608</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Backport 844430bcc377 to 16.x release branch
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
preames
</td>
</tr>
</table>
<pre>
This change fixes a recent and high impact regression. The flawed logic was introduced in Dec 22, by change [844430bcc377](https://reviews.llvm.org/rG844430bcc3778094ac0e0dd085062809b7f6d666).
This was recently exposed in a stage2 build of llvm-tablegen when we switched from using llvm::Optional to std::optional. The stars aligned in just the wrong way, and we started actively miscompiling idiomatic optional usage. std::optional<uint32_t> appears to use the top 32 bits of the word on RV64 for its tag.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUkFvnDwQ_TXmMgryGjDsgUOS_fY7VqqiXqvBHsCpwcgeQvbfV7BNm6qXsTQz1nvz3sOU3DATtaJ6EtUlw5XHENslEk6Usi7YW_syugRmxHkg6N07JUCIZGhmwNnC6IYR3LSgYYg0RErJhTkHeBkJeo8bWfBhcAY2TOBmjsGuhiy4GS5kQCmhnqG7fUCI6qkpy7KQnTFFXYvqIlQzMi9JFI9CXYW6RnpztKXc-7cpD3HYW_9__tTIc4lGkrRWNpXUqpHnru611VoLdc6FvAj5eK_HeTu1-03-BvS-hHQniJAYB1LQrc5bCD3smA-MnaeBZtjGvRCkzbEZyUIfwwRrcvNwbO6Ui8cvC7swowcOkNjem-FXMz-ESowxAfrdjQP5dU0MPBJsMcwDbHjbZdoF3-7bTBbQsHsjf4PJJROmxfkd2FkXJmRn4AMD1oQD5f-Ci-J5dTMX6juL4j_AZaGdBwdYEx3wHBYoFHSO037-wShEC2GGr990CX2IsM8YhzyzbWHPxRkzak-6rppGq1OTja3UStZUygZ725ywllZSdzqdq15Spaoqc62SqpBKNqdzpasmN7qSmlRdYIG90bUoJU3o_G_PM5fSSq2WWjaZx458OkKs1EwbHEOh1J7p2B6edeuQRCm9S_wnORk79tQ-ofmxhMjwOUS7Ciedv0MkT5gIuoizGbM1-vbvPA6Ox7XLTZiEuh6235-HJYZXMizU9SCUhLoehH8GAAD__-0PIvE">