[LV] Widen freeze instead of scalarizing it
This patch changes the strategy for vectorizing freeze instrucion, from replicating multiple times to widening according to selected VF. Fixes #54992 Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D125016
This commit is contained in:
@@ -8444,6 +8444,7 @@ VPWidenRecipe *VPRecipeBuilder::tryToWiden(Instruction *I,
|
||||
case Instruction::URem:
|
||||
case Instruction::Xor:
|
||||
case Instruction::ZExt:
|
||||
case Instruction::Freeze:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -9367,6 +9368,17 @@ void VPWidenRecipe::execute(VPTransformState &State) {
|
||||
|
||||
break;
|
||||
}
|
||||
case Instruction::Freeze: {
|
||||
State.ILV->setDebugLocFromInst(&I);
|
||||
|
||||
for (unsigned Part = 0; Part < State.UF; ++Part) {
|
||||
Value *Op = State.get(getOperand(0), Part);
|
||||
|
||||
Value *Freeze = Builder.CreateFreeze(Op);
|
||||
State.set(this, Freeze, Part);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Instruction::ICmp:
|
||||
case Instruction::FCmp: {
|
||||
// Widen compares. Generate vector compares.
|
||||
|
||||
Reference in New Issue
Block a user