[llvm] [AMDGPU][NFC] Use generated hasMinMaxI64Insts subtarget feature query (PR #201052)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 01:06:44 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-backend-amdgpu
Author: Mariusz Sikora (mariusz-sikora-at-amd)
<details>
<summary>Changes</summary>
Replace the custom GCNSubtarget::hasIntMinMax64 helper with the generated hasMinMaxI64Insts from AMDGPUSubtargetFeature.
---
Full diff: https://github.com/llvm/llvm-project/pull/201052.diff
4 Files Affected:
- (modified) llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp (+1-1)
- (modified) llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp (+1-1)
- (modified) llvm/lib/Target/AMDGPU/GCNSubtarget.h (-3)
- (modified) llvm/lib/Target/AMDGPU/SIISelLowering.cpp (+1-1)
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
index 8b5076cdd7712..678b444dac077 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
@@ -1431,7 +1431,7 @@ AMDGPULegalizerInfo::AMDGPULegalizerInfo(const GCNSubtarget &ST_,
.widenScalarToNextPow2(0)
.scalarize(0)
.lower();
- if (ST.hasIntMinMax64()) {
+ if (ST.hasMinMaxI64Insts()) {
getActionDefinitionsBuilder({G_SMIN, G_SMAX, G_UMIN, G_UMAX})
.legalFor({S32, S16, S64, V2S16})
.clampMaxNumElements(0, S16, 2)
diff --git a/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp b/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
index a24df782cf28a..cba6e406dedd2 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURegisterBankInfo.cpp
@@ -4060,7 +4060,7 @@ AMDGPURegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
if (isSALUMapping(MI)) {
// There are no scalar 64-bit min and max, use vector instruction instead.
if (MRI.getType(MI.getOperand(0).getReg()).getSizeInBits() == 64 &&
- Subtarget.hasIntMinMax64())
+ Subtarget.hasMinMaxI64Insts())
return getDefaultMappingVOP(MI);
return getDefaultMappingSOP(MI);
}
diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
index dd89db3419c47..b817a79f4c226 100644
--- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h
+++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h
@@ -729,9 +729,6 @@ class GCNSubtarget final : public AMDGPUGenSubtargetInfo,
bool hasVOPD3() const { return HasGFX1250Insts; }
- // \returns true if the target has V_{MIN|MAX}_{I|U}64 instructions.
- bool hasIntMinMax64() const { return HasGFX1250Insts; }
-
// \returns true if the target has V_PK_{MIN|MAX}3_{I|U}16 instructions.
bool hasPkMinMax3Insts() const { return HasGFX1250Insts; }
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index 86f2479490c29..50bde737912af 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -963,7 +963,7 @@ SITargetLowering::SITargetLowering(const TargetMachine &TM,
Custom);
}
- if (Subtarget->hasIntMinMax64())
+ if (Subtarget->hasMinMaxI64Insts())
setOperationAction({ISD::SMIN, ISD::UMIN, ISD::SMAX, ISD::UMAX}, MVT::i64,
Legal);
``````````
</details>
https://github.com/llvm/llvm-project/pull/201052
More information about the llvm-commits
mailing list