"Global optimizations mostly do not rely on UB in order to get speed-ups, so this is not an A:B test of the value of UB.
"
[Citation needed]
They most certainly do rely on UB to move statements past other statements, to delete dead code, etc.
If you want a source: I've written all or parts of gcc's statement sinking, partial redundancy elimination, dead store elimination, alias analysis, etc.
Same with LLVM.
They all rely on UB being UB to be able to do their work effectively.
You could never, for example, hoist a load if it wasn't UB to dereference a null pointer, unless you could prove it was non-null (and you mostly can't).
You'd have to insert null checks everywhere, like java, and then try to get rid of them.
You could never move anything past (up or down) an external function call if you didn't rely on UB.
I could go on, but it's pretty silly.
Random assertions about "optimizations taking advantage of UB don't gain performance" simply are not in accord with reality.
If it wasn't true, we'd just make programming languages with no UB.
It's not like compiler writers are just lazy.