10b57cec5SDimitry Andric //===-- llvm/CodeGen/MachineCombinerPattern.h - Instruction pattern supported by 20b57cec5SDimitry Andric // combiner ------*- C++ -*-===// 30b57cec5SDimitry Andric // 40b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 50b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 60b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 70b57cec5SDimitry Andric // 80b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 90b57cec5SDimitry Andric // 100b57cec5SDimitry Andric // This file defines instruction pattern supported by combiner 110b57cec5SDimitry Andric // 120b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 130b57cec5SDimitry Andric 140b57cec5SDimitry Andric #ifndef LLVM_CODEGEN_MACHINECOMBINERPATTERN_H 150b57cec5SDimitry Andric #define LLVM_CODEGEN_MACHINECOMBINERPATTERN_H 160b57cec5SDimitry Andric 170b57cec5SDimitry Andric namespace llvm { 180b57cec5SDimitry Andric 19*0fca6ea1SDimitry Andric /// The combiner's goal may differ based on which pattern it is attempting 20*0fca6ea1SDimitry Andric /// to optimize. 21*0fca6ea1SDimitry Andric enum class CombinerObjective { 22*0fca6ea1SDimitry Andric MustReduceDepth, // The data dependency chain must be improved. 23*0fca6ea1SDimitry Andric MustReduceRegisterPressure, // The register pressure must be reduced. 24*0fca6ea1SDimitry Andric Default // The critical path must not be lengthened. 25*0fca6ea1SDimitry Andric }; 26*0fca6ea1SDimitry Andric 270b57cec5SDimitry Andric /// These are instruction patterns matched by the machine combiner pass. 28*0fca6ea1SDimitry Andric enum MachineCombinerPattern : unsigned { 290b57cec5SDimitry Andric // These are commutative variants for reassociating a computation chain. See 300b57cec5SDimitry Andric // the comments before getMachineCombinerPatterns() in TargetInstrInfo.cpp. 310b57cec5SDimitry Andric REASSOC_AX_BY, 320b57cec5SDimitry Andric REASSOC_AX_YB, 330b57cec5SDimitry Andric REASSOC_XA_BY, 340b57cec5SDimitry Andric REASSOC_XA_YB, 350b57cec5SDimitry Andric 36*0fca6ea1SDimitry Andric TARGET_PATTERN_START 370b57cec5SDimitry Andric }; 380b57cec5SDimitry Andric 390b57cec5SDimitry Andric } // end namespace llvm 400b57cec5SDimitry Andric 410b57cec5SDimitry Andric #endif 42