================ @@ -0,0 +1,220 @@ +//===- AMDGPUMCResourceInfo.cpp --- MC Resource Info ----------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +/// \file +/// \brief MC infrastructure to propagate the function level resource usage +/// info. +/// +//===----------------------------------------------------------------------===// + +#include "AMDGPUMCResourceInfo.h" +#include "Utils/AMDGPUBaseInfo.h" +#include "llvm/ADT/SmallSet.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/MC/MCContext.h" +#include "llvm/MC/MCSymbol.h" + +using namespace llvm; + +MCSymbol *MCResourceInfo::getSymbol(StringRef FuncName, ResourceInfoKind RIK) { + switch (RIK) { + case RIK_NumVGPR: + return OutContext.getOrCreateSymbol(FuncName + Twine(".num_vgpr")); ---------------- JanekvO wrote:
> Are these names guaranteed to be unique? >From what I could tell, function names have to be unique at this point (e.g., >name mangling already happened) > Do we reserve any symbol with a '.' in it? I'll have a look at this, I didn't see any reserved symbols while I was working on this but I haven't explicitly searched for it either. https://github.com/llvm/llvm-project/pull/102913 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits