-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[AArch64][GlobalISel] Disable fixed-point iteration in all Combiners #102167
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
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 |
---|---|---|
|
@@ -9,6 +9,8 @@ body: | | |
bb.1: | ||
; CHECK-LABEL: name: crash_fn | ||
; CHECK: [[C:%[0-9]+]]:_(p0) = G_CONSTANT i64 0 | ||
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 | ||
; CHECK-NEXT: [[C2:%[0-9]+]]:_(s1) = G_CONSTANT i1 false | ||
Comment on lines
+12
to
+13
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. These are dead in the input IR, which doesn't happen inside the CodeGen pipeline. |
||
; CHECK-NEXT: [[ZEXTLOAD:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[C]](p0) :: (load (s16), align 8) | ||
; CHECK-NEXT: [[ZEXTLOAD1:%[0-9]+]]:_(s32) = G_ZEXTLOAD [[C]](p0) :: (load (s16)) | ||
; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ZEXTLOAD1]], [[ZEXTLOAD]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,21 +64,28 @@ body: | | |
; LOWER-NEXT: {{ $}} | ||
; LOWER-NEXT: %reg0:_(s64) = COPY $x0 | ||
; LOWER-NEXT: %cmp_lhs:_(s64) = G_SEXT_INREG %reg0, 8 | ||
; LOWER-NEXT: %reg1:_(s64) = COPY $x1 | ||
; LOWER-NEXT: %cmp1:_(s32) = G_ICMP intpred(sge), %cmp_lhs(s64), %reg1 | ||
; LOWER-NEXT: %add:_(s64) = G_ADD %cmp_lhs, %reg0 | ||
; LOWER-NEXT: %cmp2:_(s32) = G_ICMP intpred(sge), %cmp_lhs(s64), %add | ||
; LOWER-NEXT: $w0 = COPY %cmp2(s32) | ||
; LOWER-NEXT: RET_ReallyLR implicit $w0 | ||
; LOWER-NEXT: $w1 = COPY %cmp1(s32) | ||
; LOWER-NEXT: RET_ReallyLR implicit $w0, implicit $w1 | ||
; | ||
; SELECT-LABEL: name: dont_swap_more_than_one_use | ||
; SELECT: liveins: $x0, $x1 | ||
; SELECT-NEXT: {{ $}} | ||
; SELECT-NEXT: %reg0:gpr64 = COPY $x0 | ||
; SELECT-NEXT: %cmp_lhs:gpr64 = SBFMXri %reg0, 0, 7 | ||
; SELECT-NEXT: %reg1:gpr64 = COPY $x1 | ||
; SELECT-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr %cmp_lhs, %reg1, implicit-def $nzcv | ||
; SELECT-NEXT: %cmp1:gpr32 = CSINCWr $wzr, $wzr, 11, implicit $nzcv | ||
; SELECT-NEXT: %add:gpr64 = ADDXrr %cmp_lhs, %reg0 | ||
; SELECT-NEXT: [[SUBSXrr:%[0-9]+]]:gpr64 = SUBSXrr %cmp_lhs, %add, implicit-def $nzcv | ||
; SELECT-NEXT: [[SUBSXrr1:%[0-9]+]]:gpr64 = SUBSXrr %cmp_lhs, %add, implicit-def $nzcv | ||
; SELECT-NEXT: %cmp2:gpr32 = CSINCWr $wzr, $wzr, 11, implicit $nzcv | ||
; SELECT-NEXT: $w0 = COPY %cmp2 | ||
; SELECT-NEXT: RET_ReallyLR implicit $w0 | ||
; SELECT-NEXT: $w1 = COPY %cmp1 | ||
; SELECT-NEXT: RET_ReallyLR implicit $w0, implicit $w1 | ||
%reg0:_(s64) = COPY $x0 | ||
%cmp_lhs:_(s64) = G_SEXT_INREG %reg0, 8 | ||
%reg1:_(s64) = COPY $x1 | ||
|
@@ -88,7 +95,8 @@ body: | | |
%cmp2:_(s32) = G_ICMP intpred(sge), %cmp_lhs(s64), %add | ||
|
||
$w0 = COPY %cmp2(s32) | ||
RET_ReallyLR implicit $w0 | ||
$w1 = COPY %cmp1(s32) | ||
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. cmp1 was dead in the input IR, but according to the comment this seems unintended, so I have fixed this. |
||
RET_ReallyLR implicit $w0, implicit $w1 | ||
|
||
... | ||
--- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,7 @@ define noundef i1 @logger(i32 noundef %logLevel, ptr %ea, ptr %pll) { | |
; CHECK-GI-NEXT: b.hi .LBB1_2 | ||
; CHECK-GI-NEXT: // %bb.1: // %land.rhs | ||
; CHECK-GI-NEXT: ldr x8, [x1] | ||
; CHECK-GI-NEXT: ldrb w8, [x8] | ||
; CHECK-GI-NEXT: and w0, w8, #0x1 | ||
; CHECK-GI-NEXT: ldrb w0, [x8] | ||
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. The immediate DCEing and better ordering of combines prevents the PreLegalizerCombiner from generating a bunch of useless artifacts that it can't combine away again. These artifacts are converted into G_AND by the ArtifactCombiner, which can't be combined away by the redundant_and combine, because KnownBits can't look through the implicit anyext of the G_LOAD. We are probably missing some combines that convert the load into sext/zext versions. |
||
; CHECK-GI-NEXT: .LBB1_2: // %land.end | ||
; CHECK-GI-NEXT: ret | ||
entry: | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expanding the div generates a bunch of instructions and the order in which the combines are applied results in different ouput