[llvm] [VPlan] Uniformly use VPlanPatternMatch in transforms (NFC) (PR #151488)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 31 03:35:40 PDT 2025


================
@@ -528,13 +528,11 @@ static void removeRedundantCanonicalIVs(VPlan &Plan) {
 
 /// Returns true if \p R is dead and can be removed.
 static bool isDeadRecipe(VPRecipeBase &R) {
-  using namespace llvm::PatternMatch;
   // Do remove conditional assume instructions as their conditions may be
   // flattened.
   auto *RepR = dyn_cast<VPReplicateRecipe>(&R);
-  bool IsConditionalAssume =
-      RepR && RepR->isPredicated() &&
-      match(RepR->getUnderlyingInstr(), m_Intrinsic<Intrinsic::assume>());
+  bool IsConditionalAssume = RepR && RepR->isPredicated() &&
+                             match(RepR, m_Intrinsic<Intrinsic::assume>());
----------------
lukel97 wrote:

I don't think this is NFC? We're no longer matching on the underlying instruction. Does it work if we keep the old `using namespace llvm::PatternMatch` in this function or does the compiler complain?

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


More information about the llvm-commits mailing list