https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/212479
No GPU ever sets these bits, and clang's hasFP64()/hasLDEXPF() short-circuit on isAMDGCN() before testing them, so the bits are never observed. Co-authored-by: Claude (Claude-Opus-4.8) >From c0e865ea1630806058ca0073ba67e5a68b920d96 Mon Sep 17 00:00:00 2001 From: Matt Arsenault <[email protected]> Date: Tue, 28 Jul 2026 14:00:37 +0200 Subject: [PATCH] AMDGPU: Remove dead FEATURE_FP64/FEATURE_LDEXP from ArchFeatureKind No GPU ever sets these bits, and clang's hasFP64()/hasLDEXPF() short-circuit on isAMDGCN() before testing them, so the bits are never observed. Co-authored-by: Claude (Claude-Opus-4.8) --- clang/lib/Basic/Targets/AMDGPU.h | 10 ++-------- llvm/include/llvm/TargetParser/AMDGPUTargetParser.h | 4 +--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/clang/lib/Basic/Targets/AMDGPU.h b/clang/lib/Basic/Targets/AMDGPU.h index 89ba561ef302d..060df0b9b1b72 100644 --- a/clang/lib/Basic/Targets/AMDGPU.h +++ b/clang/lib/Basic/Targets/AMDGPU.h @@ -50,10 +50,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { llvm::StringMap<bool> OffloadArchFeatures; std::string TargetID; - bool hasFP64() const { - return getTriple().isAMDGCN() || - !!(GPUFeatures & llvm::AMDGPU::FEATURE_FP64); - } + bool hasFP64() const { return getTriple().isAMDGCN(); } /// Has fast fma f32 bool hasFastFMAF() const { @@ -72,10 +69,7 @@ class LLVM_LIBRARY_VISIBILITY AMDGPUTargetInfo final : public TargetInfo { return !!(GPUFeatures & llvm::AMDGPU::FEATURE_FAST_DENORMAL_F32); } - bool hasLDEXPF() const { - return getTriple().isAMDGCN() || - !!(GPUFeatures & llvm::AMDGPU::FEATURE_LDEXP); - } + bool hasLDEXPF() const { return getTriple().isAMDGCN(); } static bool isR600(const llvm::Triple &TT) { return TT.getArch() == llvm::Triple::r600; diff --git a/llvm/include/llvm/TargetParser/AMDGPUTargetParser.h b/llvm/include/llvm/TargetParser/AMDGPUTargetParser.h index 5b35ff6b88708..5ff7e5b23703f 100644 --- a/llvm/include/llvm/TargetParser/AMDGPUTargetParser.h +++ b/llvm/include/llvm/TargetParser/AMDGPUTargetParser.h @@ -61,10 +61,8 @@ struct IsaVersion { enum ArchFeatureKind : uint32_t { FEATURE_NONE = 0, - // These features only exist for r600, and are implied true for amdgcn. + // This feature only exists for r600, and is implied true for amdgcn. FEATURE_FMA = 1 << 1, - FEATURE_LDEXP = 1 << 2, - FEATURE_FP64 = 1 << 3, // Common features. FEATURE_FAST_FMA_F32 = 1 << 4, _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
