[llvm] r268647 - AMDGPU/SI: Add support for AMD code object version 2.

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Thu May 5 10:03:33 PDT 2016


Author: tstellar
Date: Thu May  5 12:03:33 2016
New Revision: 268647

URL: http://llvm.org/viewvc/llvm-project?rev=268647&view=rev
Log:
AMDGPU/SI: Add support for AMD code object version 2.

Summary:
Version 2 is now the default.  If you want to emit version 1, use
the amdgcn--amdhsa-amdcov1 triple.

Reviewers: arsenm, kzhuravl

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D19283

Modified:
    llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
    llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
    llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
    llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h
    llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
    llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp
    llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h
    llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
    llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
    llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
    llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll
    llvm/trunk/test/CodeGen/AMDGPU/hsa.ll
    llvm/trunk/test/MC/AMDGPU/hsa-text.s
    llvm/trunk/test/MC/AMDGPU/hsa.s
    llvm/trunk/test/Object/AMDGPU/objdump.s

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Thu May  5 12:03:33 2016
@@ -104,7 +104,8 @@ void AMDGPUAsmPrinter::EmitStartOfAsmFil
   AMDGPUTargetStreamer *TS =
       static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());
 
-  TS->EmitDirectiveHSACodeObjectVersion(1, 0);
+  TS->EmitDirectiveHSACodeObjectVersion(2, 0);
+
   AMDGPU::IsaVersion ISA = AMDGPU::getIsaVersion(STI->getFeatureBits());
   TS->EmitDirectiveHSACodeObjectISA(ISA.Major, ISA.Minor, ISA.Stepping,
                                     "AMD", "AMDGPU");
@@ -132,56 +133,13 @@ void AMDGPUAsmPrinter::EmitFunctionEntry
   AsmPrinter::EmitFunctionEntryLabel();
 }
 
-static bool isModuleLinkage(const GlobalValue *GV) {
-  switch (GV->getLinkage()) {
-  case GlobalValue::LinkOnceODRLinkage:
-  case GlobalValue::LinkOnceAnyLinkage:
-  case GlobalValue::InternalLinkage:
-  case GlobalValue::CommonLinkage:
-   return true;
-  case GlobalValue::ExternalLinkage:
-   return false;
-  default: llvm_unreachable("unknown linkage type");
-  }
-}
-
 void AMDGPUAsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
 
-  if (TM.getTargetTriple().getOS() != Triple::AMDHSA) {
-    AsmPrinter::EmitGlobalVariable(GV);
-    return;
-  }
-
-  if (GV->isDeclaration() || GV->getLinkage() == GlobalValue::PrivateLinkage) {
-    AsmPrinter::EmitGlobalVariable(GV);
-    return;
-  }
-
   // Group segment variables aren't emitted in HSA.
   if (AMDGPU::isGroupSegment(GV))
     return;
 
-  AMDGPUTargetStreamer *TS =
-      static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());
-  if (isModuleLinkage(GV)) {
-    TS->EmitAMDGPUHsaModuleScopeGlobal(GV->getName());
-  } else {
-    TS->EmitAMDGPUHsaProgramScopeGlobal(GV->getName());
-  }
-
-  MCSymbolELF *GVSym = cast<MCSymbolELF>(getSymbol(GV));
-  const DataLayout &DL = getDataLayout();
-
-  // Emit the size
-  uint64_t Size = DL.getTypeAllocSize(GV->getType()->getElementType());
-  OutStreamer->emitELFSize(GVSym, MCConstantExpr::create(Size, OutContext));
-  OutStreamer->PushSection();
-  OutStreamer->SwitchSection(
-      getObjFileLowering().SectionForGlobal(GV, *Mang, TM));
-  const Constant *C = GV->getInitializer();
-  OutStreamer->EmitLabel(GVSym);
-  EmitGlobalConstant(DL, C);
-  OutStreamer->PopSection();
+  AsmPrinter::EmitGlobalVariable(GV);
 }
 
 bool AMDGPUAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
@@ -717,6 +675,8 @@ void AMDGPUAsmPrinter::EmitAmdKernelCode
 
   AMDGPUTargetStreamer *TS =
       static_cast<AMDGPUTargetStreamer *>(OutStreamer->getTargetStreamer());
