[all-commits] [llvm/llvm-project] ce3941: [InstCombine] Add more complex folds for extractel...

david-arm via All-commits all-commits at lists.llvm.org
Tue Aug 10 01:17:37 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ce394161cb5d3fcca04b74d9a5dfafb80ff29542
      https://github.com/llvm/llvm-project/commit/ce394161cb5d3fcca04b74d9a5dfafb80ff29542
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2021-08-10 (Tue, 10 Aug 2021)

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

  Log Message:
  -----------
  [InstCombine] Add more complex folds for extractelement + stepvector

I have updated cheapToScalarize to also consider the case when
extracting lanes from a stepvector intrinsic. This required removing
the existing 'bool IsConstantExtractIndex' and passing in the actual
index as a Value instead. We do this because we need to know if the
index is <= known minimum number of elements returned by the stepvector
intrinsic. Effectively, when extracting lane X from a stepvector we
know the value returned is also X.

New tests added here:

  Transforms/InstCombine/vscale_extractelement.ll

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




More information about the All-commits mailing list