Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPWBS-1485] feat(InstructionSelector): select G_FREEZE to COPY
Select G_FREEZE to COPY as there is no FREEZE MIR instruction. This matches the behavior in SelectionDAG and other backends. add selection tests
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py | ||
# RUN: llc -O0 -mtriple=tricore -global-isel -run-pass=instruction-select \ | ||
# RUN: -verify-machineinstrs %s -o - | FileCheck %s | ||
|
||
--- | ||
name: test_freeze_p0 | ||
legalized: true | ||
regBankSelected: true | ||
registers: | ||
- { id: 0, class: addrregbank } | ||
- { id: 1, class: addrregbank } | ||
body: | | ||
bb.0: | ||
liveins: $a4 | ||
; CHECK-LABEL: name: test_freeze_p0 | ||
; CHECK: [[COPY:%[0-9]+]]:addrregs = COPY $a4 | ||
; CHECK: $a2 = COPY [[COPY]] | ||
%0(p0) = COPY $a4 | ||
%1(p0) = G_FREEZE %0 | ||
$a2 = COPY %1(p0) | ||
... | ||
|
||
--- | ||
name: test_freeze_s32 | ||
legalized: true | ||
regBankSelected: true | ||
registers: | ||
- { id: 0, class: dataregbank } | ||
- { id: 1, class: dataregbank } | ||
body: | | ||
bb.0: | ||
liveins: $d4 | ||
; CHECK-LABEL: name: test_freeze_s32 | ||
; CHECK: [[COPY:%[0-9]+]]:dataregs = COPY $d4 | ||
; CHECK: $d2 = COPY [[COPY]] | ||
%0(s32) = COPY $d4 | ||
%1(s32) = G_FREEZE %0 | ||
$d2 = COPY %1(s32) | ||
... | ||
|
||
--- | ||
name: test_freeze_s64 | ||
legalized: true | ||
regBankSelected: true | ||
registers: | ||
- { id: 0, class: dataregbank } | ||
- { id: 1, class: dataregbank } | ||
body: | | ||
bb.0: | ||
liveins: $e4 | ||
; CHECK-LABEL: name: test_freeze_s64 | ||
; CHECK: [[COPY:%[0-9]+]]:extdataregs = COPY $e4 | ||
; CHECK: $e2 = COPY [[COPY]] | ||
%0(s64) = COPY $e4 | ||
%1(s64) = G_FREEZE %0 | ||
$e2 = COPY %1(s64) | ||
... |