[X86] getIntImmCostInst - silence static analyzer overflow warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 23 Jul 2023 14:45:10 +0000 (15:45 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 23 Jul 2023 14:49:33 +0000 (15:49 +0100)
Use the divideCeil uint64_t return type directly

llvm/lib/Target/X86/X86TargetTransformInfo.cpp

index 7dccb91..201273a 100644 (file)
@@ -5572,7 +5572,7 @@ InstructionCost X86TTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
   }
 
   if (Idx == ImmIdx) {
-    int NumConstants = divideCeil(BitSize, 64);
+    uint64_t NumConstants = divideCeil(BitSize, 64);
     InstructionCost Cost = X86TTIImpl::getIntImmCost(Imm, Ty, CostKind);
     return (Cost <= NumConstants * TTI::TCC_Basic)
                ? static_cast<int>(TTI::TCC_Free)