[all-commits] [llvm/llvm-project] 96ab74: [InstCombine] remove undef loads, such as memcpy f...

Jameson Nash via All-commits all-commits at lists.llvm.org
Fri Jun 20 07:32:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96ab74bf175f46de4b6fbfc68deecd3567e42a52
      https://github.com/llvm/llvm-project/commit/96ab74bf175f46de4b6fbfc68deecd3567e42a52
  Author: Jameson Nash <vtjnash at gmail.com>
  Date:   2025-06-20 (Fri, 20 Jun 2025)

  Changed paths:
    M clang/test/Misc/loop-opt-setup.c
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/test/Transforms/InstCombine/and-or-icmps.ll
    M llvm/test/Transforms/InstCombine/apint-shift.ll
    M llvm/test/Transforms/InstCombine/call-cast-target.ll
    A llvm/test/Transforms/InstCombine/dead-alloc-elim.ll
    M llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll
    M llvm/test/Transforms/InstCombine/getelementptr.ll
    M llvm/test/Transforms/InstCombine/malloc-free.ll
    M llvm/test/Transforms/InstCombine/multiple-uses-load-bitcast-select.ll
    M llvm/test/Transforms/InstCombine/objsize.ll
    M llvm/test/Transforms/InstCombine/select-load.ll
    M llvm/test/Transforms/InstCombine/shift-amount-reassociation.ll
    M llvm/test/Transforms/InstCombine/vscale_gep.ll

  Log Message:
  -----------
  [InstCombine] remove undef loads, such as memcpy from undef (#143958)

Extend `isAllocSiteRemovable` to be able to check if the ModRef info
indicates the alloca is only Ref or only Mod, and be able to remove it
accordingly. It seemed that there were a surprising number of
benchmarks with this pattern which weren't getting optimized previously
(due to MemorySSA walk limits). There were somewhat more existing tests
than I'd like to have modified which were simply doing exactly this
pattern (and thus relying on undef memory). Claude code contributed the
new tests (and found an important typo that I'd made).

This implements the discussion in
https://github.com/llvm/llvm-project/pull/143782#discussion_r2142720376.



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