-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[GlobalISel] Fix ZExt known bits for scalable vectors. #140213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
llvm/test/CodeGen/AArch64/GlobalISel/knownbits-assertzext.mir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_givaluetracking_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple aarch64 -mattr=+sve -passes="print<gisel-value-tracking>" %s -filetype=null 2>&1 | FileCheck %s | ||
|
||
--- | ||
name: ScalarConst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarConst | ||
; CHECK-NEXT: %0:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
; CHECK-NEXT: %1:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
%0:_(s32) = G_CONSTANT i32 120 | ||
%1:_(s32) = G_ASSERT_ZEXT %0(s32), 16 | ||
... | ||
--- | ||
name: ScalarVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(s32) = COPY $w0 | ||
%1:_(s32) = G_ASSERT_ZEXT %0(s32), 16 | ||
... | ||
--- | ||
name: VectorCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorCst | ||
; CHECK-NEXT: %0:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
; CHECK-NEXT: %1:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
; CHECK-NEXT: %2:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
%0:_(s32) = G_CONSTANT i32 120 | ||
%1:_(<4 x s32>) = G_BUILD_VECTOR %0, %0, %0, %0 | ||
%2:_(<4 x s32>) = G_ASSERT_ZEXT %1(<4 x s32>), 16 | ||
... | ||
--- | ||
name: VectorVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(<4 x s32>) = COPY $q0 | ||
%1:_(<4 x s32>) = G_ASSERT_ZEXT %0(<4 x s32>), 16 | ||
... | ||
--- | ||
name: ScalableCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableCst | ||
; CHECK-NEXT: %0:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
; CHECK-NEXT: %1:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
; CHECK-NEXT: %2:_ KnownBits:00000000000000000000000001111000 SignBits:25 | ||
%0:_(s32) = G_CONSTANT i32 120 | ||
%1:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR %0 | ||
%2:_(<vscale x 4 x s32>) = G_ASSERT_ZEXT %1(<vscale x 4 x s32>), 16 | ||
... | ||
--- | ||
name: ScalableVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(<vscale x 4 x s32>) = COPY $z0 | ||
%1:_(<vscale x 4 x s32>) = G_ASSERT_ZEXT %0(<vscale x 4 x s32>), 16 | ||
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_givaluetracking_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple aarch64 -passes="print<gisel-value-tracking>" %s -filetype=null 2>&1 | FileCheck %s | ||
|
||
--- | ||
name: ScalarConst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarConst | ||
; CHECK-NEXT: %0:_ KnownBits:10101001100001110110010101000011 SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0110010101000011 SignBits:1 | ||
%0:_(s32) = G_CONSTANT i32 2844222787 | ||
%1:_(s16) = G_TRUNC %0(s32) | ||
... | ||
--- | ||
name: ScalarVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:1 | ||
%0:_(s32) = COPY $w0 | ||
%1:_(s16) = G_TRUNC %0(s32) | ||
... | ||
--- | ||
name: VectorCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorCst | ||
; CHECK-NEXT: %0:_ KnownBits:10101001100001110110010101000011 SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:10101001100001110110010101000011 SignBits:1 | ||
; CHECK-NEXT: %2:_ KnownBits:0110010101000011 SignBits:1 | ||
%0:_(s32) = G_CONSTANT i32 2844222787 | ||
%1:_(<4 x s32>) = G_BUILD_VECTOR %0, %0, %0, %0 | ||
%2:_(<4 x s16>) = G_TRUNC %1(<4 x s32>) | ||
... | ||
--- | ||
name: VectorVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:1 | ||
%0:_(<4 x s32>) = COPY $q0 | ||
%1:_(<4 x s16>) = G_TRUNC %0(<4 x s32>) | ||
... | ||
--- | ||
name: ScalableCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableCst | ||
; CHECK-NEXT: %0:_ KnownBits:10101001100001110110010101000011 SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:10101001100001110110010101000011 SignBits:1 | ||
; CHECK-NEXT: %2:_ KnownBits:0110010101000011 SignBits:1 | ||
%0:_(s32) = G_CONSTANT i32 2844222787 | ||
%1:_(<vscale x 4 x s32>) = G_SPLAT_VECTOR %0 | ||
%2:_(<vscale x 4 x s16>) = G_TRUNC %1(<vscale x 4 x s32>) | ||
... | ||
--- | ||
name: ScalableVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????????????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:???????????????? SignBits:1 | ||
%0:_(<vscale x 4 x s32>) = COPY $z0 | ||
%1:_(<vscale x 4 x s16>) = G_TRUNC %0(<vscale x 4 x s32>) | ||
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_givaluetracking_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple aarch64 -mattr=+sve -passes="print<gisel-value-tracking>" %s -filetype=null 2>&1 | FileCheck %s | ||
|
||
--- | ||
name: ScalarConst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarConst | ||
; CHECK-NEXT: %0:_ KnownBits:0000000000001010 SignBits:12 | ||
; CHECK-NEXT: %1:_ KnownBits:00000000000000000000000000001010 SignBits:28 | ||
%0:_(s16) = G_CONSTANT i16 10 | ||
%1:_(s32) = G_ZEXT %0(s16) | ||
... | ||
--- | ||
name: ScalarVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalarVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(s16) = COPY $h0 | ||
%1:_(s32) = G_ZEXT %0(s16) | ||
... | ||
--- | ||
name: VectorCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorCst | ||
; CHECK-NEXT: %0:_ KnownBits:0000000000001010 SignBits:12 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000001010 SignBits:12 | ||
; CHECK-NEXT: %2:_ KnownBits:00000000000000000000000000001010 SignBits:28 | ||
%0:_(s16) = G_CONSTANT i16 10 | ||
%1:_(<4 x s16>) = G_BUILD_VECTOR %0, %0, %0, %0 | ||
%2:_(<4 x s32>) = G_ZEXT %1(<4 x s16>) | ||
... | ||
--- | ||
name: VectorVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @VectorVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(<4 x s16>) = COPY $d0 | ||
%1:_(<4 x s32>) = G_ZEXT %0(<4 x s16>) | ||
... | ||
--- | ||
name: ScalableCst | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableCst | ||
; CHECK-NEXT: %0:_ KnownBits:0000000000001010 SignBits:12 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000001010 SignBits:1 | ||
; CHECK-NEXT: %2:_ KnownBits:00000000000000000000000000001010 SignBits:28 | ||
%0:_(s16) = G_CONSTANT i16 10 | ||
%1:_(<vscale x 4 x s16>) = G_SPLAT_VECTOR %0 | ||
%2:_(<vscale x 4 x s32>) = G_ZEXT %1(<vscale x 4 x s16>) | ||
... | ||
--- | ||
name: ScalableVar | ||
body: | | ||
bb.0: | ||
; CHECK-LABEL: name: @ScalableVar | ||
; CHECK-NEXT: %0:_ KnownBits:???????????????? SignBits:1 | ||
; CHECK-NEXT: %1:_ KnownBits:0000000000000000???????????????? SignBits:16 | ||
%0:_(<vscale x 4 x s16>) = COPY $z0 | ||
%1:_(<vscale x 4 x s32>) = G_ZEXT %0(<vscale x 4 x s16>) | ||
... |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.