[all-commits] [llvm/llvm-project] 5dc4e7: [VectorCombine] scalarizeBinop - support an all-co...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Tue Jun 9 11:03:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 5dc4e7c2b95fc665c1dc86c6b40cf02171f8801d
      https://github.com/llvm/llvm-project/commit/5dc4e7c2b95fc665c1dc86c6b40cf02171f8801d
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2020-06-09 (Tue, 09 Jun 2020)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/VectorCombine.cpp
    M llvm/test/Transforms/PhaseOrdering/X86/scalarization.ll
    M llvm/test/Transforms/VectorCombine/X86/insert-binop-with-constant.ll

  Log Message:
  -----------
  [VectorCombine] scalarizeBinop - support an all-constant src vector operand

scalarizeBinop currently folds

  vec_bo((inselt VecC0, V0, Index), (inselt VecC1, V1, Index))
  ->
  inselt(vec_bo(VecC0, VecC1), scl_bo(V0,V1), Index)

This patch extends this to account for cases where one of the vec_bo operands is already all-constant and performs similar cost checks to determine if the scalar binop with a constant still makes sense:

  vec_bo((inselt VecC0, V0, Index), VecC1)
  ->
  inselt(vec_bo(VecC0, VecC1), scl_bo(V0,extractelt(V1,Index)), Index)

Fixes PR42174

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




More information about the All-commits mailing list