[llvm] [SVE][InstCombine] Delete redundante sel instructions with ptrue (PR #68463)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 12 05:37:18 PDT 2023


================
@@ -800,6 +800,13 @@ instCombineConvertFromSVBool(InstCombiner &IC, IntrinsicInst &II) {
 
 static std::optional<Instruction *> instCombineSVESel(InstCombiner &IC,
                                                       IntrinsicInst &II) {
+  // svsel(ptrue, x, y) => x
+  auto *OpPredicate = II.getOperand(0);
+  if (match(OpPredicate, m_Intrinsic<Intrinsic::aarch64_sve_ptrue>(
+                             m_ConstantInt<AArch64SVEPredPattern::all>()))) {
----------------
paulwalker-arm wrote:

What about using `isAllActivePredicate` here to catch more cases?

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


More information about the llvm-commits mailing list