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

    <tr>
        <th>Summary</th>
        <td>
            Crash when instcombine tries to optimize away allocation
        </td>
    </tr>

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

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

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

<pre>
    ```
$ cat /tmp/d.ll
define i32 @f() {
bb:
  %alloc = tail call align 4 dereferenceable_or_null(64) ptr @__rust_alloc(i64 64, i64 4)
  tail call void @__rust_dealloc(ptr %alloc, i64 64, i64 4)
  ret i32 6
}

; Function Attrs: nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable
declare noalias noundef ptr @__rust_alloc(i64 noundef, i64 allocalign noundef) local_unnamed_addr #0

; Function Attrs: nounwind nonlazybind allockind("free") uwtable
declare void @__rust_dealloc(ptr allocptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { nounwind nonlazybind allockind("alloc,uninitialized,aligned") allocsize(0) uwtable }
attributes #1 = { nounwind nonlazybind allockind("free") uwtable }

$ opt -p instcombine /tmp/d.ll -disable-output
opt: ../../llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2336: bool isAllocSiteRemovable(Instruction *, SmallVectorImpl<WeakTrackingVH> &, const TargetLibraryInfo &): Assertion `Family' failed.
```

@durin42 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VE9v47YT_TTUhYghD2XJPujg2D_hF6CnbrA9GiNxZLOhSIGkYjifviAl7ybp7gIFigIGPeJw_rw3j0Tv1dkQ1WzzyDbHDKdwsa5Gmlo0Lz5rrbzVrMyXX35k-Z5BwTsMnEEThpFBI1dazy5JvTLElQDOirxnsGWw46x6nN1ty8R-NjlnsEGtbceZOPKASvMOteao1dnwgkty1JMj0xG2mk7WncykNYNtWcSkY3CxxunkJh9OKRODrSoLHv0HHq148F7ue4VXq-S7UEn34JRy6eqe4sfJHIUEslwYqY6LMa_ikTeT6YKyhu9DcJ6JPTd2MldlJDfWaHy7tdFOtV6UkYkquJeejDIqKNTqjSSDQyIlWhChp1NevRGDbR43pmuIHN1n0Gl0xI1FrdCnupL6XxC2nLgDTa55DN88O572TpMxOJA8oZSRK5H_O7h7R7SA-yGWX44s2dH4hONnnz_Dsn6PBUNwqp0C-QQziZRVj__BFPk3NX3sYf2Pevg7o_yzSqHgdgz8YeTK-NDZoY1398Ot5g9S-Rj8YKcwTmGOtGOIg12tGDRp0fp1iH-qZdA8OzS-t27wDJon48Nhzrx8uSnpY95U5rzqxpGJPQhRxqSttZorv49ovqhAv9NgX5MgYPsunDPYx8F-GVDrr9QF656GUTNx-IPw5dlhpOL89f9M_I8zKOPRzhof-DO6M4XfVOvQ3Z5Mb2f3Ltbee09uzl7mDQ5K3xhUvEelSa4W1j69hfNa5HJyyhTAM1kLuRM7zKhel9tqU6w3sM4utRSww3VflXkBIIq-Q4miKMtdWZZViXmmashB5CWIdSUgz1ftZrNpd-uy33Y5rHfIipwGVHoV6V5Zd86U9xPVpSiqKtPYkvbpHQcwdOXJGSWwOWaujjEP7XT2rMi18sF_zxJU0FQfHPoLv17IfJBDcIo8DzZKRQ3qjThe8ba8EZGrbHK6voQwxsvOoGHQnFW4TO2qs8M7bcT6o7N_UhcYNKm5KJDU_F8BAAD__650DsY">