[clang] [llvm] [clang-tools-extra] [VPlan] Update VPInst::onlyFirstLaneUsed to check users. (PR #80269)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 3 08:06:26 PST 2024
================
@@ -515,6 +515,24 @@ void VPInstruction::execute(VPTransformState &State) {
State.set(this, GeneratedValue, Part);
}
}
+bool VPInstruction::onlyFirstLaneUsed(const VPValue *Op) const {
+ assert(is_contained(operands(), Op) && "Op must be an operand of the recipe");
+ if (Instruction::isBinaryOp(getOpcode()))
+ return vputils::onlyFirstLaneUsed(this);
+
+ switch (getOpcode()) {
+ default:
+ return false;
+ case Instruction::ICmp:
+ return vputils::onlyFirstLaneUsed(this);
+ case VPInstruction::ActiveLaneMask:
+ case VPInstruction::CalculateTripCountMinusVF:
+ case VPInstruction::CanonicalIVIncrementForPart:
+ case VPInstruction::BranchOnCount:
+ return getOperand(0) == Op;
----------------
fhahn wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/80269
More information about the llvm-commits
mailing list