+
+  OutStreamer->SwitchSection(getObjFileLowering().getTextSection());
   TS->EmitAMDKernelCodeT(header);
 }
 

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp Thu May  5 12:03:33 2016
@@ -61,9 +61,6 @@ extern "C" void LLVMInitializeAMDGPUTarg
 }
 
 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
-  if (TT.getOS() == Triple::AMDHSA)
-    return make_unique<AMDGPUHSATargetObjectFile>();
-
   return make_unique<AMDGPUTargetObjectFile>();
 }
 

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.cpp Thu May  5 12:03:33 2016
@@ -29,59 +29,3 @@ MCSection *AMDGPUTargetObjectFile::Selec
 
   return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, Mang, TM);
 }
-
-//===----------------------------------------------------------------------===//
-// HSA Object File
-//===----------------------------------------------------------------------===//
-
-
-void AMDGPUHSATargetObjectFile::Initialize(MCContext &Ctx,
-                                           const TargetMachine &TM){
-  TargetLoweringObjectFileELF::Initialize(Ctx, TM);
-  InitializeELF(TM.Options.UseInitArray);
-
-  TextSection = AMDGPU::getHSATextSection(Ctx);
-
-  DataGlobalAgentSection = AMDGPU::getHSADataGlobalAgentSection(Ctx);
-  DataGlobalProgramSection = AMDGPU::getHSADataGlobalProgramSection(Ctx);
-
-  RodataReadonlyAgentSection = AMDGPU::getHSARodataReadonlyAgentSection(Ctx);
-}
-
-bool AMDGPUHSATargetObjectFile::isAgentAllocationSection(
-    const char *SectionName) const {
-  return cast<MCSectionELF>(DataGlobalAgentSection)
-      ->getSectionName()
-      .equals(SectionName);
-}
-
-bool AMDGPUHSATargetObjectFile::isAgentAllocation(const GlobalValue *GV) const {
-  // Read-only segments can only have agent allocation.
-  return AMDGPU::isReadOnlySegment(GV) ||
-         (AMDGPU::isGlobalSegment(GV) && GV->hasSection() &&
-          isAgentAllocationSection(GV->getSection()));
-}
-
-bool AMDGPUHSATargetObjectFile::isProgramAllocation(
-    const GlobalValue *GV) const {
-  // The default for global segments is program allocation.
-  return AMDGPU::isGlobalSegment(GV) && !isAgentAllocation(GV);
-}
-
-MCSection *AMDGPUHSATargetObjectFile::SelectSectionForGlobal(
-                                        const GlobalValue *GV, SectionKind Kind,
-                                        Mangler &Mang,
-                                        const TargetMachine &TM) const {
-  if (Kind.isText() && !GV->hasComdat())
-    return getTextSection();
-
-  if (AMDGPU::isGlobalSegment(GV)) {
-    if (isAgentAllocation(GV))
-      return DataGlobalAgentSection;
-
-    if (isProgramAllocation(GV))
-      return DataGlobalProgramSection;
-  }
-
-  return AMDGPUTargetObjectFile::SelectSectionForGlobal(GV, Kind, Mang, TM);
-}

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetObjectFile.h Thu May  5 12:03:33 2016
@@ -28,24 +28,6 @@ class AMDGPUTargetObjectFile : public Ta
                                       const TargetMachine &TM) const override;
 };
 
-class AMDGPUHSATargetObjectFile final : public AMDGPUTargetObjectFile {
-private:
-  MCSection *DataGlobalAgentSection;
-  MCSection *DataGlobalProgramSection;
-  MCSection *RodataReadonlyAgentSection;
-
-  bool isAgentAllocationSection(const char *SectionName) const;
-  bool isAgentAllocation(const GlobalValue *GV) const;
-  bool isProgramAllocation(const GlobalValue *GV) const;
-
-public:
-  void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
-
-  MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
-                                    Mangler &Mang,
-                                    const TargetMachine &TM) const override;
-};
-
 } // end namespace llvm
 
 #endif

