[llvm] PatternMatch: migrate to CmpPredicate (PR #118534)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 14:36:54 PST 2024


================
@@ -688,14 +688,14 @@ inline api_pred_ty<is_lowbit_mask_or_zero> m_LowBitMaskOrZero(const APInt *&V) {
 }
 
 struct icmp_pred_with_threshold {
-  ICmpInst::Predicate Pred;
+  CmpPredicate Pred;
   const APInt *Thr;
   bool isValue(const APInt &C) { return ICmpInst::compare(C, *Thr, Pred); }
 };
 /// Match an integer or vector with every element comparing 'pred' (eg/ne/...)
 /// to Threshold. For vectors, this includes constants with undefined elements.
 inline cst_pred_ty<icmp_pred_with_threshold>
-m_SpecificInt_ICMP(ICmpInst::Predicate Predicate, const APInt &Threshold) {
+m_SpecificInt_ICMP(CmpPredicate Predicate, const APInt &Threshold) {
----------------
nikic wrote:

Using CmpPredicate here doesn't really make sense. This is specifying a match for something like `C ult 5`, so samesign is not relevant.

https://github.com/llvm/llvm-project/pull/118534


More information about the llvm-commits mailing list