[all-commits] [llvm/llvm-project] ddc484: [InstCombine] Handle select inst when eliminating ...

Anshil Gandhi via All-commits all-commits at lists.llvm.org
Mon Jan 23 11:03:22 PST 2023


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

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

  Log Message:
  -----------
  [InstCombine] Handle select inst when eliminating constant memcpy

Allow iterating through SelectInst use of the alloca when
checking if it is only ever overwritten from constant memory.
Recursively determine if the SelectInst is replacable and insert
it into the Worklist if so. Finally, define a new SelectInst to
replace the old one, with both of it's values replaced according
to the WorkMap.

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




More information about the All-commits mailing list