From 0daa3df3a543af3b95a5de1fa2af3356a42453a2 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Tue, 29 Nov 2022 17:25:55 +0000 Subject: [PATCH] [AMDGPU] Use GCNSubtarget::hasInstPrefetch instead of generation check. NFC. --- llvm/lib/Target/AMDGPU/GCNSubtarget.h | 2 ++ llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/GCNSubtarget.h b/llvm/lib/Target/AMDGPU/GCNSubtarget.h index b0ce007..731e203 100644 --- a/llvm/lib/Target/AMDGPU/GCNSubtarget.h +++ b/llvm/lib/Target/AMDGPU/GCNSubtarget.h @@ -783,6 +783,8 @@ public: return getGeneration() < SEA_ISLANDS; } + bool hasInstPrefetch() const { return getGeneration() >= GFX10; } + // Scratch is allocated in 256 dword per wave blocks for the entire // wavefront. When viewed from the perspective of an arbitrary workitem, this // is 4-byte aligned. diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 1cba1e4..72942ae 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -12670,8 +12670,7 @@ Align SITargetLowering::getPrefLoopAlignment(MachineLoop *ML) const { const Align CacheLineAlign = Align(64); // Pre-GFX10 target did not benefit from loop alignment - if (!ML || DisableLoopAlignment || - (getSubtarget()->getGeneration() < AMDGPUSubtarget::GFX10) || + if (!ML || DisableLoopAlignment || !getSubtarget()->hasInstPrefetch() || getSubtarget()->hasInstFwdPrefetchBug()) return PrefAlign; -- 2.7.4