mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-23 04:52:54 +02:00
eb66b33867
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
73 lines
2.3 KiB
C++
73 lines
2.3 KiB
C++
//===-- AMDGPURegisterInfo.cpp - AMDGPU Register Information -------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
/// \file
|
|
/// \brief Parent TargetRegisterInfo class common to all hw codegen targets.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "AMDGPURegisterInfo.h"
|
|
#include "AMDGPUTargetMachine.h"
|
|
#include "SIRegisterInfo.h"
|
|
|
|
using namespace llvm;
|
|
|
|
AMDGPURegisterInfo::AMDGPURegisterInfo() : AMDGPUGenRegisterInfo(0) {}
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// Function handling callbacks - Functions are a seldom used feature of GPUS, so
|
|
// they are not supported at this time.
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
unsigned AMDGPURegisterInfo::getSubRegFromChannel(unsigned Channel) const {
|
|
static const unsigned SubRegs[] = {
|
|
AMDGPU::sub0, AMDGPU::sub1, AMDGPU::sub2, AMDGPU::sub3, AMDGPU::sub4,
|
|
AMDGPU::sub5, AMDGPU::sub6, AMDGPU::sub7, AMDGPU::sub8, AMDGPU::sub9,
|
|
AMDGPU::sub10, AMDGPU::sub11, AMDGPU::sub12, AMDGPU::sub13, AMDGPU::sub14,
|
|
AMDGPU::sub15
|
|
};
|
|
|
|
assert(Channel < array_lengthof(SubRegs));
|
|
return SubRegs[Channel];
|
|
}
|
|
|
|
#define GET_REGINFO_TARGET_DESC
|
|
#include "AMDGPUGenRegisterInfo.inc"
|
|
|
|
// Forced to be here by one .inc
|
|
const MCPhysReg *SIRegisterInfo::getCalleeSavedRegs(
|
|
const MachineFunction *MF) const {
|
|
CallingConv::ID CC = MF->getFunction()->getCallingConv();
|
|
switch (CC) {
|
|
case CallingConv::C:
|
|
case CallingConv::Fast:
|
|
return CSR_AMDGPU_HighRegs_SaveList;
|
|
default: {
|
|
// Dummy to not crash RegisterClassInfo.
|
|
static const MCPhysReg NoCalleeSavedReg = AMDGPU::NoRegister;
|
|
return &NoCalleeSavedReg;
|
|
}
|
|
}
|
|
}
|
|
|
|
const uint32_t *SIRegisterInfo::getCallPreservedMask(const MachineFunction &MF,
|
|
CallingConv::ID CC) const {
|
|
switch (CC) {
|
|
case CallingConv::C:
|
|
case CallingConv::Fast:
|
|
return CSR_AMDGPU_HighRegs_RegMask;
|
|
default:
|
|
return nullptr;
|
|
}
|
|
}
|
|
|
|
unsigned SIRegisterInfo::getFrameRegister(const MachineFunction &MF) const {
|
|
return AMDGPU::NoRegister;
|
|
}
|