[llvm] [VPlan] Implement interleaving as VPlan-to-VPlan transform. (PR #95842)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 18 13:11:16 PDT 2024
================
@@ -332,6 +332,12 @@ FastMathFlags VPRecipeWithIRFlags::getFastMathFlags() const {
return Res;
}
+unsigned VPInstruction::getUnrollPartOperand() const {
+ assert(getOpcode() == VPInstruction::CanonicalIVIncrementForPart &&
+ getNumOperands() == 2 && "Called for unsupported recipe");
+ return cast<ConstantInt>(getOperand(1)->getLiveInIRValue())->getZExtValue();
----------------
ayalz wrote:
Suggestion is to have
```
VPValue *UnrollPartOperand = getUnrollPartOperand();
```
which returns null if VPInstruction has no such operand (not a CanonicalIVIncrementForPart VPInstruction or number of operand not 2), otherwise returns the 2nd operand, and then have
```suggestion
assert(UnrollPartOperand && "UnrollPartOperand is absent");
return cast<ConstantInt>(UnrollPartOperand->getLiveInIRValue())->getZExtValue();
```
https://github.com/llvm/llvm-project/pull/95842
More information about the llvm-commits
mailing list