File: undef-tied-input.td

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (35 lines) | stat: -rw-r--r-- 1,651 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// RUN: llvm-tblgen -gen-global-isel -warn-on-skipped-patterns \
// RUN:   -I %p/../../../include -I %p/../Common %s 2> %t | FileCheck %s
// RUN: FileCheck -check-prefix=ERR %s < %t

include "llvm/Target/Target.td"
include "GlobalISelEmitterCommon.td"

def undef_tied_1 : OperandWithDefaultOps<untyped, (ops (i32 undef_tied_input))> {
  let MIOperandInfo = (ops GPR32:$inactive);
}

def undef_tied_2 : OperandWithDefaultOps<i32, (ops (untyped undef_tied_input))> {
  let MIOperandInfo = (ops GPR32:$inactive);
}

let Constraints = "$opt.inactive = $rd" in
def I1 : I<(outs GPR32:$rd), (ins GPR32:$rs, undef_tied_1:$opt),
           [(set GPR32:$rd, (abs i32:$rs))]>;

// ERR: [[#@LINE+2]]:5: warning: Skipped pattern: unsupported type
let Constraints = "$opt.inactive = $rd" in
def I2 : I<(outs GPR32:$rd), (ins GPR32:$rs, undef_tied_2:$opt),
           [(set GPR32:$rd, (abs i32:$rs))]>;

// CHECK-LABEL: // (abs:{ *:[i32] } i32:{ *:[i32] }:$rs)  =>  (I1:{ *:[i32] } i32:{ *:[i32] }:$rs)
// CHECK-NEXT: GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
// CHECK-NEXT: GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(TargetOpcode::IMPLICIT_DEF),
// CHECK-NEXT: GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(RegState::Define),
// CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::I1),
// CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/0, // DstI[rd]
// CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/1, // rs
// CHECK-NEXT: GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
// CHECK-NEXT: GIR_RootConstrainSelectedInstOperands,
// CHECK-NEXT: // GIR_Coverage, 0,
// CHECK-NEXT: GIR_EraseRootFromParent_Done,