diff options
author | Changpeng Fang <changpeng.fang@amd.com> | 2025-03-09 20:21:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-09 20:21:36 -0700 |
commit | fa45bf430081ed5a37c50719dfd3a8ca32271126 (patch) | |
tree | 958f0efb89995dada98fad786e177e0797f22395 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 64c73d5c7184d1287e4982684d0fe8ad5f2341c0 (diff) | |
download | llvm-fa45bf430081ed5a37c50719dfd3a8ca32271126.zip llvm-fa45bf430081ed5a37c50719dfd3a8ca32271126.tar.gz llvm-fa45bf430081ed5a37c50719dfd3a8ca32271126.tar.bz2 |
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
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
0 files changed, 0 insertions, 0 deletions