[llvm] f5c747b - [SLP][NFC]Fix a warning for ?: with enum/unsigned, NFC.

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 18 10:09:13 PDT 2022


Author: Alexey Bataev
Date: 2022-10-18T10:08:05-07:00
New Revision: f5c747bfbe36b8f53e6fe2d85ffcaecba6d7153c

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

LOG: [SLP][NFC]Fix a warning for ?: with enum/unsigned, NFC.

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 8ca37b9fa1bf5..f35653197ff2f 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6616,7 +6616,7 @@ InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E,
   case Instruction::Xor:
   case Instruction::GetElementPtr: {
     unsigned Opcode = ShuffleOrOp == Instruction::GetElementPtr
-                          ? Instruction::Add
+                          ? static_cast<unsigned>(Instruction::Add)
                           : ShuffleOrOp;
     auto GetScalarCost = [=](unsigned Idx) {
       auto *VI = dyn_cast<Instruction>(VL[Idx]);


        


More information about the llvm-commits mailing list