-
Notifications
You must be signed in to change notification settings - Fork 22
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
-Wmaybe-uninitialized #428
base: dev
Are you sure you want to change the base?
Changes from all 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 |
---|---|---|
|
@@ -785,14 +785,21 @@ RegisterValue vecSumElems_2ops(srcValContainer& sourceValues) { | |
template <typename D, typename N, int I> | ||
RegisterValue vecXtn(srcValContainer& sourceValues, bool isXtn2) { | ||
const D* d; | ||
if (isXtn2) d = sourceValues[0].getAsVector<D>(); | ||
const N* n = sourceValues[isXtn2 ? 1 : 0].getAsVector<N>(); | ||
const N* n; | ||
if (isXtn2) { | ||
d = sourceValues[0].getAsVector<D>(); | ||
n = sourceValues[1].getAsVector<N>(); | ||
} else { | ||
d = {}; | ||
n = sourceValues[0].getAsVector<N>(); | ||
} | ||
|
||
D out[16 / sizeof(D)] = {0}; | ||
int index = 0; | ||
|
||
for (int i = 0; i < I; i++) { | ||
if (isXtn2 & (i < (I / 2))) { | ||
assert(isXtn2 && "isXtn2 is false so d is not initialised"); | ||
out[i] = d[i]; | ||
} else { | ||
out[i] = static_cast<D>(n[index]); | ||
Comment on lines
+788
to
805
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. @FinnWilkinson this is a temporary solution as I didn't want to fiddle too much with the for loop below. If you have a preferred solution then feel free to push a commit implementing that. 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. I think this proposed solution is good. From our offline discussion aboout line 801 on whether it should be |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is slightly inefficient as it initialises localValue to all 0's for every instance which will be overwritten when constructing the instance. We should test if there is any visible performance degradation from this change. Maybe another one for Leo @ABenC377
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative solution is to do something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we use Pool's for RegisterValues this may not cause a huge performance hit. Worth checking though