[llvm] [VPlan] Use VPInstruction for uniform binops. (PR #141429)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 04:27:25 PDT 2025


================
@@ -1049,15 +1050,17 @@ void VPInstruction::print(raw_ostream &O, const Twine &Indent,
 
 void VPInstructionWithType::execute(VPTransformState &State) {
   State.setDebugLocFrom(getDebugLoc());
-  switch (getOpcode()) {
-  case Instruction::ZExt:
-  case Instruction::Trunc: {
+  if (Instruction::isCast(getOpcode())) {
     Value *Op = State.get(getOperand(0), VPLane(0));
     Value *Cast = State.Builder.CreateCast(Instruction::CastOps(getOpcode()),
                                            Op, ResultTy);
+    if (auto *I = dyn_cast<Instruction>(Cast))
+      applyFlags(*I);
----------------
ayalz wrote:

This is needed now that flagged casts are represented as VPInstructionWithType's?

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


More information about the llvm-commits mailing list