[all-commits] [llvm/llvm-project] 31001b: [LoopVectorize] Refine hasIrregularType predicate

LemonBoy via All-commits all-commits at lists.llvm.org
Wed Mar 31 12:11:22 PDT 2021


  Branch: refs/heads/release/12.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 31001be371e8f2c74470e727e54503fb2aabec8b
      https://github.com/llvm/llvm-project/commit/31001be371e8f2c74470e727e54503fb2aabec8b
  Author: LemonBoy <thatlemon at gmail.com>
  Date:   2021-03-31 (Wed, 31 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

(cherry picked from commit 4f024938e4c932feba4d28573ec4522106f8d879)




More information about the All-commits mailing list