forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LoongArch] Implement COPY instruction between CFRs (llvm#69300)
With this patch, all CFRs can be used for register allocation. (cherry picked from commit 271087e)
- Loading branch information
Showing
12 changed files
with
227 additions
and
14 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,34 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3 | ||
# RUN: llc --mtriple=loongarch64 --mattr=+d %s -o - | FileCheck %s | ||
|
||
## Check the PseudoCopyCFR instruction expand. | ||
|
||
--- | | ||
target datalayout = "e-m:e-p:64:64-i64:64-i128:128-n64-S128" | ||
target triple = "loongarch64" | ||
|
||
define void @test() { | ||
; CHECK-LABEL: test: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: fcmp.caf.s $fcc1, $fa0, $fa0 | ||
; CHECK-NEXT: bceqz $fcc0, .LBB0_2 | ||
; CHECK-NEXT: # %bb.1: | ||
; CHECK-NEXT: fcmp.cueq.s $fcc1, $fa0, $fa0 | ||
; CHECK-NEXT: .LBB0_2: | ||
; CHECK-NEXT: movcf2gr $a0, $fcc1 | ||
; CHECK-NEXT: ret | ||
ret void | ||
} | ||
... | ||
--- | ||
name: test | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
liveins: $fcc0 | ||
$fcc1 = COPY $fcc0 | ||
$r4 = COPY $fcc1 | ||
PseudoRET implicit killed $r4 | ||
... |
This file contains 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,26 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc --mtriple=loongarch64 --mattr=+d --stop-after=postrapseudos %s \ | ||
# RUN: -o - | FileCheck %s | ||
|
||
## Check the COPY instruction between CFRs. | ||
## A pseudo (PseudoCopyCFR) is generated after postrapseudos pass. | ||
|
||
... | ||
--- | ||
name: test | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0.entry: | ||
liveins: $fcc0 | ||
; CHECK-LABEL: name: test | ||
; CHECK: liveins: $fcc0 | ||
; CHECK-NEXT: {{ $}} | ||
; CHECK-NEXT: $fcc1 = PseudoCopyCFR $fcc0 | ||
; CHECK-NEXT: $r4 = MOVCF2GR killed $fcc1 | ||
; CHECK-NEXT: PseudoRET implicit killed $r4 | ||
$fcc1 = COPY $fcc0 | ||
$r4 = COPY $fcc1 | ||
PseudoRET implicit killed $r4 | ||
... |
This file contains 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
This file contains 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