Files
clang-p2996/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
Changpeng Fang fa45bf4300 InstCombine: Fix a crash in PointerReplacer when constructing a new PHI (#130256)
When constructing a PHI node in `PointerReplacer::replace`, the incoming
operands are expected to have already been replaced and in the
replacement map. However, when one of the incoming operands is a load,
the search of the map is unsuccessful, and a nullptr is returned from
`getReplacement`. The reason is that, when a load is replaced, all the
uses of the load has been actually replaced by the new load. It is
useless to insert the original load into the map. Instead, we should
place the new load into the map to meet the expectation of the later map
search.

Fixes: SWDEV-516420
2025-03-09 20:21:36 -07:00

60 KiB