You're misusing the term "undefined behavior". You can certainly say that these kinds of performance optimizations aren't guaranteed.

[deleted]