Commit 52af6b97 authored by Tom Stellard's avatar Tom Stellard
Browse files

Merging r298551:

------------------------------------------------------------------------
r298551 | kzhuravl | 2017-03-22 17:48:18 -0400 (Wed, 22 Mar 2017) | 4 lines

[AMDGPU] Fix bug 31610

Differential Revision: https://reviews.llvm.org/D31258

------------------------------------------------------------------------

llvm-svn: 299441
parent db94c8bf
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@ namespace AMDGPU {
namespace RuntimeMD {

  // Version and revision of runtime metadata
  const unsigned char MDVersion   = 2;
  const unsigned char MDRevision  = 0;
  const uint32_t MDVersion   = 2;
  const uint32_t MDRevision  = 0;

  // Name of keys for runtime metadata.
  namespace KeyName {
@@ -157,7 +157,7 @@ namespace RuntimeMD {
    struct Metadata {
      std::string Name;
      std::string Language;
      std::vector<uint8_t> LanguageVersion;
      std::vector<uint32_t> LanguageVersion;
      std::vector<uint32_t> ReqdWorkGroupSize;
      std::vector<uint32_t> WorkGroupSizeHint;
      std::string VecTypeHint;
@@ -171,7 +171,7 @@ namespace RuntimeMD {
  namespace Program {
    // In-memory representation of program information.
    struct Metadata {
      std::vector<uint8_t> MDVersionSeq;
      std::vector<uint32_t> MDVersionSeq;
      std::vector<std::string> PrintfInfo;
      std::vector<Kernel::Metadata> Kernels;

+2 −3
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@ static cl::opt<bool>
CheckRuntimeMDParser("amdgpu-check-rtmd-parser", cl::Hidden,
                     cl::desc("Check AMDGPU runtime metadata YAML parser"));

LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint8_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(uint32_t)
LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(std::string)
LLVM_YAML_IS_SEQUENCE_VECTOR(Kernel::Metadata)
@@ -266,9 +265,9 @@ static Kernel::Metadata getRuntimeMDForKernel(const Function &F) {
      auto Node = MD->getOperand(0);
      if (Node->getNumOperands() > 1) {
        Kernel.Language = "OpenCL C";
        uint16_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
        uint32_t Major = mdconst::extract<ConstantInt>(Node->getOperand(0))
                         ->getZExtValue();
        uint16_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
        uint32_t Minor = mdconst::extract<ConstantInt>(Node->getOperand(1))
                         ->getZExtValue();
        Kernel.LanguageVersion.push_back(Major);
        Kernel.LanguageVersion.push_back(Minor);