[llvm] Fix parentheses for clarity in X86ISelLowering.cpp (PR #121954)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 07:51:49 PST 2025


https://github.com/soumyaGhoshh updated https://github.com/llvm/llvm-project/pull/121954

>From 951c5a597df5be74a123bebe24b8e36432e69cc4 Mon Sep 17 00:00:00 2001
From: soumyaGhoshh <soumya_ghosh.mail at icloud.com>
Date: Tue, 7 Jan 2025 19:23:09 +0530
Subject: [PATCH] Fix parentheses for clarity in X86ISelLowering.cpp

---
 llvm/lib/Target/X86/X86ISelLowering.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 68bdeb1cebeb9c..15408b13e44b6f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -42418,7 +42418,7 @@ static SDValue combineTargetShuffle(SDValue N, const SDLoc &DL,
       // Canonicalize to VPERMV if both sources are the same.
       if (V1 == V2) {
         for (int &M : Mask)
-          M = (M < 0 ? M : M & Mask.size() - 1);
+          M = (M < 0 ? M : M & (Mask.size() - 1));
         SDValue NewMask = getConstVector(Mask, MaskVT, DAG, DL,
                                          /*IsMask=*/true);
         return DAG.getNode(X86ISD::VPERMV, DL, VT, NewMask, N.getOperand(0));



More information about the llvm-commits mailing list