See
:ref:`amdgpu-amdhsa-code-object-kernel-attribute-metadata-mapping-table`
for the mapping definition.
- "Arguments" sequence of Sequence of mappings of the
+ "Args" sequence of Sequence of mappings of the
mapping kernel arguments. See
:ref:`amdgpu-amdhsa-code-object-kernel-argument-metadata-mapping-table`
for the definition of the mapping.
.. TODO
Does this apply to
GlobalBuffer?
- "ActualAcc" string The actual memory accesses
+ "ActualAccQual" string The actual memory accesses
performed by the kernel on the
kernel argument. Only present if
"ValueKind" is "GlobalBuffer",
=================================== ============== ========= ==============
String Key Value Type Required? Description
=================================== ============== ========= ==============
- "DebuggerABIVersion" string
+ "DebuggerABIVersion" sequence of
+ 2 integers
"ReservedNumVGPRs" integer
"ReservedFirstVGPR" integer
"PrivateSegmentBufferSGPR" integer
/// \returns True if kernel attributes metadata is empty, false otherwise.
bool empty() const {
- return mReqdWorkGroupSize.empty() && mWorkGroupSizeHint.empty() &&
- mVecTypeHint.empty() && mRuntimeHandle.empty();
+ return !notEmpty();
}
/// \returns True if kernel attributes metadata is not empty, false otherwise.
bool notEmpty() const {
- return !empty();
+ return !mReqdWorkGroupSize.empty() || !mWorkGroupSizeHint.empty() ||
+ !mVecTypeHint.empty() || !mRuntimeHandle.empty();
}
};
namespace Arg {
namespace Key {
+/// \brief Key for Kernel::Arg::Metadata::mName.
+constexpr char Name[] = "Name";
+/// \brief Key for Kernel::Arg::Metadata::mTypeName.
+constexpr char TypeName[] = "TypeName";
/// \brief Key for Kernel::Arg::Metadata::mSize.
constexpr char Size[] = "Size";
/// \brief Key for Kernel::Arg::Metadata::mAlign.
constexpr char ValueType[] = "ValueType";
/// \brief Key for Kernel::Arg::Metadata::mPointeeAlign.
constexpr char PointeeAlign[] = "PointeeAlign";
-/// \brief Key for Kernel::Arg::Metadata::mAccQual.
-constexpr char AccQual[] = "AccQual";
/// \brief Key for Kernel::Arg::Metadata::mAddrSpaceQual.
constexpr char AddrSpaceQual[] = "AddrSpaceQual";
+/// \brief Key for Kernel::Arg::Metadata::mAccQual.
+constexpr char AccQual[] = "AccQual";
+/// \brief Key for Kernel::Arg::Metadata::mActualAccQual.
+constexpr char ActualAccQual[] = "ActualAccQual";
/// \brief Key for Kernel::Arg::Metadata::mIsConst.
constexpr char IsConst[] = "IsConst";
-/// \brief Key for Kernel::Arg::Metadata::mIsPipe.
-constexpr char IsPipe[] = "IsPipe";
/// \brief Key for Kernel::Arg::Metadata::mIsRestrict.
constexpr char IsRestrict[] = "IsRestrict";
/// \brief Key for Kernel::Arg::Metadata::mIsVolatile.
constexpr char IsVolatile[] = "IsVolatile";
-/// \brief Key for Kernel::Arg::Metadata::mName.
-constexpr char Name[] = "Name";
-/// \brief Key for Kernel::Arg::Metadata::mTypeName.
-constexpr char TypeName[] = "TypeName";
+/// \brief Key for Kernel::Arg::Metadata::mIsPipe.
+constexpr char IsPipe[] = "IsPipe";
} // end namespace Key
/// \brief In-memory representation of kernel argument metadata.
struct Metadata final {
+ /// \brief Name. Optional.
+ std::string mName = std::string();
+ /// \brief Type name. Optional.
+ std::string mTypeName = std::string();
/// \brief Size in bytes. Required.
uint32_t mSize = 0;
/// \brief Alignment in bytes. Required.
ValueType mValueType = ValueType::Unknown;
/// \brief Pointee alignment in bytes. Optional.
uint32_t mPointeeAlign = 0;
- /// \brief Access qualifier. Optional.
- AccessQualifier mAccQual = AccessQualifier::Unknown;
/// \brief Address space qualifier. Optional.
AddressSpaceQualifier mAddrSpaceQual = AddressSpaceQualifier::Unknown;
+ /// \brief Access qualifier. Optional.
+ AccessQualifier mAccQual = AccessQualifier::Unknown;
+ /// \brief Actual access qualifier. Optional.
+ AccessQualifier mActualAccQual = AccessQualifier::Unknown;
/// \brief True if 'const' qualifier is specified. Optional.
bool mIsConst = false;
- /// \brief True if 'pipe' qualifier is specified. Optional.
- bool mIsPipe = false;
/// \brief True if 'restrict' qualifier is specified. Optional.
bool mIsRestrict = false;
/// \brief True if 'volatile' qualifier is specified. Optional.
bool mIsVolatile = false;
- /// \brief Name. Optional.
- std::string mName = std::string();
- /// \brief Type name. Optional.
- std::string mTypeName = std::string();
+ /// \brief True if 'pipe' qualifier is specified. Optional.
+ bool mIsPipe = false;
/// \brief Default constructor.
Metadata() = default;
namespace Key {
/// \brief Key for Kernel::CodeProps::Metadata::mKernargSegmentSize.
constexpr char KernargSegmentSize[] = "KernargSegmentSize";
-/// \brief Key for Kernel::CodeProps::Metadata::mWorkgroupGroupSegmentSize.
-constexpr char WorkgroupGroupSegmentSize[] = "WorkgroupGroupSegmentSize";
-/// \brief Key for Kernel::CodeProps::Metadata::mWorkitemPrivateSegmentSize.
-constexpr char WorkitemPrivateSegmentSize[] = "WorkitemPrivateSegmentSize";
-/// \brief Key for Kernel::CodeProps::Metadata::mWavefrontNumSGPRs.
-constexpr char WavefrontNumSGPRs[] = "WavefrontNumSGPRs";
-/// \brief Key for Kernel::CodeProps::Metadata::mWorkitemNumVGPRs.
-constexpr char WorkitemNumVGPRs[] = "WorkitemNumVGPRs";
+/// \brief Key for Kernel::CodeProps::Metadata::mGroupSegmentFixedSize.
+constexpr char GroupSegmentFixedSize[] = "GroupSegmentFixedSize";
+/// \brief Key for Kernel::CodeProps::Metadata::mPrivateSegmentFixedSize.
+constexpr char PrivateSegmentFixedSize[] = "PrivateSegmentFixedSize";
/// \brief Key for Kernel::CodeProps::Metadata::mKernargSegmentAlign.
constexpr char KernargSegmentAlign[] = "KernargSegmentAlign";
-/// \brief Key for Kernel::CodeProps::Metadata::mGroupSegmentAlign.
-constexpr char GroupSegmentAlign[] = "GroupSegmentAlign";
-/// \brief Key for Kernel::CodeProps::Metadata::mPrivateSegmentAlign.
-constexpr char PrivateSegmentAlign[] = "PrivateSegmentAlign";
/// \brief Key for Kernel::CodeProps::Metadata::mWavefrontSize.
constexpr char WavefrontSize[] = "WavefrontSize";
+/// \brief Key for Kernel::CodeProps::Metadata::mNumSGPRs.
+constexpr char NumSGPRs[] = "NumSGPRs";
+/// \brief Key for Kernel::CodeProps::Metadata::mNumVGPRs.
+constexpr char NumVGPRs[] = "NumVGPRs";
+/// \brief Key for Kernel::CodeProps::Metadata::mMaxFlatWorkgroupSize.
+constexpr char MaxFlatWorkgroupSize[] = "MaxFlatWorkgroupSize";
+/// \brief Key for Kernel::CodeProps::Metadata::mIsDynamicCallStack.
+constexpr char IsDynamicCallStack[] = "IsDynamicCallStack";
+/// \brief Key for Kernel::CodeProps::Metadata::mIsXNACKEnabled.
+constexpr char IsXNACKEnabled[] = "IsXNACKEnabled";
} // end namespace Key
/// \brief In-memory representation of kernel code properties metadata.
struct Metadata final {
/// \brief Size in bytes of the kernarg segment memory. Kernarg segment memory
- /// holds the values of the arguments to the kernel. Optional.
+ /// holds the values of the arguments to the kernel. Required.
uint64_t mKernargSegmentSize = 0;
/// \brief Size in bytes of the group segment memory required by a workgroup.
/// This value does not include any dynamically allocated group segment memory
- /// that may be added when the kernel is dispatched. Optional.
- uint32_t mWorkgroupGroupSegmentSize = 0;
+ /// that may be added when the kernel is dispatched. Required.
+ uint32_t mGroupSegmentFixedSize = 0;
/// \brief Size in bytes of the private segment memory required by a workitem.
- /// Private segment memory includes arg, spill and private segments. Optional.
- uint32_t mWorkitemPrivateSegmentSize = 0;
+ /// Private segment memory includes arg, spill and private segments. Required.
+ uint32_t mPrivateSegmentFixedSize = 0;
+ /// \brief Maximum byte alignment of variables used by the kernel in the
+ /// kernarg memory segment. Required.
+ uint32_t mKernargSegmentAlign = 0;
+ /// \brief Wavefront size. Required.
+ uint32_t mWavefrontSize = 0;
/// \brief Total number of SGPRs used by a wavefront. Optional.
- uint16_t mWavefrontNumSGPRs = 0;
+ uint16_t mNumSGPRs = 0;
/// \brief Total number of VGPRs used by a workitem. Optional.
- uint16_t mWorkitemNumVGPRs = 0;
- /// \brief Maximum byte alignment of variables used by the kernel in the
- /// kernarg memory segment. Expressed as a power of two. Optional.
- uint8_t mKernargSegmentAlign = 0;
- /// \brief Maximum byte alignment of variables used by the kernel in the
- /// group memory segment. Expressed as a power of two. Optional.
- uint8_t mGroupSegmentAlign = 0;
- /// \brief Maximum byte alignment of variables used by the kernel in the
- /// private memory segment. Expressed as a power of two. Optional.
- uint8_t mPrivateSegmentAlign = 0;
- /// \brief Wavefront size. Expressed as a power of two. Optional.
- uint8_t mWavefrontSize = 0;
+ uint16_t mNumVGPRs = 0;
+ /// \brief Maximum flat work-group size supported by the kernel. Optional.
+ uint32_t mMaxFlatWorkgroupSize = 0;
+ /// \brief True if the generated machine code is using a dynamically sized
+ /// call stack. Optional.
+ bool mIsDynamicCallStack = false;
+ /// \brief True if the generated machine code is capable of supporting XNACK.
+ /// Optional.
+ bool mIsXNACKEnabled = false;
/// \brief Default constructor.
Metadata() = default;
/// \returns True if kernel code properties metadata is not empty, false
/// otherwise.
bool notEmpty() const {
- return mKernargSegmentSize || mWorkgroupGroupSegmentSize ||
- mWorkitemPrivateSegmentSize || mWavefrontNumSGPRs ||
- mWorkitemNumVGPRs || mKernargSegmentAlign || mGroupSegmentAlign ||
- mPrivateSegmentAlign || mWavefrontSize;
+ return true;
}
};
namespace Key {
/// \brief Key for Kernel::Metadata::mName.
constexpr char Name[] = "Name";
+/// \brief Key for Kernel::Metadata::mSymbolName.
+constexpr char SymbolName[] = "SymbolName";
/// \brief Key for Kernel::Metadata::mLanguage.
constexpr char Language[] = "Language";
/// \brief Key for Kernel::Metadata::mLanguageVersion.
/// \brief In-memory representation of kernel metadata.
struct Metadata final {
- /// \brief Name. Required.
+ /// \brief Kernel source name. Required.
std::string mName = std::string();
+ /// \brief Kernel descriptor name. Required.
+ std::string mSymbolName = std::string();
/// \brief Language. Optional.
std::string mLanguage = std::string();
/// \brief Language version. Optional.
std::vector<uint32_t> mVersion = std::vector<uint32_t>();
/// \brief Printf metadata. Optional.
std::vector<std::string> mPrintf = std::vector<std::string>();
- /// \brief Kernels metadata. Optional.
+ /// \brief Kernels metadata. Required.
std::vector<Kernel::Metadata> mKernels = std::vector<Kernel::Metadata>();
/// \brief Default constructor.
template <>
struct MappingTraits<Kernel::Arg::Metadata> {
static void mapping(IO &YIO, Kernel::Arg::Metadata &MD) {
+ YIO.mapOptional(Kernel::Arg::Key::Name, MD.mName, std::string());
+ YIO.mapOptional(Kernel::Arg::Key::TypeName, MD.mTypeName, std::string());
YIO.mapRequired(Kernel::Arg::Key::Size, MD.mSize);
YIO.mapRequired(Kernel::Arg::Key::Align, MD.mAlign);
YIO.mapRequired(Kernel::Arg::Key::ValueKind, MD.mValueKind);
YIO.mapRequired(Kernel::Arg::Key::ValueType, MD.mValueType);
YIO.mapOptional(Kernel::Arg::Key::PointeeAlign, MD.mPointeeAlign,
uint32_t(0));
- YIO.mapOptional(Kernel::Arg::Key::AccQual, MD.mAccQual,
- AccessQualifier::Unknown);
YIO.mapOptional(Kernel::Arg::Key::AddrSpaceQual, MD.mAddrSpaceQual,
AddressSpaceQualifier::Unknown);
+ YIO.mapOptional(Kernel::Arg::Key::AccQual, MD.mAccQual,
+ AccessQualifier::Unknown);
+ YIO.mapOptional(Kernel::Arg::Key::ActualAccQual, MD.mActualAccQual,
+ AccessQualifier::Unknown);
YIO.mapOptional(Kernel::Arg::Key::IsConst, MD.mIsConst, false);
- YIO.mapOptional(Kernel::Arg::Key::IsPipe, MD.mIsPipe, false);
YIO.mapOptional(Kernel::Arg::Key::IsRestrict, MD.mIsRestrict, false);
YIO.mapOptional(Kernel::Arg::Key::IsVolatile, MD.mIsVolatile, false);
- YIO.mapOptional(Kernel::Arg::Key::Name, MD.mName, std::string());
- YIO.mapOptional(Kernel::Arg::Key::TypeName, MD.mTypeName, std::string());
+ YIO.mapOptional(Kernel::Arg::Key::IsPipe, MD.mIsPipe, false);
}
};
template <>
struct MappingTraits<Kernel::CodeProps::Metadata> {
static void mapping(IO &YIO, Kernel::CodeProps::Metadata &MD) {
- YIO.mapOptional(Kernel::CodeProps::Key::KernargSegmentSize,
- MD.mKernargSegmentSize, uint64_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::WorkgroupGroupSegmentSize,
- MD.mWorkgroupGroupSegmentSize, uint32_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::WorkitemPrivateSegmentSize,
- MD.mWorkitemPrivateSegmentSize, uint32_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::WavefrontNumSGPRs,
- MD.mWavefrontNumSGPRs, uint16_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::WorkitemNumVGPRs,
- MD.mWorkitemNumVGPRs, uint16_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::KernargSegmentAlign,
- MD.mKernargSegmentAlign, uint8_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::GroupSegmentAlign,
- MD.mGroupSegmentAlign, uint8_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::PrivateSegmentAlign,
- MD.mPrivateSegmentAlign, uint8_t(0));
- YIO.mapOptional(Kernel::CodeProps::Key::WavefrontSize,
- MD.mWavefrontSize, uint8_t(0));
+ YIO.mapRequired(Kernel::CodeProps::Key::KernargSegmentSize,
+ MD.mKernargSegmentSize);
+ YIO.mapRequired(Kernel::CodeProps::Key::GroupSegmentFixedSize,
+ MD.mGroupSegmentFixedSize);
+ YIO.mapRequired(Kernel::CodeProps::Key::PrivateSegmentFixedSize,
+ MD.mPrivateSegmentFixedSize);
+ YIO.mapRequired(Kernel::CodeProps::Key::KernargSegmentAlign,
+ MD.mKernargSegmentAlign);
+ YIO.mapRequired(Kernel::CodeProps::Key::WavefrontSize,
+ MD.mWavefrontSize);
+ YIO.mapOptional(Kernel::CodeProps::Key::NumSGPRs,
+ MD.mNumSGPRs, uint16_t(0));
+ YIO.mapOptional(Kernel::CodeProps::Key::NumVGPRs,
+ MD.mNumVGPRs, uint16_t(0));
+ YIO.mapOptional(Kernel::CodeProps::Key::MaxFlatWorkgroupSize,
+ MD.mMaxFlatWorkgroupSize, uint32_t(0));
+ YIO.mapOptional(Kernel::CodeProps::Key::IsDynamicCallStack,
+ MD.mIsDynamicCallStack, false);
+ YIO.mapOptional(Kernel::CodeProps::Key::IsXNACKEnabled,
+ MD.mIsXNACKEnabled, false);
}
};
struct MappingTraits<Kernel::Metadata> {
static void mapping(IO &YIO, Kernel::Metadata &MD) {
YIO.mapRequired(Kernel::Key::Name, MD.mName);
+ YIO.mapRequired(Kernel::Key::SymbolName, MD.mSymbolName);
YIO.mapOptional(Kernel::Key::Language, MD.mLanguage, std::string());
YIO.mapOptional(Kernel::Key::LanguageVersion, MD.mLanguageVersion,
std::vector<uint32_t>());
if (TM.getTargetTriple().getOS() != Triple::AMDHSA)
return;
- HSAMetadataStream.emitKernel(*MF->getFunction(), KernelCode);
+ HSAMetadataStream.emitKernel(*MF->getFunction(),
+ getHSACodeProps(*MF, CurrentProgramInfo),
+ getHSADebugProps(*MF, CurrentProgramInfo));
}
void AMDGPUAsmPrinter::EmitFunctionEntryLabel() {
}
}
+AMDGPU::HSAMD::Kernel::CodeProps::Metadata AMDGPUAsmPrinter::getHSACodeProps(
+ const MachineFunction &MF,
+ const SIProgramInfo &ProgramInfo) const {
+ const SISubtarget &STM = MF.getSubtarget<SISubtarget>();
+ const SIMachineFunctionInfo &MFI = *MF.getInfo<SIMachineFunctionInfo>();
+ HSAMD::Kernel::CodeProps::Metadata HSACodeProps;
+
+ HSACodeProps.mKernargSegmentSize =
+ STM.getKernArgSegmentSize(MF, MFI.getABIArgOffset());
+ HSACodeProps.mGroupSegmentFixedSize = ProgramInfo.LDSSize;
+ HSACodeProps.mPrivateSegmentFixedSize = ProgramInfo.ScratchSize;
+ HSACodeProps.mKernargSegmentAlign =
+ std::max(uint32_t(4), MFI.getMaxKernArgAlign());
+ HSACodeProps.mWavefrontSize = STM.getWavefrontSize();
+ HSACodeProps.mNumSGPRs = CurrentProgramInfo.NumSGPR;
+ HSACodeProps.mNumVGPRs = CurrentProgramInfo.NumVGPR;
+ // TODO: Emit HSACodeProps.mMaxFlatWorkgroupSize.
+ HSACodeProps.mIsDynamicCallStack = ProgramInfo.DynamicCallStack;
+ HSACodeProps.mIsXNACKEnabled = STM.isXNACKEnabled();
+
+ return HSACodeProps;
+}
+
+AMDGPU::HSAMD::Kernel::DebugProps::Metadata AMDGPUAsmPrinter::getHSADebugProps(
+ const MachineFunction &MF,
+ const SIProgramInfo &ProgramInfo) const {
+ const SISubtarget &STM = MF.getSubtarget<SISubtarget>();
+ HSAMD::Kernel::DebugProps::Metadata HSADebugProps;
+
+ if (!STM.debuggerSupported())
+ return HSADebugProps;
+
+ HSADebugProps.mDebuggerABIVersion.push_back(1);
+ HSADebugProps.mDebuggerABIVersion.push_back(0);
+ HSADebugProps.mReservedNumVGPRs = ProgramInfo.ReservedVGPRCount;
+ HSADebugProps.mReservedFirstVGPR = ProgramInfo.ReservedVGPRFirst;
+
+ if (STM.debuggerEmitPrologue()) {
+ HSADebugProps.mPrivateSegmentBufferSGPR =
+ ProgramInfo.DebuggerPrivateSegmentBufferSGPR;
+ HSADebugProps.mWavefrontPrivateSegmentOffsetSGPR =
+ ProgramInfo.DebuggerWavefrontPrivateSegmentOffsetSGPR;
+ }
+
+ return HSADebugProps;
+}
+
bool AMDGPUAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
unsigned AsmVariant,
const char *ExtraCode, raw_ostream &O) {
unsigned &NumSGPR,
unsigned &NumVGPR) const;
+ AMDGPU::HSAMD::Kernel::CodeProps::Metadata getHSACodeProps(
+ const MachineFunction &MF,
+ const SIProgramInfo &ProgramInfo) const;
+ AMDGPU::HSAMD::Kernel::DebugProps::Metadata getHSADebugProps(
+ const MachineFunction &MF,
+ const SIProgramInfo &ProgramInfo) const;
+
/// \brief Emit register usage information so that the GPU driver
/// can correctly setup the GPU state.
void EmitProgramInfoR600(const MachineFunction &MF);
auto ArgNo = Arg.getArgNo();
const MDNode *Node;
- StringRef TypeQual;
- Node = Func->getMetadata("kernel_arg_type_qual");
+ StringRef Name;
+ Node = Func->getMetadata("kernel_arg_name");
if (Node && ArgNo < Node->getNumOperands())
- TypeQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
+ Name = cast<MDString>(Node->getOperand(ArgNo))->getString();
+
+ StringRef TypeName;
+ Node = Func->getMetadata("kernel_arg_type");
+ if (Node && ArgNo < Node->getNumOperands())
+ TypeName = cast<MDString>(Node->getOperand(ArgNo))->getString();
StringRef BaseTypeName;
Node = Func->getMetadata("kernel_arg_base_type");
AccQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
}
- StringRef Name;
- Node = Func->getMetadata("kernel_arg_name");
- if (Node && ArgNo < Node->getNumOperands())
- Name = cast<MDString>(Node->getOperand(ArgNo))->getString();
-
- StringRef TypeName;
- Node = Func->getMetadata("kernel_arg_type");
+ StringRef TypeQual;
+ Node = Func->getMetadata("kernel_arg_type_qual");
if (Node && ArgNo < Node->getNumOperands())
- TypeName = cast<MDString>(Node->getOperand(ArgNo))->getString();
+ TypeQual = cast<MDString>(Node->getOperand(ArgNo))->getString();
emitKernelArg(Func->getParent()->getDataLayout(), Arg.getType(),
- getValueKind(Arg.getType(), TypeQual, BaseTypeName), TypeQual,
- BaseTypeName, AccQual, Name, TypeName);
+ getValueKind(Arg.getType(), TypeQual, BaseTypeName), Name,
+ TypeName, BaseTypeName, AccQual, TypeQual);
}
void MetadataStreamer::emitKernelArg(const DataLayout &DL, Type *Ty,
- ValueKind ValueKind, StringRef TypeQual,
- StringRef BaseTypeName, StringRef AccQual,
- StringRef Name, StringRef TypeName) {
+ ValueKind ValueKind, StringRef Name,
+ StringRef TypeName, StringRef BaseTypeName,
+ StringRef AccQual, StringRef TypeQual) {
HSAMetadata.mKernels.back().mArgs.push_back(Kernel::Arg::Metadata());
auto &Arg = HSAMetadata.mKernels.back().mArgs.back();
+ Arg.mName = Name;
+ Arg.mTypeName = TypeName;
Arg.mSize = DL.getTypeAllocSize(Ty);
Arg.mAlign = DL.getABITypeAlignment(Ty);
Arg.mValueKind = ValueKind;
Arg.mPointeeAlign = DL.getABITypeAlignment(ElTy);
}
- Arg.mAccQual = getAccessQualifier(AccQual);
-
if (auto PtrTy = dyn_cast<PointerType>(Ty))
Arg.mAddrSpaceQual = getAddressSpaceQualifer(PtrTy->getAddressSpace());
+ Arg.mAccQual = getAccessQualifier(AccQual);
+
+ // TODO: Emit Arg.mActualAccQual.
+
SmallVector<StringRef, 1> SplitTypeQuals;
TypeQual.split(SplitTypeQuals, " ", -1, false);
for (StringRef Key : SplitTypeQuals) {
auto P = StringSwitch<bool*>(Key)
.Case("const", &Arg.mIsConst)
- .Case("pipe", &Arg.mIsPipe)
.Case("restrict", &Arg.mIsRestrict)
.Case("volatile", &Arg.mIsVolatile)
+ .Case("pipe", &Arg.mIsPipe)
.Default(nullptr);
if (P)
*P = true;
}
-
- Arg.mName = Name;
- Arg.mTypeName = TypeName;
-}
-
-void MetadataStreamer::emitKernelCodeProps(
- const amd_kernel_code_t &KernelCode) {
- auto &CodeProps = HSAMetadata.mKernels.back().mCodeProps;
-
- CodeProps.mKernargSegmentSize = KernelCode.kernarg_segment_byte_size;
- CodeProps.mWorkgroupGroupSegmentSize =
- KernelCode.workgroup_group_segment_byte_size;
- CodeProps.mWorkitemPrivateSegmentSize =
- KernelCode.workitem_private_segment_byte_size;
- CodeProps.mWavefrontNumSGPRs = KernelCode.wavefront_sgpr_count;
- CodeProps.mWorkitemNumVGPRs = KernelCode.workitem_vgpr_count;
- CodeProps.mKernargSegmentAlign = KernelCode.kernarg_segment_alignment;
- CodeProps.mGroupSegmentAlign = KernelCode.group_segment_alignment;
- CodeProps.mPrivateSegmentAlign = KernelCode.private_segment_alignment;
- CodeProps.mWavefrontSize = KernelCode.wavefront_size;
-}
-
-void MetadataStreamer::emitKernelDebugProps(
- const amd_kernel_code_t &KernelCode) {
- if (!(KernelCode.code_properties & AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED))
- return;
-
- auto &DebugProps = HSAMetadata.mKernels.back().mDebugProps;
-
- // FIXME: Need to pass down debugger ABI version through features. This is ok
- // for now because we only have one version.
- DebugProps.mDebuggerABIVersion.push_back(1);
- DebugProps.mDebuggerABIVersion.push_back(0);
- DebugProps.mReservedNumVGPRs = KernelCode.reserved_vgpr_count;
- DebugProps.mReservedFirstVGPR = KernelCode.reserved_vgpr_first;
- DebugProps.mPrivateSegmentBufferSGPR =
- KernelCode.debug_private_segment_buffer_sgpr;
- DebugProps.mWavefrontPrivateSegmentOffsetSGPR =
- KernelCode.debug_wavefront_private_segment_offset_sgpr;
}
void MetadataStreamer::begin(const Module &Mod) {
verify(HSAMetadataString);
}
-void MetadataStreamer::emitKernel(const Function &Func,
- const amd_kernel_code_t &KernelCode) {
+void MetadataStreamer::emitKernel(
+ const Function &Func,
+ const Kernel::CodeProps::Metadata &CodeProps,
+ const Kernel::DebugProps::Metadata &DebugProps) {
if (Func.getCallingConv() != CallingConv::AMDGPU_KERNEL)
return;
auto &Kernel = HSAMetadata.mKernels.back();
Kernel.mName = Func.getName();
+ Kernel.mSymbolName = (Twine(Func.getName()) + Twine("@kd")).str();
emitKernelLanguage(Func);
emitKernelAttrs(Func);
emitKernelArgs(Func);
- emitKernelCodeProps(KernelCode);
- emitKernelDebugProps(KernelCode);
+ HSAMetadata.mKernels.back().mCodeProps = CodeProps;
+ HSAMetadata.mKernels.back().mDebugProps = DebugProps;
}
} // end namespace HSAMD
void emitKernelArg(const Argument &Arg);
void emitKernelArg(const DataLayout &DL, Type *Ty, ValueKind ValueKind,
- StringRef TypeQual = "", StringRef BaseTypeName = "",
- StringRef AccQual = "", StringRef Name = "",
- StringRef TypeName = "");
-
- void emitKernelCodeProps(const amd_kernel_code_t &KernelCode);
-
- void emitKernelDebugProps(const amd_kernel_code_t &KernelCode);
+ StringRef Name = "", StringRef TypeName = "",
+ StringRef BaseTypeName = "", StringRef AccQual = "",
+ StringRef TypeQual = "");
public:
MetadataStreamer() = default;
void end();
- void emitKernel(const Function &Func, const amd_kernel_code_t &KernelCode);
+ void emitKernel(const Function &Func,
+ const Kernel::CodeProps::Metadata &CodeProps,
+ const Kernel::DebugProps::Metadata &DebugProps);
};
} // end namespace HSAMD
; OSABI-HSA-ELF: ---
; OSABI-HSA-ELF: Version: [ 1, 0 ]
; OSABI-HSA-ELF: Kernels:
-; OSABI-HSA-ELF: - Name: elf_notes
+; OSABI-HSA-ELF: - Name: elf_notes
+; OSABI-HSA-ELF: SymbolName: 'elf_notes@kd'
; OSABI-HSA-ELF: CodeProps:
-; OSABI-HSA-ELF: WavefrontNumSGPRs: 96
-; OSABI-HSA-ELF: KernargSegmentAlign: 32
-; OSABI-HSA-ELF: GroupSegmentAlign: 4
-; OSABI-HSA-ELF: PrivateSegmentAlign: 4
-; OSABI-HSA-ELF: WavefrontSize: 6
+; OSABI-HSA-ELF: KernargSegmentSize: 0
+; OSABI-HSA-ELF: GroupSegmentFixedSize: 0
+; OSABI-HSA-ELF: PrivateSegmentFixedSize: 0
+; OSABI-HSA-ELF: KernargSegmentAlign: 4
+; OSABI-HSA-ELF: WavefrontSize: 64
+; OSABI-HSA-ELF: NumSGPRs: 96
; OSABI-HSA-ELF: ...
; OSABI-HSA-ELF-NOT: Unknown note type
; OSABI-HSA-ELF-NOT: NT_AMD_AMDGPU_PAL_METADATA (PAL Metadata)
; RUN: llc -mtriple=amdgcn-amd-amdhsa -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck %s
; CHECK: - Name: test_ro_arg
-; CHECK: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: SymbolName: 'test_ro_arg@kd'
+; CHECK-NEXT: Args:
+; CHECK-NEXT: - TypeName: 'float*'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: F32
-; CHECK-NEXT: AccQual: ReadOnly
; CHECK-NEXT: AddrSpaceQual: Global
+; CHECK-NEXT: AccQual: ReadOnly
; CHECK-NEXT: IsConst: true
; CHECK-NEXT: IsRestrict: true
-; CHECK-NEXT: TypeName: 'float*'
-
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'float*'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: F32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: 'float*'
+; CHECK-NEXT: AccQual: Default
define amdgpu_kernel void @test_ro_arg(float addrspace(1)* noalias readonly %in, float addrspace(1)* %out)
!kernel_arg_addr_space !0 !kernel_arg_access_qual !1 !kernel_arg_type !2
!1 = !{!"none", !"none"}
!2 = !{!"float*", !"float*"}
!3 = !{!"const restrict", !""}
-
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx800 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX800 --check-prefix=NOTES %s
+; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -amdgpu-dump-hsa-metadata -amdgpu-verify-hsa-metadata -filetype=obj -o - < %s 2>&1 | FileCheck --check-prefix=PARSER %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx800 -amdgpu-dump-hsa-metadata -amdgpu-verify-hsa-metadata -filetype=obj -o - < %s 2>&1 | FileCheck --check-prefix=PARSER %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -amdgpu-dump-hsa-metadata -amdgpu-verify-hsa-metadata -filetype=obj -o - < %s 2>&1 | FileCheck --check-prefix=PARSER %s
; CHECK: Kernels:
; CHECK: - Name: test_char
+; CHECK-NEXT: SymbolName: 'test_char@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 1
+; CHECK-NEXT: - TypeName: char
+; CHECK-NEXT: Size: 1
; CHECK-NEXT: Align: 1
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: char
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_ushort2
+; CHECK-NEXT: SymbolName: 'test_ushort2@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: ushort2
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: U16
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: ushort2
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_int3
+; CHECK-NEXT: SymbolName: 'test_int3@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 16
+; CHECK-NEXT: - TypeName: int3
+; CHECK-NEXT: Size: 16
; CHECK-NEXT: Align: 16
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int3
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_ulong4
+; CHECK-NEXT: SymbolName: 'test_ulong4@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 32
+; CHECK-NEXT: - TypeName: ulong4
+; CHECK-NEXT: Size: 32
; CHECK-NEXT: Align: 32
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: U64
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: ulong4
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_half8
+; CHECK-NEXT: SymbolName: 'test_half8@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 16
+; CHECK-NEXT: - TypeName: half8
+; CHECK-NEXT: Size: 16
; CHECK-NEXT: Align: 16
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: F16
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: half8
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_float16
+; CHECK-NEXT: SymbolName: 'test_float16@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 64
+; CHECK-NEXT: - TypeName: float16
+; CHECK-NEXT: Size: 64
; CHECK-NEXT: Align: 64
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: F32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: float16
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_double16
+; CHECK-NEXT: SymbolName: 'test_double16@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 128
+; CHECK-NEXT: - TypeName: double16
+; CHECK-NEXT: Size: 128
; CHECK-NEXT: Align: 128
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: F64
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: double16
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_pointer
+; CHECK-NEXT: SymbolName: 'test_pointer@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: 'int *'
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_image
+; CHECK-NEXT: SymbolName: 'test_image@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: image2d_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Image
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: image2d_t
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_sampler
+; CHECK-NEXT: SymbolName: 'test_sampler@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: sampler_t
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: Sampler
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: sampler_t
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_queue
+; CHECK-NEXT: SymbolName: 'test_queue@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: queue_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Queue
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: queue_t
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_struct
+; CHECK-NEXT: SymbolName: 'test_struct@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: struct A
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Private
-; CHECK-NEXT: TypeName: struct A
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_i128
+; CHECK-NEXT: SymbolName: 'test_i128@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 16
+; CHECK-NEXT: - TypeName: i128
+; CHECK-NEXT: Size: 16
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: Struct
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: i128
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_multi_arg
+; CHECK-NEXT: SymbolName: 'test_multi_arg@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: short2
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I16
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: short2
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: char3
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: char3
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_addr_space
+; CHECK-NEXT: SymbolName: 'test_addr_space@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: 'int *'
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Constant
-; CHECK-NEXT: TypeName: 'int *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: PointeeAlign: 4
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'int *'
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_type_qual
+; CHECK-NEXT: SymbolName: 'test_type_qual@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: IsVolatile: true
-; CHECK-NEXT: TypeName: 'int *'
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: IsConst: true
; CHECK-NEXT: IsRestrict: true
-; CHECK-NEXT: TypeName: 'int *'
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Pipe
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: IsPipe: true
-; CHECK-NEXT: TypeName: 'int *'
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_access_qual
+; CHECK-NEXT: SymbolName: 'test_access_qual@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: image1d_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Image
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: ReadOnly
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: image1d_t
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: AccQual: ReadOnly
+; CHECK-NEXT: - TypeName: image2d_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Image
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: WriteOnly
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: image2d_t
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: AccQual: WriteOnly
+; CHECK-NEXT: - TypeName: image3d_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: Image
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: ReadWrite
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: image3d_t
+; CHECK-NEXT: AccQual: ReadWrite
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_half
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_half@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: half
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_float
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_float@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: float
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_double
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_double@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: double
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_char
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_char@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: char
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_short
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_short@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: short
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_long
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_long@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: long
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_vec_type_hint_unknown
+; CHECK-NEXT: SymbolName: 'test_vec_type_hint_unknown@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: VecTypeHint: unknown
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_reqd_wgs_vec_type_hint
+; CHECK-NEXT: SymbolName: 'test_reqd_wgs_vec_type_hint@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: ReqdWorkGroupSize: [ 1, 2, 4 ]
; CHECK-NEXT: VecTypeHint: int
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_wgs_hint_vec_type_hint
+; CHECK-NEXT: SymbolName: 'test_wgs_hint_vec_type_hint@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: WorkGroupSizeHint: [ 8, 16, 32 ]
; CHECK-NEXT: VecTypeHint: uint4
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: int
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: int
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_arg_ptr_to_ptr
+; CHECK-NEXT: SymbolName: 'test_arg_ptr_to_ptr@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'int **'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I32
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: 'int **'
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_arg_struct_contains_ptr
+; CHECK-NEXT: SymbolName: 'test_arg_struct_contains_ptr@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: - TypeName: struct B
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Private
-; CHECK-NEXT: TypeName: struct B
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_arg_vector_of_ptr
+; CHECK-NEXT: SymbolName: 'test_arg_vector_of_ptr@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 16
+; CHECK-NEXT: - TypeName: 'global int* __attribute__((ext_vector_type(2)))'
+; CHECK-NEXT: Size: 16
; CHECK-NEXT: Align: 16
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: I32
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: 'global int* __attribute__((ext_vector_type(2)))'
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_arg_unknown_builtin_type
+; CHECK-NEXT: SymbolName: 'test_arg_unknown_builtin_type@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: clk_event_t
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: Struct
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: clk_event_t
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: test_pointee_align
+; CHECK-NEXT: SymbolName: 'test_pointee_align@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 8
+; CHECK-NEXT: - TypeName: 'long *'
+; CHECK-NEXT: Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: GlobalBuffer
; CHECK-NEXT: ValueType: I64
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Global
-; CHECK-NEXT: TypeName: 'long *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 1
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char2 *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 2
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char2 *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char3 *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 4
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char3 *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char4 *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 4
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char4 *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char8 *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 8
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char8 *'
-; CHECK-NEXT: - Size: 4
+; CHECK-NEXT: AccQual: Default
+; CHECK-NEXT: - TypeName: 'char16 *'
+; CHECK-NEXT: Size: 4
; CHECK-NEXT: Align: 4
; CHECK-NEXT: ValueKind: DynamicSharedPointer
; CHECK-NEXT: ValueType: I8
; CHECK-NEXT: PointeeAlign: 16
-; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: AddrSpaceQual: Local
-; CHECK-NEXT: TypeName: 'char16 *'
+; CHECK-NEXT: AccQual: Default
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
}
; CHECK: - Name: __test_block_invoke_kernel
+; CHECK-NEXT: SymbolName: '__test_block_invoke_kernel@kd'
; CHECK-NEXT: Language: OpenCL C
; CHECK-NEXT: LanguageVersion: [ 2, 0 ]
; CHECK-NEXT: Attrs:
; CHECK-NEXT: RuntimeHandle: __test_block_invoke_kernel_runtime_handle
; CHECK-NEXT: Args:
-; CHECK-NEXT: - Size: 25
+; CHECK-NEXT: - TypeName: __block_literal
+; CHECK-NEXT: Size: 25
; CHECK-NEXT: Align: 1
; CHECK-NEXT: ValueKind: ByValue
; CHECK-NEXT: ValueType: Struct
; CHECK-NEXT: AccQual: Default
-; CHECK-NEXT: TypeName: __block_literal
; CHECK-NEXT: - Size: 8
; CHECK-NEXT: Align: 8
; CHECK-NEXT: ValueKind: HiddenGlobalOffsetX
; CHECK: Version: [ 1, 0 ]
; CHECK: Kernels:
-; CHECK: - Name: test
+; CHECK: - Name: test
+; CHECK: SymbolName: 'test@kd'
; CHECK: Args:
-; CHECK: - Size: 8
+; CHECK: - TypeName: image1d_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image1d_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image1d_array_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image1d_array_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image1d_buffer_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image1d_buffer_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_array_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_array_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_array_depth_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_array_depth_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_array_msaa_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_array_msaa_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_array_msaa_depth_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_array_msaa_depth_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_depth_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_depth_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_msaa_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_msaa_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image2d_msaa_depth_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image2d_msaa_depth_t
-; CHECK: - Size: 8
+; CHECK: - TypeName: image3d_t
+; CHECK: Size: 8
; CHECK: ValueKind: Image
-; CHECK: TypeName: image3d_t
define amdgpu_kernel void @test(%opencl.image1d_t addrspace(1)* %a,
%opencl.image1d_array_t addrspace(1)* %b,
%opencl.image1d_buffer_t addrspace(1)* %c,
; CHECK: Version: [ 1, 0 ]
; CHECK: Kernels:
-; CHECK: - Name: test
+; CHECK: - Name: test
+; CHECK: SymbolName: 'test@kd'
; CHECK: CodeProps:
; CHECK: KernargSegmentSize: 24
-; GFX700: WavefrontNumSGPRs: 6
-; GFX800: WavefrontNumSGPRs: 96
-; GFX900: WavefrontNumSGPRs: 6
-; GFX700: WorkitemNumVGPRs: 4
-; GFX800: WorkitemNumVGPRs: 6
-; GFX900: WorkitemNumVGPRs: 6
-; CHECK: KernargSegmentAlign: 4
-; CHECK: GroupSegmentAlign: 4
-; CHECK: PrivateSegmentAlign: 4
-; CHECK: WavefrontSize: 6
+; CHECK: GroupSegmentFixedSize: 0
+; CHECK: PrivateSegmentFixedSize: 0
+; CHECK: KernargSegmentAlign: 8
+; CHECK: WavefrontSize: 64
+; GFX700: NumSGPRs: 6
+; GFX800: NumSGPRs: 96
+; GFX900: NumSGPRs: 6
+; GFX700: NumVGPRs: 4
+; GFX800: NumVGPRs: 6
+; GFX900: NumVGPRs: 6
define amdgpu_kernel void @test(
half addrspace(1)* %r,
half addrspace(1)* %a,
; CHECK: Version: [ 1, 0 ]
; CHECK: Kernels:
-; CHECK: - Name: test
+; CHECK: - Name: test
+; CHECK: SymbolName: 'test@kd'
; CHECK: DebugProps:
; CHECK: DebuggerABIVersion: [ 1, 0 ]
; CHECK: ReservedNumVGPRs: 4
// CHECK: - '2:1:8:%g\n'
// CHECK: Kernels:
// CHECK: - Name: test_kernel
+// CHECK: SymbolName: 'test_kernel@kd'
// CHECK: Language: OpenCL C
// CHECK: LanguageVersion: [ 2, 0 ]
// CHECK: Args:
-// CHECK: - Size: 1
+// CHECK: - TypeName: char
+// CHECK: Size: 1
// CHECK: Align: 1
// CHECK: ValueKind: ByValue
// CHECK: ValueType: I8
// CHECK: AccQual: Default
-// CHECK: TypeName: char
// CHECK: - Size: 8
// CHECK: Align: 8
// CHECK: ValueKind: HiddenGlobalOffsetX
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
Kernels:
- Name: test_kernel
+ SymbolName: test_kernel@kd
Language: OpenCL C
LanguageVersion: [ 2, 0 ]
Args:
- - Size: 1
+ - TypeName: char
+ Size: 1
Align: 1
ValueKind: ByValue
ValueType: I8
AccQual: Default
- TypeName: char
- Size: 8
Align: 8
ValueKind: HiddenGlobalOffsetX
// CHECK: - '2:1:8:%g\n'
// CHECK: Kernels:
// CHECK: - Name: test_kernel
+// CHECK: SymbolName: 'test_kernel@kd'
// CHECK: Language: OpenCL C
// CHECK: LanguageVersion: [ 2, 0 ]
// CHECK: Attrs:
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
Kernels:
- Name: test_kernel
+ SymbolName: test_kernel@kd
Language: OpenCL C
LanguageVersion: [ 2, 0 ]
Attrs:
// CHECK: .amd_amdgpu_hsa_metadata
// CHECK: Version: [ 1, 0 ]
// CHECK: Kernels:
-// CHECK: - Name: test_kernel
+// CHECK: - Name: test_kernel
+// CHECK: SymbolName: 'test_kernel@kd'
// CHECK: CodeProps:
-// CHECK: KernargSegmentSize: 24
-// CHECK: WorkitemPrivateSegmentSize: 16
-// CHECK: WavefrontNumSGPRs: 6
-// CHECK: WorkitemNumVGPRs: 12
+// CHECK: KernargSegmentSize: 24
+// CHECK: GroupSegmentFixedSize: 24
+// CHECK: PrivateSegmentFixedSize: 16
+// CHECK: KernargSegmentAlign: 16
+// CHECK: WavefrontSize: 64
.amd_amdgpu_hsa_metadata
Version: [ 1, 0 ]
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
Kernels:
- Name: test_kernel
+ SymbolName: test_kernel@kd
CodeProps:
- KernargSegmentSize: 24
- WorkitemPrivateSegmentSize: 16
- WavefrontNumSGPRs: 6
- WorkitemNumVGPRs: 12
+ KernargSegmentSize: 24
+ GroupSegmentFixedSize: 24
+ PrivateSegmentFixedSize: 16
+ KernargSegmentAlign: 16
+ WavefrontSize: 64
.end_amd_amdgpu_hsa_metadata
// CHECK: .amd_amdgpu_hsa_metadata
// CHECK: Version: [ 1, 0 ]
// CHECK: Kernels:
-// CHECK: - Name: test_kernel
+// CHECK: - Name: test_kernel
+// CHECK: SymbolName: 'test_kernel@kd'
// CHECK: DebugProps:
// CHECK: DebuggerABIVersion: [ 1, 0 ]
// CHECK: ReservedNumVGPRs: 4
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
Kernels:
- Name: test_kernel
+ SymbolName: test_kernel@kd
DebugProps:
DebuggerABIVersion: [ 1, 0 ]
ReservedNumVGPRs: 4
Printf: [ '1:1:4:%d\n', '2:1:8:%g\n' ]
Kernels:
- Name: test_kernel
+ SymbolName: test_kernel@kd
Language: OpenCL C
LanguageVersion: [ 2, 0 ]
Args:
.amd_amdgpu_hsa_metadata
Version: [ 3, 0 ]
Kernels:
- - Name: amd_kernel_code_t_test_all
- - Name: amd_kernel_code_t_minimal
+ - Name: amd_kernel_code_t_test_all
+ SymbolName: amd_kernel_code_t_test_all@kd
+ - Name: amd_kernel_code_t_minimal
+ SymbolName: amd_kernel_code_t_minimal@kd
.end_amd_amdgpu_hsa_metadata
// ASM: .amd_amdgpu_hsa_metadata
// ASM: Version: [ 3, 0 ]
// ASM: Kernels:
-// ASM: - Name: amd_kernel_code_t_test_all
-// ASM: - Name: amd_kernel_code_t_minimal
+// ASM: - Name: amd_kernel_code_t_test_all
+// ASM: SymbolName: 'amd_kernel_code_t_test_all@kd'
+// ASM: - Name: amd_kernel_code_t_minimal
+// ASM: SymbolName: 'amd_kernel_code_t_minimal@kd'
// ASM: .end_amd_amdgpu_hsa_metadata
.amdgpu_hsa_kernel amd_kernel_code_t_test_all