[all-commits] [llvm/llvm-project] 4f0249: [LoopVectorize] Refine hasIrregularType predicate

LemonBoy via All-commits all-commits at lists.llvm.org
Wed Mar 17 09:04:14 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4f024938e4c932feba4d28573ec4522106f8d879
      https://github.com/llvm/llvm-project/commit/4f024938e4c932feba4d28573ec4522106f8d879
  Author: LemonBoy <thatlemon at gmail.com>
  Date:   2021-03-17 (Wed, 17 Mar 2021)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    A llvm/test/Transforms/LoopVectorize/irregular_type.ll

  Log Message:
  -----------
  [LoopVectorize] Refine hasIrregularType predicate

The `hasIrregularType` predicate checks whether an array of N values of type Ty is "bitcast-compatible" with a <N x Ty> vector.
The previous check returned invalid results in some cases where there's some padding between the array elements: eg. a 4-element array of u7 values is considered as compatible with <4 x u7>, even though the vector is only loading/storing 28 bits instead of 32.

The problem causes LLVM to generate incorrect code for some targets: for AArch64 the vector loads/stores are lowered in terms of ubfx/bfi, effectively losing the top (N * padding bits).

Reviewed By: lebedev.ri

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




More information about the All-commits mailing list