Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[globalisel][tablegen] Add support for importing 'imm' operands.
Summary: This patch enables the import of rules containing 'imm' operands that do not constrain the acceptable values using predicates. Support for ImmLeaf will arrive in a later patch. Depends on D35681 Reviewers: ab, t.p.northover, qcolombet, rovka, aditya_nandakumar Reviewed By: rovka Subscribers: kristof.beyls, javed.absar, igorb, llvm-commits Differential Revision: https://reviews.llvm.org/D35833 llvm-svn: 310343
- Loading branch information
1 parent
6e35c31
commit 0554004
Showing
8 changed files
with
233 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# RUN: llc -O0 -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs -global-isel %s -o - | FileCheck %s | ||
|
||
--- | | ||
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" | ||
|
||
define void @imm_s32_gpr() { ret void } | ||
define void @imm_s64_gpr() { ret void } | ||
|
||
... | ||
|
||
--- | ||
# Check that we select a 32-bit immediate into a MOVi32imm. | ||
# CHECK-LABEL: name: imm_s32_gpr | ||
name: imm_s32_gpr | ||
legalized: true | ||
regBankSelected: true | ||
|
||
# CHECK: registers: | ||
# CHECK-NEXT: - { id: 0, class: gpr32, preferred-register: '' } | ||
registers: | ||
- { id: 0, class: gpr } | ||
|
||
# CHECK: body: | ||
# CHECK: %0 = MOVi32imm -1234 | ||
body: | | ||
bb.0: | ||
liveins: %w0, %w1 | ||
%0(s32) = G_CONSTANT i32 -1234 | ||
%w0 = COPY %0(s32) | ||
... | ||
|
||
--- | ||
# Check that we select a 64-bit immediate into a MOVi64imm. | ||
# CHECK-LABEL: name: imm_s64_gpr | ||
name: imm_s64_gpr | ||
legalized: true | ||
regBankSelected: true | ||
|
||
# CHECK: registers: | ||
# CHECK-NEXT: - { id: 0, class: gpr64, preferred-register: '' } | ||
registers: | ||
- { id: 0, class: gpr } | ||
|
||
# CHECK: body: | ||
# CHECK: %0 = MOVi64imm 1234 | ||
body: | | ||
bb.0: | ||
liveins: %w0, %w1 | ||
%0(s64) = G_CONSTANT i64 1234 | ||
%w0 = COPY %0(s64) | ||
... |
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
Oops, something went wrong.