class AMDGPUToolChain

Declaration

class AMDGPUToolChain : public Generic_ELF { /* full declaration omitted */ };

Description

Generic_GCC - A tool chain using the 'gcc' command to perform all subcommands; this relies on gcc translating the majority of command line options.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:49

Inherits from: Generic_ELF

Member Variables

protected const std::map<options::ID, const StringRef> OptionsDefault

Inherited from Generic_GCC:

protected GCCInstallation
protected CudaInstallation
protected RocmInstallation

Inherited from ToolChain:

protected Multilibs
protected SelectedMultilib

Method Overview

Inherited from Generic_ELF:

Inherited from Generic_GCC:

Inherited from ToolChain:

Methods

AMDGPUToolChain(const clang::driver::Driver& D,
                const llvm::Triple& Triple,
                const llvm::opt::ArgList& Args)

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:61

Parameters

const clang::driver::Driver& D
const llvm::Triple& Triple
const llvm::opt::ArgList& Args

unsigned int GetDefaultDwarfVersion() const

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:63

bool HasNativeLLVMSupport() const

Description

Needed for using lto.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:95

bool IsIntegratedAssemblerDefault() const

Description

IsIntegratedAssemblerDefault - Does this tool chain enable -integrated-as by default.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:64

bool IsMathErrnoDefault() const

Description

IsMathErrnoDefault - Does this tool chain use -fmath-errno by default.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:65

bool SupportsProfiling() const

Description

SupportsProfiling - Does this tool chain support -pg.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:74

llvm::opt::DerivedArgList* TranslateArgs(
    const llvm::opt::DerivedArgList& Args,
    llvm::StringRef BoundArch,
    Action::OffloadKind DeviceOffloadKind) const

Description

TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may wish to perform, or 0 if no tool chain specific translations are needed. If \p DeviceOffloadKind is specified the translation specific for that offload kind is performed.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:77

Parameters

const llvm::opt::DerivedArgList& Args
llvm::StringRef BoundArch
- The bound architecture name, or 0.
Action::OffloadKind DeviceOffloadKind
- The device offload kind used for the translation.

void addClangTargetOptions(
    const llvm::opt::ArgList& DriverArgs,
    llvm::opt::ArgStringList& CC1Args,
    Action::OffloadKind DeviceOffloadKind) const

Description

Add options that need to be passed to cc1 for this target.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:80

Parameters

const llvm::opt::ArgList& DriverArgs
llvm::opt::ArgStringList& CC1Args
Action::OffloadKind DeviceOffloadKind

clang::driver::Tool* buildLinker() const

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:53

virtual void checkTargetID(
    const llvm::opt::ArgList& DriverArgs) const

Description

Check and diagnose invalid target ID specified by -mcpu.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:112

Parameters

const llvm::opt::ArgList& DriverArgs

llvm::Error detectSystemGPUs(
    const llvm::opt::ArgList& Args,
    SmallVector<std::string, 1>& GPUArchs) const

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:129

Parameters

const llvm::opt::ArgList& Args
SmallVector<std::string, 1>& GPUArchs

llvm::DenormalMode getDefaultDenormalModeForType(
    const llvm::opt::ArgList& DriverArgs,
    const clang::driver::JobAction& JA,
    const llvm::fltSemantics* FPType =
        nullptr) const

Description

Returns the output denormal handling type in the default floating point environment for the given \p FPType if given. Otherwise, the default assumed mode for any floating point type.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:88

Parameters

const llvm::opt::ArgList& DriverArgs
const clang::driver::JobAction& JA
const llvm::fltSemantics* FPType = nullptr

static bool getDefaultDenormsAreZeroForTarget(
    llvm::AMDGPU::GPUKind GPUKind)

Description

Return whether denormals should be flushed, and treated as 0 by default for the subtarget.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:86

Parameters

llvm::AMDGPU::GPUKind GPUKind

const char* getDefaultLinker() const

Description

Needed for translating LTO options.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:100

llvm::StringRef getGPUArch(
    const llvm::opt::ArgList& DriverArgs) const

Description

Get GPU arch from -mcpu without checking.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:127

Parameters

const llvm::opt::ArgList& DriverArgs

llvm::StringRef getOptionDefault(
    options::ID OptID) const

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:54

Parameters

options::ID OptID

clang::driver::toolchains::AMDGPUToolChain::
    ParsedTargetIDType
    getParsedTargetID(const llvm::opt::ArgList&
                          DriverArgs) const

Description

Get target ID, GPU arch, and target ID features if the target ID is specified and valid.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:124

Parameters

const llvm::opt::ArgList& DriverArgs

llvm::Error getSystemGPUArch(
    const llvm::opt::ArgList& Args,
    std::string& GPUArch) const

Description

Uses amdgpu_arch tool to get arch of the system GPU. Will return error if unable to find one.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:107

Parameters

const llvm::opt::ArgList& Args
std::string& GPUArch

bool isCrossCompiling() const

Description

Returns true if the toolchain is targeting a non-native architecture.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:68

bool isPICDefault() const

Description

Test whether this toolchain defaults to PIC.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:69

bool isPICDefaultForced() const

Description

Tests whether this toolchain forces its default for PIC, PIE or non-PIC. If this returns true, any PIC related flags should be ignored and instead the results of \c isPICDefault() and \c isPIEDefault(const llvm::opt::ArgList &Args ) are used exclusively.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:73

bool isPIEDefault(
    const llvm::opt::ArgList& Args) const

Description

Test whether this toolchain defaults to PIE.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:70

Parameters

const llvm::opt::ArgList& Args

static bool isWave64(
    const llvm::opt::ArgList& DriverArgs,
    llvm::AMDGPU::GPUKind Kind)

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:92

Parameters

const llvm::opt::ArgList& DriverArgs
llvm::AMDGPU::GPUKind Kind

bool shouldSkipArgument(
    const llvm::opt::Arg* Arg) const

Description

Should skip argument.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:103

Parameters

const llvm::opt::Arg* Arg

bool useIntegratedAs() const

Description

Check if the toolchain should use the integrated assembler.

Declared at: clang/lib/Driver/ToolChains/AMDGPU.h:67