[all-commits] [llvm/llvm-project] 523839: [DAG] Replace DAGCombiner::ConstantFoldBITCASTofBU...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Mon Jul 7 02:44:24 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52383956f8b7184aec14b5c8fe90aebd9f0a186f
      https://github.com/llvm/llvm-project/commit/52383956f8b7184aec14b5c8fe90aebd9f0a186f
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2025-07-07 (Mon, 07 Jul 2025)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AMDGPU/llvm.amdgcn.iglp.AFLCustomIRMutator.opt.ll

  Log Message:
  -----------
  [DAG] Replace DAGCombiner::ConstantFoldBITCASTofBUILD_VECTOR with SelectionDAG::FoldConstantBuildVector (#147037)

DAGCombiner can already constant fold build vectors of constants/undefs
to a new vector type, but it has to be incredibly careful after
legalization to not affect a target's canonicalized constants.

This patch proposes we move the implementation inside SelectionDAG to
make it easier for targets to manually use the constant folding whenever
it deems it safe to do so.

I've also altered the method to take the BuildVectorSDNode input
directly and consistently use the same SDLoc.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list