AArch64PBQPRegAlloc.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //==- AArch64PBQPRegAlloc.h - AArch64 specific PBQP constraints --*- 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. #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
  9. #define LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H
  10. #include "llvm/ADT/SetVector.h"
  11. #include "llvm/CodeGen/PBQPRAConstraint.h"
  12. namespace llvm {
  13. class TargetRegisterInfo;
  14. /// Add the accumulator chaining constraint to a PBQP graph
  15. class A57ChainingConstraint : public PBQPRAConstraint {
  16. public:
  17. // Add A57 specific constraints to the PBQP graph.
  18. void apply(PBQPRAGraph &G) override;
  19. private:
  20. SmallSetVector<unsigned, 32> Chains;
  21. const TargetRegisterInfo *TRI;
  22. // Add the accumulator chaining constraint, inside the chain, i.e. so that
  23. // parity(Rd) == parity(Ra).
  24. // \return true if a constraint was added
  25. bool addIntraChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
  26. // Add constraints between existing chains
  27. void addInterChainConstraint(PBQPRAGraph &G, unsigned Rd, unsigned Ra);
  28. };
  29. } // end namespace llvm
  30. #endif // LLVM_LIB_TARGET_AARCH64_AARCH64PBQPREGALOC_H