[llvm] [VectorCombine] Add Cmp and Select for shuffleToIdentity (PR #92794)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 04:34:38 PDT 2024


================
@@ -1742,6 +1742,10 @@ static Value *generateNewInstTree(ArrayRef<InstLane> Item, FixedVectorType *Ty,
   if (auto *BI = dyn_cast<BinaryOperator>(I))
     return Builder.CreateBinOp((Instruction::BinaryOps)BI->getOpcode(), Ops[0],
                                Ops[1]);
+  if (auto CI = dyn_cast<CmpInst>(I))
+    return Builder.CreateCmp(CI->getPredicate(), Ops[0], Ops[1]);
+  if (auto SI = dyn_cast<SelectInst>(I))
----------------
RKSimon wrote:

It'd be nice for the CI code_formatter stage to pick these up

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


More information about the llvm-commits mailing list