Skip to content

[NFC][CostModel][X86] Fix "comparison of integers of different signs" #124602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

vitalybuka
Copy link
Collaborator

After #124412.

Created using spr 1.3.4
@vitalybuka vitalybuka requested a review from RKSimon January 27, 2025 18:05
@vitalybuka vitalybuka added the skip-precommit-approval PR for CI feedback, not intended for review label Jan 27, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 27, 2025

@llvm/pr-subscribers-backend-x86

Author: Vitaly Buka (vitalybuka)

Changes

After #124412.


Full diff: https://github.com/llvm/llvm-project/pull/124602.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86TargetTransformInfo.cpp (+5-3)
diff --git a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
index a64d65cb770b0f..82a112d50bc1a5 100644
--- a/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
+++ b/llvm/lib/Target/X86/X86TargetTransformInfo.cpp
@@ -55,6 +55,7 @@
 #include "llvm/CodeGen/TargetLowering.h"
 #include "llvm/IR/InstIterator.h"
 #include "llvm/IR/IntrinsicInst.h"
+#include <cstddef>
 #include <optional>
 
 using namespace llvm;
@@ -1580,9 +1581,10 @@ InstructionCost X86TTIImpl::getShuffleCost(
                ((P.value() % Mask.size()) / NumEltsPerLane) ==
                    (P.index() / NumEltsPerLane);
       });
-      IsSingleElementMask = (Mask.size() - 1) == count_if(Mask, [](int M) {
-                              return M == PoisonMaskElem;
-                            });
+      IsSingleElementMask =
+          (Mask.size() - 1) == static_cast<size_t>(count_if(Mask, [](int M) {
+            return M == PoisonMaskElem;
+          }));
     }
   }
 

@vitalybuka
Copy link
Collaborator Author

already done

@vitalybuka vitalybuka closed this Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants