veera-sivarajan wrote: > The more idiomatic way to handle this is to have something like if > (match(FalseVal, m_Constant())) { std::swap(TrueVal, FalseVal); Pred = > ICmpInst::getInversePredicate(Pred); } and then you no longer have to deal > with which operand the constant is in.
Thank you for the detailed feedback. This simplifies the pattern match but I still have to conditionally assign `NewTrue` and `NewFalse` because `matchDecomposedSelectPattern()` takes an `ICmpInst` and not a `ICmpInst:Predicate`. https://github.com/llvm/llvm-project/pull/116888 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits