[llvm] [GlobalISel][AArch64] Do not remove dst type predicates from pattern children nodes. (PR #221576)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 10:47:03 PDT 2026


================
@@ -1628,8 +1628,16 @@ void InstructionMatcher::optimize() {
 
   if (InsnVarID > 0) {
     assert(!Operands.empty() && "Nested instruction is expected to def a vreg");
-    for (auto &OP : Operands[0]->predicates())
+    for (auto &OP : Operands[0]->predicates()) {
+      // LLTOperandMatcher need to be kept as they may have a more specific type
+      // than the parent instruction type.
+      if (const auto *LLTPred = dyn_cast<LLTOperandMatcher>(&*OP)) {
+        if (!LLTPred->getTy().get().isAnyScalar() &&
+            !LLTPred->getTy().get().isAnyVector())
+          continue;
----------------
arsenm wrote:

are the isAny* checks really necessary? 

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


More information about the llvm-commits mailing list