-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Reland "RegisterCoalescer: Add implicit-def of super register when coalescing SUBREG_TO_REG" #134408
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: users/sdesmalen-arm/srlt-commute-implicit-def
Are you sure you want to change the base?
Reland "RegisterCoalescer: Add implicit-def of super register when coalescing SUBREG_TO_REG" #134408
Changes from all commits
9559f62
c8cc773
875e232
16ac7ac
b9d9406
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc -enable-subreg-liveness=false < %s | FileCheck %s | ||
; RUN: llc -enable-subreg-liveness=true < %s | FileCheck %s | ||
|
||
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32" | ||
target triple = "aarch64-unknown-linux-gnu" | ||
|
||
define void @_ZN4llvm5APInt6divideEPKmjS2_jPmS3_(i32 %lhsWords, i32 %rhsWords) { | ||
; CHECK-LABEL: _ZN4llvm5APInt6divideEPKmjS2_jPmS3_: | ||
; CHECK: // %bb.0: | ||
; CHECK-NEXT: lsl w9, w0, #1 | ||
; CHECK-NEXT: mov w10, #1 // =0x1 | ||
; CHECK-NEXT: mov w8, w0 | ||
; CHECK-NEXT: mov w0, #1 // =0x1 | ||
; CHECK-NEXT: sub w9, w9, w1, lsl #1 | ||
; CHECK-NEXT: bfi w0, w8, #1, #31 | ||
; CHECK-NEXT: lsr w9, w9, #1 | ||
; CHECK-NEXT: bfi w10, w9, #2, #30 | ||
; CHECK-NEXT: cmp w10, #0 | ||
; CHECK-NEXT: b.hs .LBB0_2 | ||
; CHECK-NEXT: // %bb.1: // %if.then15 | ||
; CHECK-NEXT: lsl x8, x0, #2 | ||
; CHECK-NEXT: ldr xzr, [x8] | ||
; CHECK-NEXT: ret | ||
; CHECK-NEXT: .LBB0_2: | ||
; CHECK-NEXT: b _Znam | ||
%mul = shl i32 %rhsWords, 1 | ||
%mul1 = shl i32 %lhsWords, 1 | ||
%sub = sub i32 %mul1, %mul | ||
%add7 = or i32 %mul1, 1 | ||
%idxprom = zext i32 %add7 to i64 | ||
%mul3 = shl i32 %sub, 1 | ||
%add4 = or i32 %mul3, 1 | ||
%1 = icmp ult i32 %add4, 0 | ||
br i1 %1, label %if.then15, label %3 | ||
|
||
common.ret: ; preds = %3, %if.then15 | ||
ret void | ||
|
||
if.then15: ; preds = %0 | ||
%idxprom12 = zext i32 %add7 to i64 | ||
%arrayidx13 = getelementptr [128 x i32], ptr null, i64 0, i64 %idxprom12 | ||
%2 = load volatile ptr, ptr %arrayidx13, align 8 | ||
br label %common.ret | ||
|
||
3: ; preds = %0 | ||
%call = tail call ptr @_Znam(i64 %idxprom) | ||
br label %common.ret | ||
} | ||
|
||
declare ptr @_Znam(i64) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5 | ||
# RUN: llc -mtriple=aarch64 -start-before=register-coalescer -stop-after=virtregrewriter -enable-subreg-liveness=false -o - %s | FileCheck %s --check-prefix=SRLT | ||
# RUN: llc -mtriple=aarch64 -start-before=register-coalescer -stop-after=virtregrewriter -enable-subreg-liveness=true -o - %s | FileCheck %s --check-prefix=NOSRLT | ||
--- | ||
name: test | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $x1 | ||
; SRLT-LABEL: name: test | ||
; SRLT: liveins: $x1 | ||
; SRLT-NEXT: {{ $}} | ||
; SRLT-NEXT: renamable $x0 = COPY $x1 | ||
; SRLT-NEXT: renamable $w1 = ORRWrr $wzr, renamable $w0, implicit-def $x1 | ||
; SRLT-NEXT: RET_ReallyLR implicit $x1, implicit $x0 | ||
; | ||
; NOSRLT-LABEL: name: test | ||
; NOSRLT: liveins: $x1 | ||
; NOSRLT-NEXT: {{ $}} | ||
; NOSRLT-NEXT: renamable $x0 = COPY $x1 | ||
; NOSRLT-NEXT: renamable $w1 = ORRWrr $wzr, renamable $w0, implicit-def renamable $x1 | ||
; NOSRLT-NEXT: RET_ReallyLR implicit $x1, implicit $x0 | ||
%190:gpr64 = COPY killed $x1 | ||
%191:gpr32 = COPY %190.sub_32:gpr64 | ||
%192:gpr32 = ORRWrr $wzr, killed %191:gpr32 | ||
%193:gpr64all = SUBREG_TO_REG 0, killed %192:gpr32, %subreg.sub_32 | ||
$x0 = COPY killed %190:gpr64 | ||
$x1 = COPY killed %193:gpr64all | ||
RET_ReallyLR implicit $x1, implicit $x0 | ||
... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -329,11 +329,10 @@ define <2 x half> @chain_hi_to_lo_global() { | |
; GFX11-TRUE16: ; %bb.0: ; %bb | ||
; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v0, 2 | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX11-TRUE16-NEXT: v_dual_mov_b32 v1, 0 :: v_dual_mov_b32 v2, 0 | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v3, 0 | ||
; GFX11-TRUE16-NEXT: global_load_d16_b16 v0, v[0:1], off | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v1, 0 | ||
; GFX11-TRUE16-NEXT: v_mov_b32_e32 v2, 0 | ||
; GFX11-TRUE16-NEXT: global_load_d16_hi_b16 v0, v[1:2], off | ||
; GFX11-TRUE16-NEXT: global_load_d16_hi_b16 v0, v[2:3], off | ||
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. @broxigarchen I noticed these tests changed, but I couldn't really tell whether these changes are functionally equivalent. 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. Hi Sander, these changes seems good to me. Since I am not familiar with this pass, I will leave the approval to the other reviewers |
||
; GFX11-TRUE16-NEXT: s_waitcnt vmcnt(0) | ||
; GFX11-TRUE16-NEXT: s_setpc_b64 s[30:31] | ||
; | ||
|
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.
I don't think dead flags are required to be accurate, it might be safer to check if LiveIntervals thinks it's really daed