News for hackers. Stuff that matters.
Re:Can you trust a compiler to optimize your code? by The_Colonel on Tuesday August 01, 2023 @12:33PM (#36958353)
What does the compiler do with that expectation? If the code can't be vectorized for target architecture, does it emi a warning?
Re:Can you trust a compiler to optimize your code? by andrewaylett on Thursday August 03, 2023 @11:34AM (#36987308)
I'd quite like it to emit an error and fail. If some target architectures won't vectorise the code, I can always add the expectation conditionally.

I'm not so much trying to catch deliberate changes, where a warning might make sense as I'd be (maybe) looking for it, but changes that break autovectorisation as a side effect -- maybe something can't be inlined any more, maybe a new compiler version introduces a new optimisation that causes a cascade of tiny changes. I'd hope that we would catch the difference in performance, but it's easier to notice a compilation failure than a performance drop.