[all-commits] [llvm/llvm-project] 014c4b: [VNCoercion] Use ConstantFoldLoadFromConst API (NFCI)

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Jun 30 05:52:43 PDT 2022


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

  Changed paths:
    M llvm/lib/Transforms/Scalar/NewGVN.cpp
    M llvm/lib/Transforms/Utils/VNCoercion.cpp

  Log Message:
  -----------
  [VNCoercion] Use ConstantFoldLoadFromConst API (NFCI)

Nowdays we have a generic constant folding API to load a type from
an offset. It should be able to do anything that VNCoercion can do.

This avoids the weird templating between IRBuilder and ConstantFolder
in one function, which is will stop working as the IRBuilderFolder
moves from CreateXYZ to FoldXYZ APIs.

Unfortunately, this doesn't eliminate this pattern from VNCoercion
entirely yet.




More information about the All-commits mailing list