[all-commits] [llvm/llvm-project] cae00b: [FuncSpec][NFC] Improve the unittest coverage for ...

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Tue Jul 11 05:48:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cae00b2a9bb9eabaf71b204cea2a655c18bd51ac
      https://github.com/llvm/llvm-project/commit/cae00b2a9bb9eabaf71b204cea2a655c18bd51ac
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M llvm/unittests/Transforms/IPO/FunctionSpecializationTest.cpp

  Log Message:
  -----------
  [FuncSpec][NFC] Improve the unittest coverage for constant folding of GEPs.

The InstCostVisitor is currently using the DataLayout-independent constant
folding interface. This is a workaround since we can't directly call
ConstantExpr::getGetElementPtr due to deprecation. This patch shows that
the constant folding interface we are using is not good enough.

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


  Commit: 1d0476cb4d152872d7df20eb3330d9e53fff5a3a
      https://github.com/llvm/llvm-project/commit/1d0476cb4d152872d7df20eb3330d9e53fff5a3a
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2023-07-11 (Tue, 11 Jul 2023)

  Changed paths:
    M llvm/lib/Transforms/IPO/FunctionSpecialization.cpp
    M llvm/unittests/Transforms/IPO/FunctionSpecializationTest.cpp

  Log Message:
  -----------
  [FuncSpec] Prefer DataLayout-aware constant folding of GEPs.

As shown in D154820, the DataLayout-independent constant folding
interface is not good enough for handling GEPs. Instead we should
be using the DataLayout-aware constant folding interface. Since
there isn't a method to specifically handle GEPs we can use the
one which folds generic instruction operands.

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


Compare: https://github.com/llvm/llvm-project/compare/50278b5418e3...1d0476cb4d15


More information about the All-commits mailing list