-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[LV] Fix crash when building partial reductions using types that aren't known scale factors #136680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1030,6 +1030,27 @@ for.body: ; preds = %for.body.preheader, | |
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !loop !1 | ||
} | ||
|
||
|
||
define i40 @chained_partial_reduce_not_known_factor(i32 %a, i32 %b, i32 %N) { | ||
entry: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also have some check lines here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added, I also noticed that, since removing the no-op |
||
br label %for.body | ||
|
||
for.body: | ||
%red = phi i40 [ 0, %entry ], [ %1, %for.body ] | ||
%iv = phi i16 [ 0, %entry ], [ %iv.next, %for.body ] | ||
%resize = sext i32 %a to i40 | ||
%resize4 = sext i32 %b to i40 | ||
%0 = or i40 %resize4, %resize | ||
%1 = or i40 %red, %0 | ||
%iv.next = add i16 %iv, 1 | ||
%cmp = icmp slt i16 %iv, 1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this also reproduce with more iterations? If so, would be good increase iterations to make things more robust in case we ever decide to bail out for low iteration loops early. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does indeed. I've made it use %N as it was otherwise unused. |
||
br i1 %cmp, label %for.body, label %exit | ||
|
||
exit: | ||
%result.lcssa = phi i40 [ %1, %for.body ] | ||
ret i40 %result.lcssa | ||
} | ||
|
||
attributes #0 = { vscale_range(1,16) } | ||
|
||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.