xref: /aosp_15_r20/external/llvm/lib/Target/AArch64/AArch64PBQPRegAlloc.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- AArch64PBQPRegAlloc.h - AArch64 specific PBQP constraints -------===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker 
10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
12*9880d681SAndroid Build Coastguard Worker 
13*9880d681SAndroid Build Coastguard Worker #include "llvm/ADT/SetVector.h"
14*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/PBQPRAConstraint.h"
15*9880d681SAndroid Build Coastguard Worker 
16*9880d681SAndroid Build Coastguard Worker namespace llvm {
17*9880d681SAndroid Build Coastguard Worker 
18*9880d681SAndroid Build Coastguard Worker /// Add the accumulator chaining constraint to a PBQP graph
19*9880d681SAndroid Build Coastguard Worker class A57ChainingConstraint : public PBQPRAConstraint {
20*9880d681SAndroid Build Coastguard Worker public:
21*9880d681SAndroid Build Coastguard Worker   // Add A57 specific constraints to the PBQP graph.
22*9880d681SAndroid Build Coastguard Worker   void apply(PBQPRAGraph &G) override;
23*9880d681SAndroid Build Coastguard Worker 
24*9880d681SAndroid Build Coastguard Worker private:
25*9880d681SAndroid Build Coastguard Worker   SmallSetVector<unsigned, 32> Chains;
26*9880d681SAndroid Build Coastguard Worker   const TargetRegisterInfo *TRI;
27*9880d681SAndroid Build Coastguard Worker 
28*9880d681SAndroid Build Coastguard Worker   // Add the accumulator chaining constraint, inside the chain, i.e. so that
29*9880d681SAndroid Build Coastguard Worker   // parity(Rd) == parity(Ra).
30*9880d681SAndroid Build Coastguard Worker   // \return true if a constraint was added
31*9880d681SAndroid Build Coastguard Worker   bool addIntraChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
32*9880d681SAndroid Build Coastguard Worker 
33*9880d681SAndroid Build Coastguard Worker   // Add constraints between existing chains
34*9880d681SAndroid Build Coastguard Worker   void addInterChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
35*9880d681SAndroid Build Coastguard Worker };
36*9880d681SAndroid Build Coastguard Worker }
37*9880d681SAndroid Build Coastguard Worker 
38*9880d681SAndroid Build Coastguard Worker #endif // LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
39