[Abe wrote:]
I believe Sebastian would agree that the new if converter  is safer than the 
old one
>> in terms of correctness at the time of running the code being compiled.
[...]
For now, we have a few performance regressions
[snip]


[Alan wrote:]
TBH my two cents would be that a performance-regressed, but correct, compiler, 
is far better to release,  than a
> performance-"improved" one that generates unsafe code (e.g. with extra faults 
in the straightforward single-threaded case!)...

I strongly agree that -- by default -- correctness trumps performance.  The 
only times it is allowable to reverse that relationship, IMO,
is when the user* of the compiler has explicitly specified flags [e.g. "-ffast-math", 
"-Ofast"] that tell the compiler that the user*
currently cares more about performance than about 
{correctness-according-to-spec and/or safety in all conditions including null 
pointers}.

['*': or Makefiles, build scripts, etc.]

FYI: TTBOMK, the old if converter was not unsafe with default flags or with only "big 
knobs" like "-O3"; I`m unsure what it did
under "-ffast-math" and "-Ofast", if anything of interest.  The main advantage 
of the new if converter over the old one is that
the new one is safe in certain situations wherein the old one is unsafe, e.g. 
the old one may cause the vectorized code to segfault
where the non-if-converted code would have run just fine all the way to program 
completion with the same inputs.  This additional
safety allows the new converter to be used under more conditions, which in turn 
allows it to be enabled by default.  We intend
for all the safe if-conversions to be done by default whenever the vectorizer 
is on.  If there are any unsafe conversions left,
which I`m not sure there are, then we will enable them only when the user* specifies 
something like "-fif-conversion=allow-unsafe".
The "allows it to be enabled by default" property should help the code that GCC generates 
under "-O3" w/o any additional
flags to be faster than it currently is, for the relevant targets, *without 
sacrificing even _one_ _bit_ of correctness*.

Regards,

Abe

Reply via email to