<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58153>58153</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Segfault when calling LLVMBuildICmp / LLVMBuildFCmp
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          vanelk
      </td>
    </tr>
</table>

<pre>
    I am currently building a compiler and using the LLVM C API  when I call LLVMBuildICmp or LLVMBuildFCmp on any value it causes me to get a segfault. I first thought I got the wrong opcodes/predicates so I tested with LLVMConstICmp and LLVMConstFCmp and they work perfectly. The issue is I cannot use LLVMConst functions on variables. I debugged the segfault and all seem to it crashes in the function. `llvm::Constant::isNullValue()` and `llvm::APFloat::Storage::Storage(llvm::detail::IEEEFloat, llvm::fltSemantics const&)` for my ints and floats respectively. I would be grateful for any help.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxVU11vqzAM_TXwYg1BaFl54GHrXaVKu1eTdrX3QAzkLiQoH63676-TbqsqRcJ2bJ9j59AbcemOwBcYgrWovbpAH6QSUk_AYTDLKhVa4FpAcDHoZ4TX14_fsIentyPAeUYNRxi4Uin-HKuP-2UFY2-BQwpo6nOBE1cBQXqqCQ4dLAjewISeAB1OIw_KF9RylNZ5wjNhmj35k_EJ_WwN8TDrYAS6jB1Wi0IO3FMrZyiPDI8CztLPicDeaOcTozjFT-TwHaGeFzgb-wkr2hEH2kEBfwlIOheJujSe1gRPfG8NYAx68JLMONmJW8l7hS5SF9iHacLU-2emBBbX5BCXOHJcgeVuJuJSp9TvjgVkTanUacnqJzoJjmt_9aT7E5T6iFvM2C5jLeWm3nc1T28HZfhXybs3lk9477DdLVug51Jd7ePLy8u1lu3hljIq_44LsZCDI2EQo4w1X-gjvfVyoSm8S0zGWO7Aoltpn_KEcaVHWnJQAnqEydJzjUGlwqiJGdVa5NhVTbNpq8cdK3PR1aKtW5576RV2799bTIKLcotqvFccieFecnmwqpu9X12cgR3oTCSL0BekbHLSdNfPw2rNPyJLbnr3qKztrtrW-dy1HMe6b6qhGXbYV2TsHluBdVOKZiOGNle8R-W6bPucMabxfJUO2dn2Vy47VjJWleWGVVXJyuJxV9dtL9pNWY7lUDbZpqTFSlVEHoWxU267RIlE5OhSSefd7ZI7JyeNmOCoPw_0j9juxDWqzzwhd4n5fyQFSkI">