36 lines · plain
1// RUN: llvm-tblgen -warn-on-skipped-patterns -gen-global-isel -I %p/../../../include %s -I %p/../Common -o /dev/null 2>&1 | FileCheck %s2// 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 %s3 4include "llvm/Target/Target.td"5include "GlobalISelEmitterCommon.td"6 7//===- Boiler plate target code -===//8 9def complex : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPattern", []> {10 let MIOperandInfo = (ops i32imm, i32imm);11}12 13def gi_complex :14 GIComplexOperandMatcher<s32, "selectComplexPattern">,15 GIComplexPatternEquiv<complex>;16def complex_rr : Operand<i32>, ComplexPattern<i32, 2, "SelectComplexPatternRR", []> {17 let MIOperandInfo = (ops GPR32, GPR32);18}19 20def gi_complex_rr :21 GIComplexOperandMatcher<s32, "selectComplexPatternRR">,22 GIComplexPatternEquiv<complex_rr>;23 24def INSN : I<(outs GPR32:$dst), (ins GPR32:$src1, complex:$src2), []>;25 26//===- Bail out when we define a variable twice wrt complex suboperands. -===//27 28#ifdef IGNORE29let GISelShouldIgnore = 1 in30#endif31// 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.33def : Pat<(add (complex_rr GPR32:$x, GPR32:$y),34 (complex_rr GPR32:$x, GPR32:$z)),35 (INSN GPR32:$z, complex:$y)>;36