This is a much more direct way to solve the issue than just giving extra priority.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336639
91177308-0d34-0410-b5e6-
96231b3b80d8
}
}
+ // Prevent folding a load if this can implemented with an insert_subreg.
+ if (Root->getOpcode() == ISD::INSERT_SUBVECTOR &&
+ Root->getOperand(0).isUndef() && isNullConstant(Root->getOperand(2)))
+ return false;
+
return true;
}
def : Pat<(subVT (extract_subvector (VT RC:$src), (iPTR 0))),
(subVT (EXTRACT_SUBREG RC:$src, subIdx))>;
- let AddedComplexity = 25 in // to give priority over vinsertf128rm
def : Pat<(VT (insert_subvector undef, subRC:$src, (iPTR 0))),
(VT (INSERT_SUBREG (IMPLICIT_DEF), subRC:$src, subIdx))>;
}