1 // RUN: llvm-tblgen -warn-on-skipped-patterns -gen-global-isel -I %p/../../include %s -I %p/Common -o /dev/null 2>&1 | FileCheck %s
2 // RUN: llvm-tblgen -warn-on-skipped-patterns -gen-global-isel -I %p/../../include %s -I %p/Common -o /dev/null -DIGNORE 2>&1 | FileCheck --allow-empty --check-prefix=IGNORED %s
4 include "llvm/Target/Target.td"
5 include "GlobalISelEmitterCommon.td"
7 //===- Boiler plate target code -===//
9 def complex : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPattern", []> {
10 let MIOperandInfo = (ops i32imm, i32imm);
14 GIComplexOperandMatcher<s32, "selectComplexPattern">,
15 GIComplexPatternEquiv<complex>;
16 def complex_rr : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPatternRR", []> {
17 let MIOperandInfo = (ops GPR32, GPR32);
21 GIComplexOperandMatcher<s32, "selectComplexPatternRR">,
22 GIComplexPatternEquiv<complex_rr>;
24 def INSN : I<(outs GPR32:$dst), (ins GPR32:$src1, complex:$src2), []>;
26 //===- Bail out when we define a variable twice wrt complex suboperands. -===//
29 let GISelShouldIgnore = 1 in
31 // IGNORED-NOT: warning: Skipped pattern: Error: {{.*}}
32 // CHECK: warning: Skipped pattern: Error: Complex suboperand x referenced by different operands: complex_rr:x:y and complex_rr:x:z.
33 def : Pat<(add (complex_rr GPR32:$x, GPR32:$y),
34 (complex_rr GPR32:$x, GPR32:$z)),
35 (INSN GPR32:$z, complex:$y)>;