[llvm] [VPlan] Explicitly handle scalar pointer inductions. (PR #83068)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 26 07:53:43 PDT 2024
================
@@ -514,17 +547,32 @@ void VPInstruction::execute(VPTransformState &State) {
"Recipe not a FPMathOp but has fast-math flags?");
if (hasFastMathFlags())
State.Builder.setFastMathFlags(getFastMathFlags());
+ State.Builder.SetCurrentDebugLocation(getDebugLoc());
+ bool GeneratesPerFirstLaneOnly =
+ canGenerateScalarForFirstLane() &&
+ (vputils::onlyFirstLaneUsed(this) ||
+ getOpcode() == VPInstruction::ComputeReductionResult);
+ bool GeneratesPerAllLanes = doesGeneratePerAllLanes();
for (unsigned Part = 0; Part < State.UF; ++Part) {
- Value *GeneratedValue = generateInstruction(State, Part);
+ if (GeneratesPerAllLanes) {
+ for (unsigned Lane = 0, NumLanes = State.VF.getKnownMinValue();
+ Lane != NumLanes; ++Lane) {
+ Value *P = generatePerLane(State, VPIteration(Part, Lane));
----------------
fhahn wrote:
Added, thanks!
https://github.com/llvm/llvm-project/pull/83068
More information about the llvm-commits
mailing list