CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
95 lines
3.5 KiB
TableGen
95 lines
3.5 KiB
TableGen
// RUN: not llvm-tblgen -I %p/../../../../include -gen-global-isel-combiner \
|
|
// RUN: -combiners=MyCombiner %s 2>&1| \
|
|
// RUN: FileCheck %s -implicit-check-not=error:
|
|
|
|
include "llvm/Target/Target.td"
|
|
include "llvm/Target/GlobalISel/Combine.td"
|
|
|
|
def MyTargetISA : InstrInfo;
|
|
def MyTarget : Target { let InstructionSet = MyTargetISA; }
|
|
|
|
// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: expected operand 1 of 'GIReplaceReg' to be a name
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(GIReplaceReg ?:$dst, (i32 0))'
|
|
def builtinpat_immop : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIReplaceReg $dst, (i32 0)))>;
|
|
|
|
// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: expected operand 1 of 'GIReplaceReg' to be a name
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(GIReplaceReg ?:$dst, (i32 0):$k)'
|
|
def builtinpat_namedimmop : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIReplaceReg $dst, (i32 0):$k))>;
|
|
|
|
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 'GIEraseRoot' cannot be used in a 'match' pattern
|
|
def eraseroot_in_match : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (GIEraseRoot):$mi),
|
|
(apply (COPY $dst, $src))>;
|
|
|
|
// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: 'GIEraseRoot' expected 0 operands, got 1
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(GIEraseRoot ?:$dst)'
|
|
def eraseroot_ops : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIEraseRoot $dst), (COPY $dst, $src))>;
|
|
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: GIEraseRoot must be the only 'apply' pattern
|
|
def eraseroot_multiapply : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIEraseRoot), (COPY $dst, $src))>;
|
|
|
|
// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: GIEraseRoot can only be used if on roots that do not have any output operand
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: note: 'COPY' has 1 output operands
|
|
def eraseroot_root_has_def: GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIEraseRoot))>;
|
|
|
|
def TestPF: GICombinePatFrag<
|
|
(outs root:$def),
|
|
(ins),
|
|
[(pattern (COPY $def, $src))]>;
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: GIEraseRoot can only be used if the root is a CodeGenInstruction or Intrinsic
|
|
def eraseroot_notinstmatch: GICombineRule<
|
|
(defs root:$mi),
|
|
(match (TestPF $dst):$mi),
|
|
(apply (GIEraseRoot))>;
|
|
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: 'GIReplaceReg' cannot be used in a 'match' pattern
|
|
def replacereg_in_match : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (GIReplaceReg $dst, $src)),
|
|
(apply (COPY $dst, $src))>;
|
|
|
|
// CHECK: :[[@LINE+2]]:{{[0-9]+}}: error: 'GIReplaceReg' expected 2 operands, got 1
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: Failed to parse pattern: '(GIReplaceReg ?:$dst)'
|
|
def replacereg_ops : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $src)),
|
|
(apply (GIReplaceReg $dst))>;
|
|
|
|
// CHECK: :[[@LINE+1]]:{{[0-9]+}}: error: GIReplaceReg cannot replace 'tmp': this builtin can only replace a register defined by the match root
|
|
def replacereg_nonroot : GICombineRule<
|
|
(defs root:$dst),
|
|
(match (COPY $dst, $tmp), (COPY $tmp, $src)),
|
|
(apply (GIReplaceReg $dst, $src), (GIReplaceReg $tmp, $src))>;
|
|
|
|
// CHECK: error: Failed to parse one or more rules
|
|
|
|
def MyCombiner: GICombiner<"GenMyCombiner", [
|
|
builtinpat_immop,
|
|
builtinpat_namedimmop,
|
|
eraseroot_in_match,
|
|
eraseroot_ops,
|
|
eraseroot_multiapply,
|
|
eraseroot_root_has_def,
|
|
eraseroot_notinstmatch,
|
|
replacereg_in_match,
|
|
replacereg_ops,
|
|
replacereg_nonroot
|
|
]>;
|