Skip to content

Commit 563611c

Browse files
huntergr-armkbluck
authored andcommitted
[LSR] Recognize vscale-relative immediates (llvm#88124)
Extends LoopStrengthReduce to recognize immediates multiplied by vscale, and query the current target for whether they are legal offsets for memory operations or adds.
1 parent 82d874a commit 563611c

File tree

3 files changed

+818
-187
lines changed

3 files changed

+818
-187
lines changed

llvm/include/llvm/Support/TypeSize.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ template <typename LeafTy, typename ValueTy> class FixedOrScalableQuantity {
170170
/// Returns whether the quantity is scaled by a runtime quantity (vscale).
171171
constexpr bool isScalable() const { return Scalable; }
172172

173+
/// Returns true if the quantity is not scaled by vscale.
174+
constexpr bool isFixed() const { return !Scalable; }
175+
173176
/// A return value of true indicates we know at compile time that the number
174177
/// of elements (vscale * Min) is definitely even. However, returning false
175178
/// does not guarantee that the total number of elements is odd.

0 commit comments

Comments
 (0)