[all-commits] [llvm/llvm-project] 816663: [SVE] In LoopIdiomRecognize::isLegalStore bail out...

david-arm via All-commits all-commits at lists.llvm.org
Mon Sep 14 03:29:28 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 816663adb5f1362597c9b2947586e0847c5cdf9b
      https://github.com/llvm/llvm-project/commit/816663adb5f1362597c9b2947586e0847c5cdf9b
  Author: David Sherwood <david.sherwood at arm.com>
  Date:   2020-09-14 (Mon, 14 Sep 2020)

  Changed paths:
    M llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
    A llvm/test/Transforms/LoopIdiom/memcpy-vectors.ll

  Log Message:
  -----------
  [SVE] In LoopIdiomRecognize::isLegalStore bail out for scalable vectors

The function LoopIdiomRecognize::isLegalStore looks for stores in loops
that could be transformed into memset or memcpy. However, the algorithm
currently requires that we know how big the store is at runtime, i.e.
that the store size will not overflow an unsigned integer. For scalable
vectors we cannot guarantee this so I have changed the code to bail out
for now. In addition, even if we add a way to query the maximum value of
vscale in future we will still need to update the algorithm to cope with
non-constant strides. The additional cost associated with calculating
the memset and memcpy arguments will need to be taken into account as
well.

This patch also fixes up an implicit TypeSize -> uint64_t cast,
thereby removing a warning. I've added tests here showing a fixed
width vector loop being transformed into memcpy, and a scalable
vector loop remaining unchanged:

  Transforms/LoopIdiom/memcpy-vectors.ll

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




More information about the All-commits mailing list