Modified: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp Thu May  5 12:03:33 2016
@@ -1083,7 +1083,7 @@ bool AMDGPUAsmParser::ParseDirective(Asm
   if (IDVal == ".amd_kernel_code_t")
     return ParseDirectiveAMDKernelCodeT();
 
-  if (IDVal == ".hsatext" || IDVal == ".text")
+  if (IDVal == ".hsatext")
     return ParseSectionDirectiveHSAText();
 
   if (IDVal == ".amdgpu_hsa_kernel")

Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.cpp Thu May  5 12:03:33 2016
@@ -12,11 +12,6 @@
 
 using namespace llvm;
 
-void AMDGPUELFStreamer::InitSections(bool NoExecStack) {
-  // Start with the .hsatext section by default.
-  SwitchSection(AMDGPU::getHSATextSection(getContext()));
-}
-
 MCELFStreamer *llvm::createAMDGPUELFStreamer(MCContext &Context,
                                            MCAsmBackend &MAB,
                                            raw_pwrite_stream &OS,

Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUELFStreamer.h Thu May  5 12:03:33 2016
@@ -29,7 +29,6 @@ public:
                   MCCodeEmitter *Emitter)
       : MCELFStreamer(Context, MAB, OS, Emitter) { }
 
-  virtual void InitSections(bool NoExecStac) override;
 };
 
 MCELFStreamer *createAMDGPUELFStreamer(MCContext &Context, MCAsmBackend &MAB,

Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp Thu May  5 12:03:33 2016
@@ -312,10 +312,6 @@ AMDGPUTargetELFStreamer::EmitAMDKernelCo
 
   MCStreamer &OS = getStreamer();
   OS.PushSection();
-  // The MCObjectFileInfo that is available to the assembler is a generic
-  // implementation and not AMDGPUHSATargetObjectFile, so we can't use
-  // MCObjectFileInfo::getTextSection() here for fetching the HSATextSection.
-  OS.SwitchSection(AMDGPU::getHSATextSection(OS.getContext()));
   OS.EmitBytes(StringRef((const char*)&Header, sizeof(Header)));
   OS.PopSection();
 }

Modified: llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/global-constant.ll Thu May  5 12:03:33 2016
@@ -12,7 +12,7 @@
 ; GCN-NEXT: s_add_u32 s{{[0-9]+}}, s[[PC1_LO]], readonly
 ; GCN: s_addc_u32 s{{[0-9]+}}, s[[PC1_HI]], 0
 ; NOHSA: .text
