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

Shilei Tian via All-commits all-commits at lists.llvm.org
Tue Jul 16 06:07:23 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: f29bdb9998321522854d30d9185e7559b0eae750
      https://github.com/llvm/llvm-project/commit/f29bdb9998321522854d30d9185e7559b0eae750
  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/AMDGPU/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