[llvm] [GlobalISel] Add G_STEP_VECTOR to computeKnownBits. (PR #190598)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 10:48:17 PDT 2026
================
@@ -0,0 +1,59 @@
+# NOTE: Assertions have been autogenerated by utils/update_givaluetracking_test_checks.py UTC_ARGS: --version 6
+# RUN: llc -mtriple=aarch64 -passes="print<gisel-value-tracking>" -filetype=null %s 2>&1 | FileCheck %s
+
+---
+name: StepVector_One
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: @StepVector_One
+ ; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1
+ %0:_(<vscale x 4 x s32>) = G_STEP_VECTOR i32 1
+...
+---
+name: StepVector_Pow2
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: @StepVector_Pow2
+ ; CHECK-NEXT: %0:_ KnownBits:????????????????????????????0000 SignBits:1
+ %0:_(<vscale x 4 x s32>) = G_STEP_VECTOR i32 16
+...
+---
+name: StepVector_NonPow2
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: @StepVector_NonPow2
+ ; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1
+ %0:_(<vscale x 4 x s32>) = G_STEP_VECTOR i32 3
+...
+---
+name: StepVector_Narrow
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: @StepVector_Narrow
+ ; CHECK-NEXT: %0:_ KnownBits:???????? SignBits:1
+ %0:_(<vscale x 8 x s8>) = G_STEP_VECTOR i8 1
+...
+---
+name: StepVector_Narrow_Pow2
+body: |
+ bb.0:
+ ; CHECK-LABEL: name: @StepVector_Narrow_Pow2
+ ; CHECK-NEXT: %0:_ KnownBits:??????00 SignBits:1
+ %0:_(<vscale x 8 x s8>) = G_STEP_VECTOR i8 4
+...
----------------
Xylecrack wrote:
Could you give an example of what you have in mind? According to my finding `G_STEP_VECTOR` doesnt accept negative steps.
```
bb.0:
%0:_(<vscale x 4 x s32>) = G_STEP_VECTOR i32 -1
# End machine code for function StepVector_Negative.
*** Bad machine code: step must be > 0 ***
- function: StepVector_Negative
- basic block: %bb.0 (0x559780af4a98)
- instruction: %0:_(<vscale x 4 x s32>) = G_STEP_VECTOR i32 -1
```
https://github.com/llvm/llvm-project/pull/190598
More information about the llvm-commits
mailing list