Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2134,7 +2134,7 @@ void VPScalarIVStepsRecipe::execute(VPTransformState &State) {
Builder.CreateMul(StartIdx0, ConstantInt::get(StartIdx0->getType(),
getUnrollPart(*this)));
}
StartIdx0 = Builder.CreateTrunc(StartIdx0, IntStepTy);
StartIdx0 = Builder.CreateSExtOrTrunc(StartIdx0, IntStepTy);
}

if (!FirstLaneOnly && State.VF.isScalable()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
; RUN: opt -passes=loop-vectorize -disable-output -S < %s
; REQUIRES: asserts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the test to check the output as @lukel97 suggested, we should check we get the expected result. You then can also remove REQUIRES: asserts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


target datalayout = "E-m:a-p:32:32-Fi32-i64:64-n32"
target triple = "powerpc-ibm-aix7.2.0.0"

define void @__power_mod_NMOD_power_init(ptr %a, ptr %b, i32 %n) {
entry:
br label %loop_entry

loop_exit: ; preds = %loop_header
br label %loop_entry

loop_entry: ; preds = %loop_exit, %entry
%sum.0 = phi double [ 0.000000e+00, %entry ], [ %sum.1, %loop_exit ]
%x = load double, ptr %a, align 8
br label %loop_header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the loop nest or can this simply be a single loop?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the test to use a single loop.


loop_header: ; preds = %loop_body, %loop_entry
%sum.1 = phi double [ %sum.0, %loop_entry ], [ %sum.next, %loop_body ]
%i = phi i32 [ 0, %loop_entry ], [ %i.next, %loop_body ]
%cond = icmp sgt i32 %i, %n
br i1 %cond, label %loop_exit, label %loop_body

loop_body: ; preds = %loop_header
store double %sum.1, ptr %b, align 8
%sum.next = fadd reassoc double %sum.1, %x
%i.next = add i32 %i, 1
br label %loop_header
}