[all-commits] [llvm/llvm-project] 96f678: [VectorUtils] Teach findScalarElement to return sp...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Mon Sep 6 02:56:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96f6785bc9fe3219e9486ff09b22b31fa0c73b34
      https://github.com/llvm/llvm-project/commit/96f6785bc9fe3219e9486ff09b22b31fa0c73b34
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2021-09-06 (Mon, 06 Sep 2021)

  Changed paths:
    M llvm/lib/Analysis/VectorUtils.cpp
    M llvm/test/Transforms/InstCombine/vscale_extractelement.ll

  Log Message:
  -----------
  [VectorUtils] Teach findScalarElement to return splat value.

If the vector is a splat of some scalar value, findScalarElement()
can simply return the scalar value if it knows the requested lane
is in the vector.

This is only needed for scalable vectors, because the InsertElement/ShuffleVector
case is already handled explicitly for the fixed-width case.

This helps to recognize an InstCombine fold like:
  extractelt(bitcast(splat(%v))) -> bitcast(%v)

Reviewed By: spatel

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




More information about the All-commits mailing list