From 1b317685e9b5813d68ab16517d932ec419c3f2ef Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 1 Jul 2019 13:44:46 +0000 Subject: [PATCH] AMDGPU: Convert some places to Register llvm-svn: 364769 --- llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h | 15 ++++++++------- llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h b/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h index ab0024b..0977304 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h +++ b/llvm/lib/Target/AMDGPU/AMDGPUArgumentUsageInfo.h @@ -10,6 +10,7 @@ #define LLVM_LIB_TARGET_AMDGPU_AMDGPUARGUMENTUSAGEINFO_H #include "llvm/ADT/DenseMap.h" +#include "llvm/CodeGen/Register.h" #include "llvm/IR/Function.h" #include "llvm/Pass.h" @@ -28,7 +29,7 @@ private: friend class AMDGPUArgumentUsageInfo; union { - unsigned Register; + Register Reg; unsigned StackOffset; }; @@ -41,18 +42,18 @@ private: public: ArgDescriptor(unsigned Val = 0, unsigned Mask = ~0u, bool IsStack = false, bool IsSet = false) - : Register(Val), Mask(Mask), IsStack(IsStack), IsSet(IsSet) {} + : Reg(Val), Mask(Mask), IsStack(IsStack), IsSet(IsSet) {} - static ArgDescriptor createRegister(unsigned Reg, unsigned Mask = ~0u) { + static ArgDescriptor createRegister(Register Reg, unsigned Mask = ~0u) { return ArgDescriptor(Reg, Mask, false, true); } - static ArgDescriptor createStack(unsigned Reg, unsigned Mask = ~0u) { + static ArgDescriptor createStack(Register Reg, unsigned Mask = ~0u) { return ArgDescriptor(Reg, Mask, true, true); } static ArgDescriptor createArg(const ArgDescriptor &Arg, unsigned Mask) { - return ArgDescriptor(Arg.Register, Mask, Arg.IsStack, Arg.IsSet); + return ArgDescriptor(Arg.Reg, Mask, Arg.IsStack, Arg.IsSet); } bool isSet() const { @@ -67,9 +68,9 @@ public: return !IsStack; } - unsigned getRegister() const { + Register getRegister() const { assert(!IsStack); - return Register; + return Reg; } unsigned getStackOffset() const { diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h index eb245ab..421541c 100644 --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h @@ -476,9 +476,9 @@ public: return ArgInfo.getPreloadedValue(Value); } - unsigned getPreloadedReg(AMDGPUFunctionArgInfo::PreloadedValue Value) const { + Register getPreloadedReg(AMDGPUFunctionArgInfo::PreloadedValue Value) const { auto Arg = ArgInfo.getPreloadedValue(Value).first; - return Arg ? Arg->getRegister() : 0; + return Arg ? Arg->getRegister() : Register(); } unsigned getGITPtrHigh() const { -- 2.7.4