[PATCH] D79507: [flang] Change DIE("unreachable") cases to use llvm_unreachable

David Truby via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 09:44:41 PDT 2020


DavidTruby added a comment.

In D79507#2055109 <https://reviews.llvm.org/D79507#2055109>, @tskeith wrote:

> My understanding is that the behavior of `llvm_unreachable` is undefined in a Release build. If that's the case, this change makes things objectively worse for no benefit that I can see.


I would strongly contest the statement that making unreachable spaces clearly undefined behaviour to the compiler provides no benefit. It allows significant optimisations to be made that are not possible under the as-if rule if the compiler cannot prove that the code is unreachable. Allowing such optimisations is entirely the point of the existence of the `llvm_unreachable` macro in LLVM.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79507/new/

https://reviews.llvm.org/D79507





More information about the llvm-commits mailing list