[llvm] [InstCombine] Reuse existing freeze when pushing freeze through a binop (PR #202306)

Yuyang Zhang via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 23:10:02 PDT 2026


yuyzhang512 wrote:

> A correctness issue was identified by [llvm-hackme](https://github.com/dtcxzyw/llvm-hackme). Please see the [issue comment](https://github.com/llvm/llvm-project/pull/202306#issuecomment-4648710833) for details.

 Thanks for the report. Fixed in the latest revision.
  
  The crash was in the new `reuseExistingFreezeFor` helper: it called `V->users()` on every maybe-poison operand, but an operand can be a `ConstantData` with no use list (here the `undef`  aggregate operand of the insertvalue), which trips the `hasUseList()` assertion. Added an early `if (!V->hasUseList()) return nullptr;` guard, plus a regression test
  (reuse_existing_freeze_constdata_operand in freeze.ll)

https://github.com/llvm/llvm-project/pull/202306


More information about the llvm-commits mailing list