[LLVMdev] C as used/implemented in practice: analysis of responses (original) (raw)

Tim Northover t.p.northover at gmail.com
Wed Jul 1 11:08:38 PDT 2015


1. The performance gain from this on real programs is small. I will suggest that the total performance gain from optimisations that rely on exploiting undefined behaviour - let's call them monkey's paw optimisations for short - is practically never more than a few percent, and often less than one percent.

2. For most programs, having the program work is worth far more than having it run a few percent faster.

Which may or may not be fine until you decide to switch compilers/platforms. Encouraging programmers to use Clang-specific interpretations of these constructs would promote vendor lock-in and be a blow for portability, which I think is worse than UB. At least now we can tell people "you're doing it wrong".

Cheers.

Tim.



More information about the llvm-dev mailing list