[llvm] 95857a7 - [AMDGPU] SILoadStoreOptimizer: Remove redundant check for volatile

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 02:23:58 PST 2022


Author: Jay Foad
Date: 2022-01-27T10:14:53Z
New Revision: 95857a705886c1e8c3ca518b9b856a0caa4f4987

URL: https://github.com/llvm/llvm-project/commit/95857a705886c1e8c3ca518b9b856a0caa4f4987
DIFF: https://github.com/llvm/llvm-project/commit/95857a705886c1e8c3ca518b9b856a0caa4f4987.diff

LOG: [AMDGPU] SILoadStoreOptimizer: Remove redundant check for volatile

SILoadStoreOptimizer::collectMergeableInsts already ends the current
block if it sees a volatile (or ordered) memory access, so there is no
need to check for them again when scanning the instructions between two
pairing candidates in a block.

Differential Revision: https://reviews.llvm.org/D118266

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
index 48f6c7ef1bcad..d1133c12bc18d 100644
--- a/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
+++ b/llvm/lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
@@ -971,10 +971,6 @@ bool SILoadStoreOptimizer::checkAndPrepareMerge(
       continue;
     }
 
-    // Don't merge volatiles.
-    if (MBBI->hasOrderedMemoryRef())
-      return false;
-
     int Swizzled =
         AMDGPU::getNamedOperandIdx(MBBI->getOpcode(), AMDGPU::OpName::swz);
     if (Swizzled != -1 && MBBI->getOperand(Swizzled).getImm())


        


More information about the llvm-commits mailing list