blob: 4f656f94ea12f771427fbabe008965e748d1a78a [file] [log] [blame]
Lang Hames6aed9842014-10-09 18:36:59 +00001//===-- AArch64PBQPRegAlloc.h - AArch64 specific PBQP constraints -------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
11#define LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
12
13#include "llvm/ADT/SetVector.h"
14#include "llvm/CodeGen/PBQPRAConstraint.h"
15
16namespace llvm {
17
Arnaud A. de Grandmaison9b333052014-10-22 12:40:20 +000018/// Add the accumulator chaining constraint to a PBQP graph
19class A57ChainingConstraint : public PBQPRAConstraint {
Lang Hames6aed9842014-10-09 18:36:59 +000020public:
Lang Hames6aed9842014-10-09 18:36:59 +000021 // Add A57 specific constraints to the PBQP graph.
22 void apply(PBQPRAGraph &G) override;
23
24private:
25 SmallSetVector<unsigned, 32> Chains;
Arnaud A. de Grandmaison9b333052014-10-22 12:40:20 +000026 const TargetRegisterInfo *TRI;
Lang Hames6aed9842014-10-09 18:36:59 +000027
28 // Add the accumulator chaining constraint, inside the chain, i.e. so that
29 // parity(Rd) == parity(Ra).
30 // \return true if a constraint was added
31 bool addIntraChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
32
33 // Add constraints between existing chains
34 void addInterChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
35};
Alexander Kornienkof00654e2015-06-23 09:49:53 +000036}
Lang Hames6aed9842014-10-09 18:36:59 +000037
38#endif // LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H