[llvm] [LV][EVL] Support icmp/fcmp instruction with EVL-vectorization (PR #108533)

via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 16 02:24:21 PDT 2024


================
@@ -1353,6 +1353,34 @@ InstructionCost VPWidenRecipe::computeCost(ElementCount VF,
 void VPWidenEVLRecipe::execute(VPTransformState &State) {
   unsigned Opcode = getOpcode();
   // TODO: Support other opcodes
+  if (Opcode == Instruction::ICmp || Opcode == Instruction::FCmp) {
+    Value *Op1 = State.get(getOperand(0), 0);
+    Value *Op2 = State.get(getOperand(1), 0);
+    auto &Ctx = State.Builder.getContext();
+    Value *Pred = MetadataAsValue::get(
+        Ctx, MDString::get(Ctx, CmpInst::getPredicateName(getPredicate())));
+
+    IRBuilderBase &BuilderIR = State.Builder;
+    VectorBuilder Builder(BuilderIR);
----------------
LiqinWeng wrote:

done

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


More information about the llvm-commits mailing list