From 35c2dbd4814af25a0f49e0e2f970ebac2ff37073 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 18 Dec 2025 11:05:34 +0000 Subject: [PATCH] [AMDGPU] Remove trivially true predicates from GCNSubtarget. NFC. (#172830) --- llvm/lib/Target/AMDGPU/GCNSubtarget.h | 28 ----------------------- llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 20 +++------------- 2 files changed, 3 insertions(+), 45 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h index b1b0d69960ae..1cd434a9948a 100644 --- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h +++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h @@ -454,30 +454,6 @@ public: return getGeneration() == SOUTHERN_ISLANDS; } - bool hasBFE() const { - return true; - } - - bool hasBFI() const { - return true; - } - - bool hasBFM() const { - return hasBFE(); - } - - bool hasBCNT(unsigned Size) const { - return true; - } - - bool hasFFBL() const { - return true; - } - - bool hasFFBH() const { - return true; - } - bool hasMed3_16() const { return getGeneration() >= AMDGPUSubtarget::GFX9; } @@ -492,10 +468,6 @@ public: bool hasFmaMixBF16Insts() const { return HasFmaMixBF16Insts; } - bool hasCARRY() const { - return true; - } - bool hasFMA() const { return FMA; } diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index afdeed658b76..102ca92856ba 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -512,21 +512,8 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM, if (Subtarget->hasMadMacF32Insts()) setOperationAction(ISD::FMAD, MVT::f32, Legal); - if (!Subtarget->hasBFI()) - // fcopysign can be done in a single instruction with BFI. - setOperationAction(ISD::FCOPYSIGN, {MVT::f32, MVT::f64}, Expand); - - if (!Subtarget->hasBCNT(32)) - setOperationAction(ISD::CTPOP, MVT::i32, Expand); - - if (!Subtarget->hasBCNT(64)) - setOperationAction(ISD::CTPOP, MVT::i64, Expand); - - if (Subtarget->hasFFBH()) - setOperationAction({ISD::CTLZ, ISD::CTLZ_ZERO_UNDEF}, MVT::i32, Custom); - - if (Subtarget->hasFFBL()) - setOperationAction({ISD::CTTZ, ISD::CTTZ_ZERO_UNDEF}, MVT::i32, Custom); + setOperationAction({ISD::CTLZ, ISD::CTLZ_ZERO_UNDEF}, MVT::i32, Custom); + setOperationAction({ISD::CTTZ, ISD::CTTZ_ZERO_UNDEF}, MVT::i32, Custom); // We only really have 32-bit BFE instructions (and 16-bit on VI). // @@ -536,8 +523,7 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM, // have some pass reduce 64-bit extracts to 32-bit if possible. Extracts that // span the midpoint are probably relatively rare, so don't worry about them // for now. - if (Subtarget->hasBFE()) - setHasExtractBitsInsn(true); + setHasExtractBitsInsn(true); // Clamp modifier on add/sub if (Subtarget->hasIntClamp())