[llvm] f34a195 - [AMDGPU] Fix AddedComplexity for s_buffer_load patterns. NFCI.
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 10 09:36:12 PDT 2023
Author: Jay Foad
Date: 2023-04-10T17:26:50+01:00
New Revision: f34a1953ce334b87cfe25cdf72677d31ebe1d50b
URL: https://github.com/llvm/llvm-project/commit/f34a1953ce334b87cfe25cdf72677d31ebe1d50b
DIFF: https://github.com/llvm/llvm-project/commit/f34a1953ce334b87cfe25cdf72677d31ebe1d50b.diff
LOG: [AMDGPU] Fix AddedComplexity for s_buffer_load patterns. NFCI.
We set AddedComplexity = 100 for s_load patterns to prefer them over
global loads, but for s_buffer_load patterns there is no need to do
this and it was quietly overriding the AddedComplexity of each
individual GCNPat that is defined inside SMLoad_Pattern (but in practice
that did not appear to make any difference).
Differential Revision: https://reviews.llvm.org/D145396
Added:
Modified:
llvm/lib/Target/AMDGPU/SMInstructions.td
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/SMInstructions.td b/llvm/lib/Target/AMDGPU/SMInstructions.td
index 0bc608d3a9d1..c8b6cbee099b 100644
--- a/llvm/lib/Target/AMDGPU/SMInstructions.td
+++ b/llvm/lib/Target/AMDGPU/SMInstructions.td
@@ -890,6 +890,8 @@ foreach vt = SReg_512.RegTypes in {
defm : SMRD_Pattern <"S_LOAD_DWORDX16", vt>;
}
+} // End let AddedComplexity = 100
+
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORD", i32>;
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX2", v2i32>;
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX4", v4i32>;
@@ -901,7 +903,6 @@ defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX2", v2f32>;
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX4", v4f32>;
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX8", v8f32>;
defm : SMLoad_Pattern <"S_BUFFER_LOAD_DWORDX16", v16f32>;
-} // End let AddedComplexity = 100
let OtherPredicates = [HasSMemTimeInst] in {
def : GCNPat <
More information about the llvm-commits
mailing list