}
void VPReplicateRecipe::execute(VPTransformState &State) {
+ Instruction *UI = getUnderlyingInstr();
if (State.Instance) { // Generate a single instance.
assert(!State.VF.isScalable() && "Can't scalarize a scalable vector");
- State.ILV->scalarizeInstruction(getUnderlyingInstr(), this, *State.Instance,
+ State.ILV->scalarizeInstruction(UI, this, *State.Instance,
IsPredicated, State);
// Insert scalar instance packing it into a vector.
if (AlsoPack && State.VF.isVector()) {
if (State.Instance->Lane.isFirstLane()) {
assert(!State.VF.isScalable() && "VF is assumed to be non scalable.");
Value *Poison = PoisonValue::get(
- VectorType::get(getUnderlyingValue()->getType(), State.VF));
+ VectorType::get(UI->getType(), State.VF));
State.set(this, Poison, State.Instance->Part);
}
State.ILV->packScalarIntoVectorValue(this, *State.Instance, State);
if (IsUniform) {
// If the recipe is uniform across all parts (instead of just per VF), only
// generate a single instance.
- Instruction *UI = getUnderlyingInstr();
if ((isa<LoadInst>(UI) || isa<StoreInst>(UI)) &&
all_of(operands(), [](VPValue *Op) { return !Op->getDef(); })) {
State.ILV->scalarizeInstruction(UI, this, VPIteration(0, 0), IsPredicated,
const unsigned EndLane = State.VF.getKnownMinValue();
for (unsigned Part = 0; Part < State.UF; ++Part)
for (unsigned Lane = 0; Lane < EndLane; ++Lane)
- State.ILV->scalarizeInstruction(getUnderlyingInstr(), this,
- VPIteration(Part, Lane), IsPredicated,
- State);
+ State.ILV->scalarizeInstruction(UI, this, VPIteration(Part, Lane),
+ IsPredicated, State);
}
void VPWidenMemoryInstructionRecipe::execute(VPTransformState &State) {