[all-commits] [llvm/llvm-project] f7e550: [InstCombine] Fix a crash in `PointerReplacer`

Shilei Tian via All-commits all-commits at lists.llvm.org
Mon Jul 15 21:32:32 PDT 2024


  Branch: refs/heads/users/shiltian/07-15-_instcombine_remove_early_replacement_of_uses_in_pointerreplacer
  Home:   https://github.com/llvm/llvm-project
  Commit: f7e5508b2b666008bc2f5a1ee1283eaf4713aead
      https://github.com/llvm/llvm-project/commit/f7e5508b2b666008bc2f5a1ee1283eaf4713aead
  Author: Shilei Tian <i at tianshilei.me>
  Date:   2024-07-16 (Tue, 16 Jul 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    A llvm/test/Transforms/InstCombine/select-from-load.ll

  Log Message:
  -----------
  [InstCombine] Fix a crash in `PointerReplacer`

A crash could happen in `PointerReplacer::replace` when constructing a new
select instruction and there is no replacement for one of its operand. This can
happen when the operand is a load instruction that has been replaced earlier
such that the operand itself is already the new value. In this case, it is not
in the replacement map and `getReplacement` simply returns nullptr.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list