-; HSA: .hsatext
+; HSA: .text
 ; GCN: readonly:
 ; GCN: readonly2:
 define void @main(i32 %index, float addrspace(1)* %out) {

Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-globals.ll Thu May  5 12:03:33 2016
@@ -1,5 +1,4 @@
 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck --check-prefix=ASM %s
-; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri | llvm-readobj -symbols -s | FileCheck %s --check-prefix=ELF
 
 @linkonce_odr_global_program = linkonce_odr addrspace(1) global i32 0
 @linkonce_global_program = linkonce addrspace(1) global i32 0
@@ -7,12 +6,6 @@
 @common_global_program = common addrspace(1) global i32 0
 @external_global_program = addrspace(1) global i32 0
 
- at linkonce_odr_global_agent = linkonce_odr addrspace(1) global i32 0, section ".hsadata_global_agent"
- at linkonce_global_agent = linkonce addrspace(1) global i32 0, section ".hsadata_global_agent"
- at internal_global_agent = internal addrspace(1) global i32 0, section ".hsadata_global_agent"
- at common_global_agent = common addrspace(1) global i32 0, section ".hsadata_global_agent"
- at external_global_agent = addrspace(1) global i32 0, section ".hsadata_global_agent"
-
 @internal_readonly = internal unnamed_addr addrspace(2) constant i32 0
 @external_readonly = unnamed_addr addrspace(2) constant i32 0
 
@@ -20,185 +13,38 @@ define void @test() {
   ret void
 }
 
-; ASM: .amdgpu_hsa_module_global linkonce_odr_global
-; ASM: .size linkonce_odr_global_program, 4
-; ASM: .hsadata_global_program
+; ASM: .type linkonce_odr_global_program, at object
+; ASM: .section .bss,#alloc,#write
+; ASM: .weak linkonce_odr_global_program
 ; ASM: linkonce_odr_global_program:
 ; ASM: .long 0
+; ASM: .size linkonce_odr_global_program, 4
 
-; ASM: .amdgpu_hsa_module_global linkonce_global
-; ASM: .size linkonce_global_program, 4
-; ASM: .hsadata_global_program
+; ASM: .type linkonce_global_program, at object
+; ASM: .weak linkonce_global_program
 ; ASM: linkonce_global_program:
 ; ASM: .long 0
+; ASM: .size linkonce_global_program, 4
 
-; ASM: .amdgpu_hsa_module_global internal_global
-; ASM: .size internal_global_program, 4
-; ASM: .hsadata_global_program
-; ASM: internal_global_program:
-; ASM: .long 0
+; ASM: .type internal_global_program, at object
+; ASM: .local internal_global_program
+; ASM: .comm internal_global_program,4,2
 
-; ASM: .amdgpu_hsa_module_global common_global
-; ASM: .size common_global_program, 4
-; ASM: .hsadata_global_program
-; ASM: common_global_program:
-; ASM: .long 0
+; ASM: .type common_global_program, at object
+; ASM: .comm common_global_program,4,2
 
-; ASM: .amdgpu_hsa_program_global external_global
-; ASM: .size external_global_program, 4
-; ASM: .hsadata_global_program
 ; ASM: external_global_program:
 ; ASM: .long 0
+; ASM: .size external_global_program, 4
 
-; ASM: .amdgpu_hsa_module_global linkonce_odr_global
-; ASM: .size linkonce_odr_global_agent, 4
-; ASM: .hsadata_global_agent
-; ASM: linkonce_odr_global_agent:
-; ASM: .long 0
-
-; ASM: .amdgpu_hsa_module_global linkonce_global
-; ASM: .size linkonce_global_agent, 4
-; ASM: .hsadata_global_agent
-; ASM: linkonce_global_agent:
-; ASM: .long 0
-
-; ASM: .amdgpu_hsa_module_global internal_global
-; ASM: .size internal_global_agent, 4
-; ASM: .hsadata_global_agent
-; ASM: internal_global_agent:
-; ASM: .long 0
-
-; ASM: .amdgpu_hsa_module_global common_global
-; ASM: .size common_global_agent, 4
-; ASM: .hsadata_global_agent
-; ASM: common_global_agent:
-; ASM: .long 0
-
-; ASM: .amdgpu_hsa_program_global external_global
-; ASM: .size external_global_agent, 4
-; ASM: .hsadata_global_agent
-; ASM: external_global_agent:
-; ASM: .long 0
-
-; ASM: .amdgpu_hsa_module_global internal_readonly
-; ASM: .size internal_readonly, 4
-; ASM: .hsatext
+; ASM: .type internal_readonly, at object
+; ASM: .text
 ; ASM: internal_readonly:
 ; ASM: .long 0
+; ASM: .size internal_readonly, 4
 
-; ASM: .amdgpu_hsa_program_global external_readonly
-; ASM: .size external_readonly, 4
-; ASM: .hsatext
+; ASM: .type external_readonly, at object
+; ASM: .globl external_readonly
 ; ASM: external_readonly:
 ; ASM: .long 0
-
-; ELF: Section {
-; ELF: Name: .hsadata_global_program
-; ELF: Type: SHT_PROGBITS (0x1)
-; ELF: Flags [ (0x100003)
-; ELF: SHF_ALLOC (0x2)
-; ELF: SHF_AMDGPU_HSA_GLOBAL (0x100000)
-; ELF: SHF_WRITE (0x1)
-; ELF: ]
-; ELF: }
-
-; ELF: Section {
-; ELF: Name: .hsadata_global_agent
-; ELF: Type: SHT_PROGBITS (0x1)
-; ELF: Flags [ (0x900003)
-; ELF: SHF_ALLOC (0x2)
-; ELF: SHF_AMDGPU_HSA_AGENT (0x800000)
-; ELF: SHF_AMDGPU_HSA_GLOBAL (0x100000)
-; ELF: SHF_WRITE (0x1)
-; ELF: ]
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: common_global_agent
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_agent
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: common_global_program
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_program
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: internal_global_agent
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Type: Object
-; ELF: Section: .hsadata_global_agent
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: internal_global_program
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Type: Object
-; ELF: Section: .hsadata_global_program
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: internal_readonly
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Type: Object
-; ELF: Section: .hsatext
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: linkonce_global_agent
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_agent
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: linkonce_global_program
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_program
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: linkonce_odr_global_agent
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_agent
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: linkonce_odr_global_program
-; ELF: Size: 4
-; ELF: Binding: Local
-; ELF: Section: .hsadata_global_program
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: external_global_agent
-; ELF: Size: 4
-; ELF: Binding: Global
-; ELF: Type: Object
-; ELF: Section: .hsadata_global_agent
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: external_global_program
-; ELF: Size: 4
-; ELF: Binding: Global
-; ELF: Type: Object
-; ELF: Section: .hsadata_global_program
-; ELF: }
-
-; ELF: Symbol {
-; ELF: Name: external_readonly
-; ELF: Size: 4
-; ELF: Binding: Global
-; ELF: Type: Object
-; ELF: Section: .hsatext
-; ELF: }
+; ASM: .size external_readonly, 4

Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa-note-no-func.ll Thu May  5 12:03:33 2016
@@ -2,7 +2,7 @@
 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=carrizo | FileCheck --check-prefix=HSA --check-prefix=HSA-VI %s
 ; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=fiji | FileCheck --check-prefix=HSA --check-prefix=HSA-FIJI %s
 
-; HSA: .hsa_code_object_version 1,0
+; HSA: .hsa_code_object_version 2,0
 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
 ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
 ; HSA-FIJI: .hsa_code_object_isa 8,0,3,"AMD","AMDGPU"

Modified: llvm/trunk/test/CodeGen/AMDGPU/hsa.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/hsa.ll?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/hsa.ll (original)
+++ llvm/trunk/test/CodeGen/AMDGPU/hsa.ll Thu May  5 12:03:33 2016
@@ -9,19 +9,16 @@
 ; directives.
 
 ; ELF: Section {
-; ELF: Name: .hsatext
+; ELF: Name: .text
 ; ELF: Type: SHT_PROGBITS (0x1)
-; ELF: Flags [ (0xC00007)
+; ELF: Flags [ (0x6)
 ; ELF: SHF_ALLOC (0x2)
-; ELF: SHF_AMDGPU_HSA_AGENT (0x800000)
-; ELF: SHF_AMDGPU_HSA_CODE (0x400000)
 ; ELF: SHF_EXECINSTR (0x4)
-; ELF: SHF_WRITE (0x1)
 ; ELF: }
 
 ; ELF: SHT_NOTE
 ; ELF: 0000: 04000000 08000000 01000000 414D4400
-; ELF: 0010: 01000000 00000000 04000000 1B000000
+; ELF: 0010: 02000000 00000000 04000000 1B000000
 ; ELF: 0020: 03000000 414D4400 04000700 07000000
 ; ELF: 0030: 00000000 00000000 414D4400 414D4447
 ; ELF: 0040: 50550000
@@ -32,11 +29,11 @@
 ; ELF: Type: AMDGPU_HSA_KERNEL (0xA)
 ; ELF: }
 
-; HSA: .hsa_code_object_version 1,0
+; HSA: .hsa_code_object_version 2,0
 ; HSA-CI: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
 ; HSA-VI: .hsa_code_object_isa 8,0,1,"AMD","AMDGPU"
 
-; HSA: .hsatext
+; HSA: .text
 
 ; HSA: .amdgpu_hsa_kernel simple
 ; HSA: {{^}}simple:

Modified: llvm/trunk/test/MC/AMDGPU/hsa-text.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/hsa-text.s?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/hsa-text.s (original)
+++ llvm/trunk/test/MC/AMDGPU/hsa-text.s Thu May  5 12:03:33 2016
@@ -5,29 +5,23 @@
 
 // ELF: Section {
 
-// We want to avoid emitting an empty .text section.
-// ELF-NOT: Name: .text
-
-// ELF: Name: .hsatext
+// ELF: Name: .text
 // ELF: Type: SHT_PROGBITS (0x1)
-// ELF: Flags [ (0xC00007)
+// ELF: Flags [ (0x6)
 // ELF: SHF_ALLOC (0x2)
-// ELF: SHF_AMDGPU_HSA_AGENT (0x800000)
-// ELF: SHF_AMDGPU_HSA_CODE (0x400000)
 // ELF: SHF_EXECINSTR (0x4)
-// ELF: SHF_WRITE (0x1)
 // ELF: Size: 260
 // ELF: }
 
+.text
+// ASM: .text
+
 .hsa_code_object_version 1,0
 // ASM: .hsa_code_object_version 1,0
 
 .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
 // ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
 
-.text
-// ASM: .hsatext
-
 .amd_kernel_code_t
 .end_amd_kernel_code_t
 

Modified: llvm/trunk/test/MC/AMDGPU/hsa.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/hsa.s?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/MC/AMDGPU/hsa.s (original)
+++ llvm/trunk/test/MC/AMDGPU/hsa.s Thu May  5 12:03:33 2016
@@ -2,18 +2,15 @@
 // RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | llvm-readobj -symbols -s -sd | FileCheck %s --check-prefix=ELF
 
 // ELF: Section {
-// ELF: Name: .hsatext
+// ELF: Name: .text
 // ELF: Type: SHT_PROGBITS (0x1)
-// ELF: Flags [ (0xC00007)
+// ELF: Flags [ (0x6)
 // ELF: SHF_ALLOC (0x2)
-// ELF: SHF_AMDGPU_HSA_AGENT (0x800000)
-// ELF: SHF_AMDGPU_HSA_CODE (0x400000)
 // ELF: SHF_EXECINSTR (0x4)
-// ELF: SHF_WRITE (0x1)
 
 // ELF: SHT_NOTE
 // ELF: 0000: 04000000 08000000 01000000 414D4400
-// ELF: 0010: 01000000 00000000 04000000 1B000000
+// ELF: 0010: 02000000 00000000 04000000 1B000000
 // ELF: 0020: 03000000 414D4400 04000700 07000000
 // ELF: 0030: 00000000 00000000 414D4400 414D4447
 // ELF: 0040: 50550000
@@ -21,17 +18,19 @@
 // ELF: Symbol {
 // ELF: Name: amd_kernel_code_t_minimal
 // ELF: Type: AMDGPU_HSA_KERNEL (0xA)
-// ELF: Section: .hsatext
+// ELF: Section: .text
 // ELF: }
 // ELF: Symbol {
 // ELF: Name: amd_kernel_code_t_test_all
 // ELF: Type: AMDGPU_HSA_KERNEL (0xA)
-// ELF: Section: .hsatext
+// ELF: Section: .text
 // ELF: }
 
+.text
+// ASM: .text
 
-.hsa_code_object_version 1,0
-// ASM: .hsa_code_object_version 1,0
+.hsa_code_object_version 2,0
+// ASM: .hsa_code_object_version 2,0
 
 .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
 // ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU"
@@ -39,8 +38,6 @@
 .amdgpu_hsa_kernel amd_kernel_code_t_test_all
 .amdgpu_hsa_kernel amd_kernel_code_t_minimal
 
-.hsatext
-// ASM: .hsatext
 
 amd_kernel_code_t_test_all:
 ; Test all amd_kernel_code_t members with non-default values.

Modified: llvm/trunk/test/Object/AMDGPU/objdump.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Object/AMDGPU/objdump.s?rev=268647&r1=268646&r2=268647&view=diff
==============================================================================
--- llvm/trunk/test/Object/AMDGPU/objdump.s (original)
+++ llvm/trunk/test/Object/AMDGPU/objdump.s Thu May  5 12:03:33 2016
@@ -42,7 +42,7 @@ hello_world2:
         s_endpgm
 
 // CHECK:  file format ELF64-amdgpu-hsacobj
-// CHECK:  Disassembly of section .hsatext:
+// CHECK:  Disassembly of section .text:
 // CHECK:  hello_world:
 // CHECK:  s_mov_b32 m0, 0x10000                                      // 000000000100: BEFC00FF 00010000
 // CHECK:  s_load_dwordx2 s[0:1], s[4:5], 0x8                         // 000000000108: C0060002 00000008




More information about the llvm-commits mailing list