[all-commits] [llvm/llvm-project] 26e1eb: [GlobalISel] Change ConstantFoldVectorBinop to ret...

Jay Foad via All-commits all-commits at lists.llvm.org
Fri May 13 01:35:47 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 26e1ebd3ea2cc37a533f16f008d4b05e50a6a5dc
      https://github.com/llvm/llvm-project/commit/26e1ebd3ea2cc37a533f16f008d4b05e50a6a5dc
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2022-05-13 (Fri, 13 May 2022)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
    M llvm/include/llvm/CodeGen/GlobalISel/Utils.h
    M llvm/lib/CodeGen/GlobalISel/CSEMIRBuilder.cpp
    M llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
    M llvm/lib/CodeGen/GlobalISel/Utils.cpp
    M llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-constant-fold-vector-op.ll
    M llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-getelementptr.ll

  Log Message:
  -----------
  [GlobalISel] Change ConstantFoldVectorBinop to return vector of APInt

Previously it built MIR for the results and returned a Register.

This avoids building constants for earlier elements of the vector if
later elements will fail to fold, and allows CSEMIRBuilder::buildInstr
to avoid unconditionally building a copy from the result.

Use a new helper function MachineIRBuilder::buildBuildVectorConstant
to build a G_BUILD_VECTOR of G_CONSTANTs.

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




More information about the All-commits mailing list