[llvm] r315808 - AMDGPU: Add support for isa version note
Bruno Cardoso Lopes via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 14 12:36:50 PDT 2017
Thanks!
On Sat, Oct 14, 2017 at 12:36 PM, Konstantin Zhuravlyov
<kzhuravl at outlook.com> wrote:
> Taking a look. Thanks.
> ________________________________
> From: Bruno Cardoso Lopes <bruno.cardoso at gmail.com>
> Sent: Saturday, October 14, 2017 3:11 PM
> To: Konstantin Zhuravlyov
> Cc: llvm-commits
> Subject: Re: [llvm] r315808 - AMDGPU: Add support for isa version note
>
> Hi,
>
> There's a test failing because of this:
> http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/43381/
>
> Can you take a look?
>
> On Sat, Oct 14, 2017 at 8:40 AM, Konstantin Zhuravlyov via
> llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> Author: kzhuravl
>> Date: Sat Oct 14 08:40:33 2017
>> New Revision: 315808
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=315808&view=rev
>> Log:
>> AMDGPU: Add support for isa version note
>>
>> - Emit NT_AMD_AMDGPU_ISA
>> - Add assembler parsing for isa version directive
>> - If isa version directive does not match command line arguments, then
>> return error
>>
>> Differential Revision: https://reviews.llvm.org/D38748
>>
>> Added:
>> llvm/trunk/test/CodeGen/AMDGPU/elf-notes.ll
>> llvm/trunk/test/MC/AMDGPU/isa-version-hsa.s
>> llvm/trunk/test/MC/AMDGPU/isa-version-pal.s
>> llvm/trunk/test/MC/AMDGPU/isa-version-unk.s
>> Modified:
>> llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
>> llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
>> llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
>> llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
>> llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
>> llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
>>
>> Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp?rev=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp Sat Oct 14 08:40:33
>> 2017
>> @@ -132,6 +132,22 @@ void AMDGPUAsmPrinter::EmitStartOfAsmFil
>> }
>>
>> void AMDGPUAsmPrinter::EmitEndOfAsmFile(Module &M) {
>> + if (TM.getTargetTriple().getArch() != Triple::amdgcn)
>> + return;
>> +
>> + // Emit ISA Version (NT_AMD_AMDGPU_ISA).
>> + std::string ISAVersionString;
>> + raw_string_ostream ISAVersionStream(ISAVersionString);
>> + IsaInfo::streamIsaVersion(getSTI(), ISAVersionStream);
>> + getTargetStreamer().EmitISAVersion(ISAVersionStream.str());
>> +
>> + // Emit HSA Metadata (NT_AMD_AMDGPU_HSA_METADATA).
>> + if (TM.getTargetTriple().getOS() == Triple::AMDHSA) {
>> + HSAMetadataStream.end();
>> +
>> getTargetStreamer().EmitHSAMetadata(HSAMetadataStream.getHSAMetadata());
>> + }
>> +
>> + // Emit PAL Metadata (NT_AMD_AMDGPU_PAL_METADATA).
>> if (TM.getTargetTriple().getOS() == Triple::AMDPAL) {
>> // Copy the PAL metadata from the map where we collected it into a
>> vector,
>> // then write it as a .note.
>> @@ -142,12 +158,6 @@ void AMDGPUAsmPrinter::EmitEndOfAsmFile(
>> }
>> getTargetStreamer().EmitPALMetadata(PALMetadataVector);
>> }
>> -
>> - if (TM.getTargetTriple().getOS() != Triple::AMDHSA)
>> - return;
>> -
>> - HSAMetadataStream.end();
>> -
>> getTargetStreamer().EmitHSAMetadata(HSAMetadataStream.getHSAMetadata());
>> }
>>
>> bool AMDGPUAsmPrinter::isBlockOnlyReachableByFallthrough(
>>
>> 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=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp Sat Oct 14
>> 08:40:33 2017
>> @@ -832,6 +832,7 @@ private:
>> bool subtargetHasRegister(const MCRegisterInfo &MRI, unsigned RegNo)
>> const;
>> bool ParseDirectiveAMDGPUHsaKernel();
>>
>> + bool ParseDirectiveISAVersion();
>> bool ParseDirectiveHSAMetadata();
>> bool ParseDirectivePALMetadata();
>>
>> @@ -2452,6 +2453,25 @@ bool AMDGPUAsmParser::ParseDirectiveAMDG
>> return false;
>> }
>>
>> +bool AMDGPUAsmParser::ParseDirectiveISAVersion() {
>> + auto ISAVersionStringFromASM = getLexer().getTok().getStringContents();
>> +
>> + std::string ISAVersionStringFromSTI;
>> + raw_string_ostream ISAVersionStreamFromSTI(ISAVersionStringFromSTI);
>> + IsaInfo::streamIsaVersion(&getSTI(), ISAVersionStreamFromSTI);
>> +
>> + if (ISAVersionStringFromASM != ISAVersionStreamFromSTI.str()) {
>> + return Error(getParser().getTok().getLoc(),
>> + ".amd_amdgpu_isa directive does not match triple and/or
>> mcpu "
>> + "arguments specified through the command line");
>> + }
>> +
>> + getTargetStreamer().EmitISAVersion(ISAVersionStreamFromSTI.str());
>> + Lex();
>> +
>> + return false;
>> +}
>> +
>> bool AMDGPUAsmParser::ParseDirectiveHSAMetadata() {
>> std::string HSAMetadataString;
>> raw_string_ostream YamlStream(HSAMetadataString);
>> @@ -2527,6 +2547,9 @@ bool AMDGPUAsmParser::ParseDirective(Asm
>> if (IDVal == ".amdgpu_hsa_kernel")
>> return ParseDirectiveAMDGPUHsaKernel();
>>
>> + if (IDVal == ".amd_amdgpu_isa")
>> + return ParseDirectiveISAVersion();
>> +
>> if (IDVal == AMDGPU::HSAMD::AssemblerDirectiveBegin)
>> return ParseDirectiveHSAMetadata();
>>
>>
>> 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=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp
>> (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.cpp Sat
>> Oct 14 08:40:33 2017
>> @@ -39,9 +39,6 @@ using namespace llvm::AMDGPU;
>> // AMDGPUTargetStreamer
>>
>> //===----------------------------------------------------------------------===//
>>
>> -AMDGPUTargetStreamer::AMDGPUTargetStreamer(MCStreamer &S)
>> - : MCTargetStreamer(S) {}
>> -
>> bool AMDGPUTargetStreamer::EmitHSAMetadata(StringRef HSAMetadataString) {
>> HSAMD::Metadata HSAMetadata;
>> if (HSAMD::fromString(HSAMetadataString, HSAMetadata))
>> @@ -94,6 +91,11 @@ void AMDGPUTargetAsmStreamer::EmitAMDGPU
>> }
>> }
>>
>> +bool AMDGPUTargetAsmStreamer::EmitISAVersion(StringRef IsaVersionString)
>> {
>> + OS << "\t.amd_amdgpu_isa \"" << IsaVersionString << "\"\n";
>> + return true;
>> +}
>> +
>> bool AMDGPUTargetAsmStreamer::EmitHSAMetadata(
>> const AMDGPU::HSAMD::Metadata &HSAMetadata) {
>> std::string HSAMetadataString;
>> @@ -208,6 +210,28 @@ void AMDGPUTargetELFStreamer::EmitAMDGPU
>> Symbol->setType(ELF::STT_AMDGPU_HSA_KERNEL);
>> }
>>
>> +bool AMDGPUTargetELFStreamer::EmitISAVersion(StringRef IsaVersionString)
>> {
>> + // Create two labels to mark the beginning and end of the desc field
>> + // and a MCExpr to calculate the size of the desc field.
>> + auto &Context = getContext();
>> + auto *DescBegin = Context.createTempSymbol();
>> + auto *DescEnd = Context.createTempSymbol();
>> + auto *DescSZ = MCBinaryExpr::createSub(
>> + MCSymbolRefExpr::create(DescEnd, Context),
>> + MCSymbolRefExpr::create(DescBegin, Context), Context);
>> +
>> + EmitAMDGPUNote(
>> + DescSZ,
>> + ELF::NT_AMD_AMDGPU_ISA,
>> + [&](MCELFStreamer &OS) {
>> + OS.EmitLabel(DescBegin);
>> + OS.EmitBytes(IsaVersionString);
>> + OS.EmitLabel(DescEnd);
>> + }
>> + );
>> + return true;
>> +}
>> +
>> bool AMDGPUTargetELFStreamer::EmitHSAMetadata(
>> const AMDGPU::HSAMD::Metadata &HSAMetadata) {
>> std::string HSAMetadataString;
>>
>> Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h?rev=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h
>> (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h Sat
>> Oct 14 08:40:33 2017
>> @@ -12,6 +12,7 @@
>>
>> #include "AMDKernelCodeT.h"
>> #include "llvm/MC/MCStreamer.h"
>> +#include "llvm/MC/MCSubtargetInfo.h"
>> #include "llvm/Support/AMDGPUMetadata.h"
>>
>> namespace llvm {
>> @@ -30,7 +31,8 @@ protected:
>> MCContext &getContext() const { return Streamer.getContext(); }
>>
>> public:
>> - AMDGPUTargetStreamer(MCStreamer &S);
>> + AMDGPUTargetStreamer(MCStreamer &S) : MCTargetStreamer(S) {}
>> +
>> virtual void EmitDirectiveHSACodeObjectVersion(uint32_t Major,
>> uint32_t Minor) = 0;
>>
>> @@ -44,6 +46,9 @@ public:
>> virtual void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type)
>> = 0;
>>
>> /// \returns True on success, false on failure.
>> + virtual bool EmitISAVersion(StringRef IsaVersionString) = 0;
>> +
>> + /// \returns True on success, false on failure.
>> virtual bool EmitHSAMetadata(StringRef HSAMetadataString);
>>
>> /// \returns True on success, false on failure.
>> @@ -69,6 +74,9 @@ public:
>> void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type)
>> override;
>>
>> /// \returns True on success, false on failure.
>> + bool EmitISAVersion(StringRef IsaVersionString) override;
>> +
>> + /// \returns True on success, false on failure.
>> bool EmitHSAMetadata(const AMDGPU::HSAMD::Metadata &HSAMetadata)
>> override;
>>
>> /// \returns True on success, false on failure.
>> @@ -98,6 +106,9 @@ public:
>> void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type)
>> override;
>>
>> /// \returns True on success, false on failure.
>> + bool EmitISAVersion(StringRef IsaVersionString) override;
>> +
>> + /// \returns True on success, false on failure.
>> bool EmitHSAMetadata(const AMDGPU::HSAMD::Metadata &HSAMetadata)
>> override;
>>
>> /// \returns True on success, false on failure.
>>
>> Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp?rev=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp Sat Oct 14
>> 08:40:33 2017
>> @@ -147,6 +147,21 @@ IsaVersion getIsaVersion(const FeatureBi
>> return {7, 0, 0};
>> }
>>
>> +void streamIsaVersion(const MCSubtargetInfo *STI, raw_ostream &Stream) {
>> + auto TargetTriple = STI->getTargetTriple();
>> + auto ISAVersion = IsaInfo::getIsaVersion(STI->getFeatureBits());
>> +
>> + Stream << TargetTriple.getArchName() << '-'
>> + << TargetTriple.getVendorName() << '-'
>> + << TargetTriple.getOSName() << '-'
>> + << TargetTriple.getEnvironmentName() << '-'
>> + << "gfx"
>> + << ISAVersion.Major
>> + << ISAVersion.Minor
>> + << ISAVersion.Stepping;
>> + Stream.flush();
>> +}
>> +
>> unsigned getWavefrontSize(const FeatureBitset &Features) {
>> if (Features.test(FeatureWavefrontSize16))
>> return 16;
>>
>> Modified: llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h?rev=315808&r1=315807&r2=315808&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h Sat Oct 14
>> 08:40:33 2017
>> @@ -19,6 +19,7 @@
>> #include "llvm/Support/Compiler.h"
>> #include "llvm/Support/ErrorHandling.h"
>> #include <cstdint>
>> +#include <string>
>> #include <utility>
>>
>> namespace llvm {
>> @@ -54,6 +55,9 @@ struct IsaVersion {
>> /// \returns Isa version for given subtarget \p Features.
>> IsaVersion getIsaVersion(const FeatureBitset &Features);
>>
>> +/// \brief Streams isa version string for given subtarget \p STI into \p
>> Stream.
>> +void streamIsaVersion(const MCSubtargetInfo *STI, raw_ostream &Stream);
>> +
>> /// \returns Wavefront size for given subtarget \p Features.
>> unsigned getWavefrontSize(const FeatureBitset &Features);
>>
>>
>> Added: llvm/trunk/test/CodeGen/AMDGPU/elf-notes.ll
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/elf-notes.ll?rev=315808&view=auto
>>
>> ==============================================================================
>> --- llvm/trunk/test/CodeGen/AMDGPU/elf-notes.ll (added)
>> +++ llvm/trunk/test/CodeGen/AMDGPU/elf-notes.ll Sat Oct 14 08:40:33 2017
>> @@ -0,0 +1,25 @@
>> +; RUN: llc -mtriple=amdgcn-amd-unknown -mcpu=gfx800 < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-UNK --check-prefix=GFX800 %s
>> +; RUN: llc -mtriple=amdgcn-amd-unknown -mcpu=iceland < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-UNK --check-prefix=GFX800 %s
>> +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx800 < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-HSA --check-prefix=GFX800 %s
>> +; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=iceland < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-HSA --check-prefix=GFX800 %s
>> +; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=gfx800 < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-PAL --check-prefix=GFX800 %s
>> +; RUN: llc -mtriple=amdgcn-amd-amdpal -mcpu=iceland < %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-PAL --check-prefix=GFX800 %s
>> +; RUN: llc -march=r600 < %s | FileCheck --check-prefix=R600 %s
>> +
>> +; OSABI-UNK: .amd_amdgpu_isa "amdgcn-amd-unknown--gfx800"
>> +; OSABI-UNK-NOT: .amd_amdgpu_hsa_metadata
>> +; OSABI-UNK-NOT: .amd_amdgpu_pal_metadata
>> +
>> +; OSABI-HSA: .amd_amdgpu_isa "amdgcn-amd-amdhsa--gfx800"
>> +; OSABI-HSA: .amd_amdgpu_hsa_metadata
>> +
>> +; OSABI-PAL: .amd_amdgpu_isa "amdgcn-amd-amdpal--gfx800"
>> +; OSABI-PAL: .amd_amdgpu_pal_metadata
>> +
>> +; R600-NOT: .amd_amdgpu_isa
>> +; R600-NOT: .amd_amdgpu_hsa_metadata
>> +; R600-NOT: .amd_amdgpu_hsa_metadata
>> +
>> +define amdgpu_kernel void @elf_notes() {
>> + ret void
>> +}
>>
>> Added: llvm/trunk/test/MC/AMDGPU/isa-version-hsa.s
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/isa-version-hsa.s?rev=315808&view=auto
>>
>> ==============================================================================
>> --- llvm/trunk/test/MC/AMDGPU/isa-version-hsa.s (added)
>> +++ llvm/trunk/test/MC/AMDGPU/isa-version-hsa.s Sat Oct 14 08:40:33 2017
>> @@ -0,0 +1,14 @@
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: llvm-mc -triple amdgcn-amd-amdhsa -mcpu=gfx800 %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-HSA --check-prefix=GFX800 %s
>> +// RUN: llvm-mc -triple amdgcn-amd-amdhsa -mcpu=iceland %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-HSA --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdhsa -mcpu=gfx803 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-HSA-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdpal -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-PAL-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdpal -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-PAL-ERR
>> --check-prefix=GFX800 %s
>> +
>> +
>> +// OSABI-HSA: .amd_amdgpu_isa "amdgcn-amd-amdhsa--gfx800"
>> +// OSABI-UNK-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-HSA-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-PAL-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +.amd_amdgpu_isa "amdgcn-amd-amdhsa--gfx800"
>>
>> Added: llvm/trunk/test/MC/AMDGPU/isa-version-pal.s
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/isa-version-pal.s?rev=315808&view=auto
>>
>> ==============================================================================
>> --- llvm/trunk/test/MC/AMDGPU/isa-version-pal.s (added)
>> +++ llvm/trunk/test/MC/AMDGPU/isa-version-pal.s Sat Oct 14 08:40:33 2017
>> @@ -0,0 +1,13 @@
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdhsa -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-HSA-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdhsa -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-HSA-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: llvm-mc -triple amdgcn-amd-amdpal -mcpu=gfx800 %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-PAL --check-prefix=GFX800 %s
>> +// RUN: llvm-mc -triple amdgcn-amd-amdpal -mcpu=iceland %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-PAL --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=gfx803 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +
>> +// OSABI-PAL: .amd_amdgpu_isa "amdgcn-amd-amdpal--gfx800"
>> +// OSABI-UNK-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-HSA-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-PAL-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +.amd_amdgpu_isa "amdgcn-amd-amdpal--gfx800"
>>
>> Added: llvm/trunk/test/MC/AMDGPU/isa-version-unk.s
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AMDGPU/isa-version-unk.s?rev=315808&view=auto
>>
>> ==============================================================================
>> --- llvm/trunk/test/MC/AMDGPU/isa-version-unk.s (added)
>> +++ llvm/trunk/test/MC/AMDGPU/isa-version-unk.s Sat Oct 14 08:40:33 2017
>> @@ -0,0 +1,14 @@
>> +// RUN: llvm-mc -triple amdgcn-amd-unknown -mcpu=gfx800 %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-UNK --check-prefix=GFX800 %s
>> +// RUN: llvm-mc -triple amdgcn-amd-unknown -mcpu=iceland %s | FileCheck
>> --check-prefix=GCN --check-prefix=OSABI-UNK --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-unknown -mcpu=gfx803 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-UNK-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdhsa -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-HSA-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdhsa -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-HSA-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdpal -mcpu=gfx800 %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-PAL-ERR
>> --check-prefix=GFX800 %s
>> +// RUN: not llvm-mc -triple amdgcn-amd-amdpal -mcpu=iceland %s 2>&1 |
>> FileCheck --check-prefix=GCN --check-prefix=OSABI-PAL-ERR
>> --check-prefix=GFX800 %s
>> +
>> +
>> +// OSABI-UNK: .amd_amdgpu_isa "amdgcn-amd-unknown--gfx800"
>> +// OSABI-UNK-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-HSA-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +// OSABI-PAL-ERR: error: .amd_amdgpu_isa directive does not match triple
>> and/or mcpu arguments specified through the command line
>> +.amd_amdgpu_isa "amdgcn-amd-unknown--gfx800"
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
>
> --
> Bruno Cardoso Lopes
> http://www.brunocardoso.cc
--
Bruno Cardoso Lopes
http://www.brunocardoso.cc
More information about the llvm-commits
mailing list