[AArch64][SVE] Implement isVScaleKnownToBeAPowerOfTwo
authorDavid Green <david.green@arm.com>
Tue, 17 Jan 2023 15:49:29 +0000 (15:49 +0000)
committerDavid Green <david.green@arm.com>
Tue, 17 Jan 2023 15:49:29 +0000 (15:49 +0000)
commit1f2c37afbe69d048bc518363454ae073f588066e
tree2c994c25ce0a33ccaa70ab203a28d19800ec300c
parent004e613ce41fc14327e9b4bf215378a6150fe812
[AArch64][SVE] Implement isVScaleKnownToBeAPowerOfTwo

According to https://developer.arm.com/documentation/102105/ia-00/?lang=en

> Arm is making a retrospective change to the SVE architecture to remove
> the capability of selecting a non-power-of-two vector length in
> non-Streaming SVE as well as in Streaming SVE mode. Specific updates as
> a result of this change will be communicated in due course.

This patch implements the isVScaleKnownToBeAPowerOfTwo method to teach
DAG Combines that VScale will be known to be a power of 2, which helps
reduce or simplify some expressions (notably the udiv in vector trip
count expressions).

Differential Revision: https://reviews.llvm.org/D141486
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/test/CodeGen/AArch64/vscale-power-of-two.ll