Y
Hacker News
new
|
ask
|
show
|
jobs
by
BruiseLee
1859 days ago
The compiler is allowed to act as if this loop executes exactly 16 times. That means it could unroll and vectorize it for example.
1 comments
vyodaiken
1859 days ago
It is completely useless to allow compilers to assume false things about the code they generate.
link
fooker
1859 days ago
It’s not useless. The assumption is not false if the program doesn’t have undefined behavior. The assumption allows the code to be a few times faster. To disallow this assumption would inhibit these optimizations.
link
vyodaiken
1858 days ago
a) the assumption is not false if it is not false! b) the speedup is not shown anywhere
link
fooker
1856 days ago
The speedup is more or less the difference between O1 and O3 optimization levels.
link