diff options
author | Jay Foad <jay.foad@amd.com> | 2023-06-21 12:04:29 +0100 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2023-06-21 12:05:47 +0100 |
commit | c68c6c56fc53f560a0c1d8f5ed80c724b70c30b5 (patch) | |
tree | 9c559c775af4456c12b24dc0336e68ad1f535bc1 /llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | |
parent | 355dab0b5a9e464765b752e7f0ac53c24992cb4c (diff) | |
download | llvm-c68c6c56fc53f560a0c1d8f5ed80c724b70c30b5.zip llvm-c68c6c56fc53f560a0c1d8f5ed80c724b70c30b5.tar.gz llvm-c68c6c56fc53f560a0c1d8f5ed80c724b70c30b5.tar.bz2 |
[AMDGPU] Minor refactoring in SILoadStoreOptimizer::offsetsCanBeCombined
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp index a0f782c..c252d30 100644 --- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp @@ -959,9 +959,12 @@ bool SILoadStoreOptimizer::offsetsCanBeCombined(CombineInfo &CI, // Handle all non-DS instructions. if ((CI.InstClass != DS_READ) && (CI.InstClass != DS_WRITE)) { - return (EltOffset0 + CI.Width == EltOffset1 || - EltOffset1 + Paired.Width == EltOffset0) && - CI.CPol == Paired.CPol; + if (EltOffset0 + CI.Width != EltOffset1 && + EltOffset1 + Paired.Width != EltOffset0) + return false; + if (CI.CPol != Paired.CPol) + return false; + return true; } // If the offset in elements doesn't fit in 8-bits, we might be able to use |