xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUCombinerHelper.h (revision d39bd2c1388b520fcba9abed1932acacead60fba)
1 //=== lib/CodeGen/GlobalISel/AMDGPUCombinerHelper.h -------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 ///
9 /// \file
10 /// This contains common combine transformations that may be used in a combine
11 /// pass.
12 ///
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
16 #define LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
17 
18 #include "llvm/CodeGen/GlobalISel/Combiner.h"
19 #include "llvm/CodeGen/GlobalISel/CombinerHelper.h"
20 
21 using namespace llvm;
22 
23 class AMDGPUCombinerHelper : public CombinerHelper {
24 public:
25   using CombinerHelper::CombinerHelper;
26 
27   bool matchFoldableFneg(MachineInstr &MI, MachineInstr *&MatchInfo);
28   void applyFoldableFneg(MachineInstr &MI, MachineInstr *&MatchInfo);
29 
30   bool matchExpandPromotedF16FMed3(MachineInstr &MI, Register Src0,
31                                    Register Src1, Register Src2);
32   void applyExpandPromotedF16FMed3(MachineInstr &MI, Register Src0,
33                                    Register Src1, Register Src2);
34 };
35 
36 #endif // LLVM_LIB_TARGET_AMDGPU_AMDGPUCOMBINERHELPER_H
37