[all-commits] [llvm/llvm-project] 2449cb: [InstCombine] Handle PHI nodes in PtrReplacer

Anshil Gandhi via All-commits all-commits at lists.llvm.org
Tue Jan 17 09:56:52 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2449cbabddc73668abf60357d476a78692193286
      https://github.com/llvm/llvm-project/commit/2449cbabddc73668abf60357d476a78692193286
  Author: Anshil Gandhi <gandhi21299 at gmail.com>
  Date:   2023-01-17 (Tue, 17 Jan 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
    M llvm/test/Transforms/InstCombine/replace-alloca-phi.ll

  Log Message:
  -----------
  [InstCombine] Handle PHI nodes in PtrReplacer

This patch adds on to the functionality implemented
in rG42ab5dc5a5dd6c79476104bdc921afa2a18559cf,
where PHI nodes are supported in the use-def traversal
algorithm to determine if an alloca ever overwritten
in addition to a memmove/memcpy. This patch implements
the support needed by the PointerReplacer to collect
all (indirect) users of the alloca in cases where a PHI
is involved. Finally, a new PHI is defined in the replace
method which takes in replaced incoming values and
updates the WorkMap accordingly.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D136201




More information about the All-commits mailing list