[all-commits] [llvm/llvm-project] 54fcde: [InlineCost] Simplify constant folding

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jun 30 02:50:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 54fcde42c0239b8041b89e17064846f01b60145c
      https://github.com/llvm/llvm-project/commit/54fcde42c0239b8041b89e17064846f01b60145c
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2022-06-30 (Thu, 30 Jun 2022)

  Changed paths:
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/test/Transforms/Inline/gep_from_constant.ll

  Log Message:
  -----------
  [InlineCost] Simplify constant folding

Use a common ConstantFoldInstOperands-based constant folding
implementation, instead of specifying the folding function for
each function individually. Going through the generic handling
doesn't appear to have any significant compile-time impact.

As the test change shows, this is not NFC, because we now use
DataLayout-aware constant folding, which can do slightly better
in some cases (e.g. those involving GEPs).




More information about the All-commits mailing list