[llvm] [AMDGPU] Fix gcc -Wparentheses warning. NFC (PR #70239)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 25 11:27:38 PDT 2023


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/70239

None

>From 0bc1e8bc1564330d4ae14ec5bbcc563f3f74ad05 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Wed, 25 Oct 2023 11:26:05 -0700
Subject: [PATCH] [AMDGPU] Silence -Wparentheses warning. NFC

---
 llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index ff5d0e27277267b..7d457edad0d5cdf 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -12786,10 +12786,10 @@ static unsigned addPermMasks(unsigned First, unsigned Second) {
   unsigned FirstNoCs = First & ~0x0c0c0c0c;
   unsigned SecondNoCs = Second & ~0x0c0c0c0c;
 
-  assert(FirstCs & 0xFF | SecondCs & 0xFF);
-  assert(FirstCs & 0xFF00 | SecondCs & 0xFF00);
-  assert(FirstCs & 0xFF0000 | SecondCs & 0xFF0000);
-  assert(FirstCs & 0xFF000000 | SecondCs & 0xFF000000);
+  assert((FirstCs & 0xFF) | (SecondCs & 0xFF));
+  assert((FirstCs & 0xFF00) | (SecondCs & 0xFF00));
+  assert((FirstCs & 0xFF0000) | (SecondCs & 0xFF0000));
+  assert((FirstCs & 0xFF000000) | (SecondCs & 0xFF000000));
 
   return (FirstNoCs | SecondNoCs) | (FirstCs & SecondCs);
 }



More information about the llvm-commits mailing list