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 include "llvm/Target/Target.td"
3 include "GlobalISelEmitterCommon.td"
5 //===- Boiler plate target code -===//
7 def complex : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPattern", []> {
8 let MIOperandInfo = (ops i32imm, i32imm);
12 GIComplexOperandMatcher<s32, "selectComplexPattern">,
13 GIComplexPatternEquiv<complex>;
14 def complex_rr : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPatternRR", []> {
15 let MIOperandInfo = (ops GPR32, GPR32);
19 GIComplexOperandMatcher<s32, "selectComplexPatternRR">,
20 GIComplexPatternEquiv<complex_rr>;
22 def INSN : I<(outs GPR32:$dst), (ins GPR32:$src1, complex:$src2), []>;
24 //===- Bail out when we define a variable twice wrt complex suboperands. -===//
26 // CHECK: warning: Skipped pattern: Complex suboperand referenced more than once (Operand: x)
27 def : Pat<(add (complex_rr GPR32:$x, GPR32:$y),
28 (complex_rr GPR32:$x, GPR32:$z)),
29 (INSN GPR32:$z, complex:$y)>;