[PATCH] D29092: PR31729: [GVNHoist] Don't hoist unsafe scalars at -Oz

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 23 13:31:23 PST 2017


efriedma added a comment.

> I don't understand why we cannot assert isSafeToSpeculativelyExecute if we are not in minsize. If we are given a call instruction, why do we think it is safe to hoist it?

It's safe to hoist if the instruction is either speculatable, or executed on all paths.  (Consider, for example, "if (x) { f(a/b); } else { g(a/b); }", where b might be zero.)


https://reviews.llvm.org/D29092





More information about the llvm-commits mailing list