[all-commits] [llvm/llvm-project] 616f54: [MemCpyOpt] Use dereferenceable pointer helper

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Oct 6 09:45:31 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 616f5450480214d40dd69a5f5f0f10b41bd4b3e2
      https://github.com/llvm/llvm-project/commit/616f5450480214d40dd69a5f5f0f10b41bd4b3e2
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2020-10-06 (Tue, 06 Oct 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
    M llvm/test/Transforms/MemCpyOpt/callslot.ll

  Log Message:
  -----------
  [MemCpyOpt] Use dereferenceable pointer helper

The call slot optimization has some home-grown code for checking
whether the destination is dereferenceable. Replace this with the
generic isDereferenceableAndAlignedPointer() helper.

I'm not checking alignment here, because that is currently handled
separately and may be an enforced alignment for allocas. The clean
way of integrating that part would probably be to accept a callback
in isDereferenceableAndAlignedPointer() for the actual isAligned check,
which would then have a chance to use an enforced alignment instead.

This allows the destination to be a GEP (among other things), though
the two open TODOs may prevent it from working in practice.

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




More information about the All-commits mailing list