[all-commits] [llvm/llvm-project] dcbc91: [instcombine] Delete duplicate object size logic

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Jan 7 10:32:41 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dcbc91f40c2e6ff578667020f7c6a05c25149865
      https://github.com/llvm/llvm-project/commit/dcbc91f40c2e6ff578667020f7c6a05c25149865
  Author: Philip Reames <listmail at philipreames.com>
  Date:   2022-01-07 (Fri, 07 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/deref-alloc-fns.ll

  Log Message:
  -----------
  [instcombine] Delete duplicate object size logic

nstCombine appears to duplicate the allocation size logic used inside getObjectSize when figuring out which attributes are safe to place on the callsite. We can use the existing utility function instead.

The test change is correct. With aligned_alloc, a zero alignment is required to return nullptr. As such, deref_or_null is a correct attribute to use.

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




More information about the All-commits mailing list