Reorder things in this function.
Adding 'const' in key places to provide the compiler the extra hint
for the purpose of this computation we don't change the value and the
value never changes externally even across function calls.
I'm sure the compiler (due to macro implementation of TTMaskXxxxx() calls
and visibility of data being changes) will optimise the function in
exactly the way of the reorder.
This also should have the side-effect of making clearer more auto
vectorization possibilities to the compiler or potentially replacing the
loop with (tail-call or inline) to :
simd_TTMaskSetMask_residues(lmask, rmask, TT_TECHDEPBASE, DBNumUserLayers);
Which would be a hand optimized form, that probably has an 'l_residues'
layout that favours SIMD use (2nd order copy from source of truth just in
a different data layout, such as contiguous array of TileTypeBitMask
indexed from 0, with the TileType as the index).
TileTypeBitMask *DBResidueMask(TileType type);
/* NOTE: candidate for using a const return */
Added __nodiscard__ to function for compiler assitance.
Main problem fixed via another recent comment to remove
excessive DBResidueMask()
After futher review of this function it looks like the existing
fclose() is not in the correct place, and recent patches have
added fclose() to this function in better places (covering all
returns) but did not take into account the existing misplaced
fclose().
LefHelper_DBTechNameType_LefLower() identified and introduced during
conversion to const data usage.
Only side-effect is some log messages will use original verbatim token
now instead of lowercase version (but this seems ok when file parsing,
to quote the problematic information source verbatim)
Some function parameters (char *sname) have been made const due
referencing const data sources.
K&R obsolete syntax removal for C23 compatibility series
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.
the previous version was probably working just fine
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.
no attempt to free memory was made previously
created use of 'alloc' local variable to track when an allocation occurred
so exit path logic is more straight forward for compiler/analyser to see
potential optimisations.
Unclear with all the flip operations if there is some kind of attachment
(exchange of channels), the other 2 channels created in the function
are also cleaned up.