HomePhabricator

[LoopVectorize] Refine hasIrregularType predicate

Authored by LemonBoy on Mar 17 2021, 8:59 AM.

Description

[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

Details

Committed
LemonBoyMar 17 2021, 9:03 AM
Reviewer
lebedev.ri
Differential Revision
D97465: [LoopVectorize] Refine hasIrregularType predicate
Parents
rG6b025da443a4: [Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp
Branches
Unknown
Tags
Unknown