Problem
When remove_if_else has to merge two slices that potentially have different lengths, the result if a slice that has the maximum length of both. For example if we merge [v0, v1] with [v2, v3, v4] we get a slice of length 3. For the first two elements we'll merge v0 with v2, then v1 with v3. For the last element we'll merge v4 with a dummy value (zero).
The dummy value will never be accessed because when accessing a slice we always check that the index is in bounds (the actual length is merged and tracked separately).
Given that the dummy value will never be accessed, we could directly use v4 as the last element. Then merging a dummy value with v4 is not needed, leading to less SSA code and maybe optimized performance.
Happy Case
Dummy values for slices are never used.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
Problem
When
remove_if_elsehas to merge two slices that potentially have different lengths, the result if a slice that has the maximum length of both. For example if we merge[v0, v1]with[v2, v3, v4]we get a slice of length 3. For the first two elements we'll mergev0withv2, thenv1withv3. For the last element we'll mergev4with a dummy value (zero).The dummy value will never be accessed because when accessing a slice we always check that the index is in bounds (the actual length is merged and tracked separately).
Given that the dummy value will never be accessed, we could directly use
v4as the last element. Then merging a dummy value withv4is not needed, leading to less SSA code and maybe optimized performance.Happy Case
Dummy values for slices are never used.
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response