[llvm-branch-commits] [llvm] c86c024 - [X86] Fix static analyzer warnings. NFCI.

Simon Pilgrim via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 7 10:28:32 PST 2020


Author: Simon Pilgrim
Date: 2020-12-07T18:23:55Z
New Revision: c86c024e10841c690c7120376c4555da019a2221

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

LOG: [X86] Fix static analyzer warnings. NFCI.

Replace '|' with '||' in condition, and fix case of SignedMode variable.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86TargetTransformInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index 6a52714fee41..5a342d41fb5e 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -232,16 +232,16 @@ int X86TTIImpl::getArithmeticInstrCost(unsigned Opcode, Type *Ty,
       bool Op2Signed = false;
       unsigned Op2MinSize = BaseT::minRequiredElementSize(Args[1], Op2Signed);
 
-      bool signedMode = Op1Signed | Op2Signed;
+      bool SignedMode = Op1Signed || Op2Signed;
       unsigned OpMinSize = std::max(Op1MinSize, Op2MinSize);
 
       if (OpMinSize <= 7)
         return LT.first * 3; // pmullw/sext
-      if (!signedMode && OpMinSize <= 8)
+      if (!SignedMode && OpMinSize <= 8)
         return LT.first * 3; // pmullw/zext
       if (OpMinSize <= 15)
         return LT.first * 5; // pmullw/pmulhw/pshuf
-      if (!signedMode && OpMinSize <= 16)
+      if (!SignedMode && OpMinSize <= 16)
         return LT.first * 5; // pmullw/pmulhw/pshuf
     }
 


        


More information about the llvm-branch-commits mailing list