From ca05edd927dbec316433556e3b13a88cad5a0618 Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Fri, 4 Feb 2022 13:02:19 +0000 Subject: [PATCH] [AMDGPU] SILoadStoreOptimizer: simplify OptimizeListAgain test At this point CI represents the combined access (original CI combined with Paired) so it doesn't make any sense to add in Paired.width again. NFCI. --- llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp index 44bdbe37dec0..37b74d39eb9c 100644 --- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp +++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp @@ -2128,42 +2128,42 @@ SILoadStoreOptimizer::optimizeInstsWithSameBaseAddr( MachineBasicBlock::iterator NewMI = mergeSBufferLoadImmPair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 8; + OptimizeListAgain |= CI.Width < 8; break; } case BUFFER_LOAD: { MachineBasicBlock::iterator NewMI = mergeBufferLoadPair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 4; + OptimizeListAgain |= CI.Width < 4; break; } case BUFFER_STORE: { MachineBasicBlock::iterator NewMI = mergeBufferStorePair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 4; + OptimizeListAgain |= CI.Width < 4; break; } case MIMG: { MachineBasicBlock::iterator NewMI = mergeImagePair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 4; + OptimizeListAgain |= CI.Width < 4; break; } case TBUFFER_LOAD: { MachineBasicBlock::iterator NewMI = mergeTBufferLoadPair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 4; + OptimizeListAgain |= CI.Width < 4; break; } case TBUFFER_STORE: { MachineBasicBlock::iterator NewMI = mergeTBufferStorePair(CI, Paired, InstsToMove); CI.setMI(NewMI, *this); - OptimizeListAgain |= (CI.Width + Paired.Width) < 4; + OptimizeListAgain |= CI.Width < 4; break; } }