[llvm] [VPlan] Remove VPInstruction::Not. NFC (PR #222228)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 00:28:12 PDT 2026


================
@@ -1466,17 +1467,6 @@ InstructionCost VPInstruction::computeCost(ElementCount VF,
     return Ctx.TTI.getIndexedVectorInstrCostFromEnd(Instruction::ExtractElement,
                                                     VecTy, Ctx.CostKind, 0);
   }
-  case VPInstruction::Not: {
-    Type *ValTy = this->getScalarType();
-    // InstCombine will fold `xor` to the conditional branch.
-    if (auto *U = const_cast<VPUser *>(getSingleUser()))
-      if (match(U, m_BranchOnCond(m_VPValue())))
-        return 0;
-    if (!vputils::onlyFirstLaneUsed(this))
-      ValTy = toVectorTy(ValTy, VF);
-    return Ctx.TTI.getArithmeticInstrCost(Instruction::Xor, ValTy,
-                                          Ctx.CostKind);
-  }
----------------
lukel97 wrote:

Should be non-function since no targets in tree use the operand info for xor, apart from RISC-V. But RISC-V detects the constant and treats it as a splat so doesn't change the costing. 

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


More information about the llvm-commits mailing list