[llvm] 35baff8 - [AMDGPU] Correct assert that incorrectly chained multiple == operators. (#70291)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 26 08:02:15 PDT 2023


Author: Craig Topper
Date: 2023-10-26T08:02:10-07:00
New Revision: 35baff8b6ac4630d28db91d6b481d6cd5910931e

URL: https://github.com/llvm/llvm-project/commit/35baff8b6ac4630d28db91d6b481d6cd5910931e
DIFF: https://github.com/llvm/llvm-project/commit/35baff8b6ac4630d28db91d6b481d6cd5910931e.diff

LOG: [AMDGPU] Correct assert that incorrectly chained multiple == operators. (#70291)

I believe this assert was trying to check that 3 variables were equal to
0.

I think it instead got interpreted as ((DSWCount == DSWWithPermCount) ==
DSWWithSharedVMEMCount) == 0 I guess (DSWCount == DSWWithPermCount) was
true because both counts were 0. Then true got compared to
DSWWithSharedVMEMCount, and since DSWWithSharedVMEMCount is 0, that
compare was false. And then that false compared equal to the final 0.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
index c67a21c639fc029..0b2bb98738be2aa 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUIGroupLP.cpp
@@ -1121,8 +1121,8 @@ void MFMASmallGemmSingleWaveOpt::applyIGLPStrategy(
   unsigned MFMACount = 0;
   unsigned DSRCount = 0;
 
-  assert((IsPostRA ||
-          DSWCount == DSWWithPermCount == DSWWithSharedVMEMCount == 0) &&
+  assert((IsPostRA || (DSWCount == 0 && DSWWithPermCount == 0 &&
+                       DSWWithSharedVMEMCount == 0)) &&
          "DSWCounters should be zero in pre-RA scheduling!");
   SmallVector<SUnit *, 6> DSWithPerms;
   for (auto &SU : DAG->SUnits) {


        


More information about the llvm-commits mailing list