[AMDGPU] SILoadStoreOptimizer: simplify OptimizeListAgain test
authorJay Foad <jay.foad@amd.com>
Fri, 4 Feb 2022 13:02:19 +0000 (13:02 +0000)
committerJay Foad <jay.foad@amd.com>
Fri, 4 Feb 2022 13:02:19 +0000 (13:02 +0000)
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

index 44bdbe3..37b74d3 100644 (file)
@@ -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;
     }
     }