-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[DAG] Refactor X86 combineVSelectWithAllOnesOrZeros fold into a generic DAG Combine #145298
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,9 +114,10 @@ define i64 @not_sign_i64_4(i64 %a) { | |
define <7 x i8> @sign_7xi8(<7 x i8> %a) { | ||
; CHECK-LABEL: sign_7xi8: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: movi v1.8b, #1 | ||
; CHECK-NEXT: cmlt v0.8b, v0.8b, #0 | ||
; CHECK-NEXT: orr v0.8b, v0.8b, v1.8b | ||
; CHECK-NEXT: movi v1.2d, #0xffffffffffffffff | ||
; CHECK-NEXT: movi v2.8b, #1 | ||
; CHECK-NEXT: cmge v0.8b, v1.8b, v0.8b | ||
; CHECK-NEXT: orr v0.8b, v0.8b, v2.8b | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. regression? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to remove (VSELECT setgt, iN lhs, -1, 1, -1) pattern from AArch64 to DAGCombine, I will modify it. |
||
; CHECK-NEXT: ret | ||
%c = icmp sgt <7 x i8> %a, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1> | ||
%res = select <7 x i1> %c, <7 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, <7 x i8> <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1> | ||
|
@@ -150,7 +151,8 @@ define <16 x i8> @sign_16xi8(<16 x i8> %a) { | |
define <3 x i32> @sign_3xi32(<3 x i32> %a) { | ||
; CHECK-LABEL: sign_3xi32: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: cmlt v0.4s, v0.4s, #0 | ||
; CHECK-NEXT: movi v1.2d, #0xffffffffffffffff | ||
; CHECK-NEXT: cmge v0.4s, v1.4s, v0.4s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. regression? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same to above |
||
; CHECK-NEXT: orr v0.4s, #1 | ||
; CHECK-NEXT: ret | ||
%c = icmp sgt <3 x i32> %a, <i32 -1, i32 -1, i32 -1> | ||
|
@@ -197,11 +199,9 @@ define <4 x i32> @not_sign_4xi32(<4 x i32> %a) { | |
; CHECK-LABEL: not_sign_4xi32: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: adrp x8, .LCPI16_0 | ||
; CHECK-NEXT: movi v2.4s, #1 | ||
; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI16_0] | ||
; CHECK-NEXT: cmgt v0.4s, v0.4s, v1.4s | ||
; CHECK-NEXT: and v1.16b, v0.16b, v2.16b | ||
; CHECK-NEXT: orn v0.16b, v1.16b, v0.16b | ||
; CHECK-NEXT: cmge v0.4s, v1.4s, v0.4s | ||
; CHECK-NEXT: orr v0.4s, #1 | ||
; CHECK-NEXT: ret | ||
%c = icmp sgt <4 x i32> %a, <i32 1, i32 -1, i32 -1, i32 -1> | ||
%res = select <4 x i1> %c, <4 x i32> <i32 1, i32 1, i32 1, i32 1>, <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> | ||
|
Uh oh!
There was an error while loading. Please reload this page.