Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ LLVM_ABI StringRef getHostCPUName();
/// which features may appear in this map, except that they are all valid LLVM
/// feature names. The map can be empty, for example if feature detection
/// fails.
LLVM_ABI const StringMap<bool, MallocAllocator> getHostCPUFeatures();
LLVM_ABI StringMap<bool, MallocAllocator> getHostCPUFeatures();

/// This is a function compatible with cl::AddExtraVersionPrinter, which adds
/// info about the current target triple and detected CPU.
Expand Down
12 changes: 6 additions & 6 deletions llvm/lib/TargetParser/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ VendorSignatures getVendorSignature(unsigned *MaxLeaf) {

#if defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64__) || defined(_M_X64)
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
unsigned MaxLevel;
StringMap<bool> Features;
Expand Down Expand Up @@ -2068,7 +2068,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#elif defined(__linux__) && (defined(__arm__) || defined(__aarch64__))
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> Features;
std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
if (!P)
Expand Down Expand Up @@ -2148,7 +2148,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64))
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> Features;

// If we're asking the OS at runtime, believe what the OS says
Expand All @@ -2167,7 +2167,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
}
#elif defined(__linux__) && defined(__loongarch__)
#include <sys/auxv.h>
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
unsigned long hwcap = getauxval(AT_HWCAP);
bool HasFPU = hwcap & (1UL << 3); // HWCAP_LOONGARCH_FPU
uint32_t cpucfg2 = 0x2, cpucfg3 = 0x3;
Expand Down Expand Up @@ -2196,7 +2196,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#elif defined(__linux__) && defined(__riscv)
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
RISCVHwProbe Query[]{{/*RISCV_HWPROBE_KEY_BASE_BEHAVIOR=*/3, 0},
{/*RISCV_HWPROBE_KEY_IMA_EXT_0=*/4, 0},
{/*RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF=*/9, 0}};
Expand Down Expand Up @@ -2279,7 +2279,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#else
const StringMap<bool> sys::getHostCPUFeatures() { return {}; }
StringMap<bool> sys::getHostCPUFeatures() { return {}; }
#endif

#if __APPLE__
Expand Down
Loading