[all-commits] [llvm/llvm-project] 168666: [IR] Make CanBeFreed calculation optional (NFC) (#...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jun 12 08:37:08 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 168666950ea9cd85471053319e216399e9750028
      https://github.com/llvm/llvm-project/commit/168666950ea9cd85471053319e216399e9750028
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2026-06-12 (Fri, 12 Jun 2026)

  Changed paths:
    M llvm/include/llvm/IR/Value.h
    M llvm/lib/Analysis/BasicAliasAnalysis.cpp
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Analysis/Loads.cpp
    M llvm/lib/Analysis/LoopAccessAnalysis.cpp
    M llvm/lib/Analysis/ScalarEvolution.cpp
    M llvm/lib/IR/Value.cpp
    M llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
    M llvm/lib/Transforms/IPO/AttributorAttributes.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Utils/MemoryOpRemark.cpp

  Log Message:
  -----------
  [IR] Make CanBeFreed calculation optional (NFC) (#203490)

Make the CanBeFreed argument of getPointerDereferenceableBytes() a
pointer, so that nullptr can be passed if we're not interested in
whether frees are possible or not.

Nearly all places don't actually care about frees, including BasicAA,
which is the hottest caller of this API. This improves compile-time when
deref-at-point semantics are enabled.

I've kept the argument required so that callers still have to make an
explicit choice to ignore frees. (I'd be open to making it optional
though, given that only a single caller actually cares...)



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