[PATCH] D34905: Modify constraints in `llvm::canReplaceOperandWithVariable`

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 12:52:03 PDT 2017


efriedma added a comment.

alloca in particular is a little tricky. It's legal to hoist a constant operand (it doesn't change the semantics), but it's a bad idea: it turns a constant-size stack allocation into a variable-size stack allocation, which is much slower.  Better to avoid messing with it.  (This is similar to the way the current callers of canReplaceOperandWithVariable handle calls: it's technically legal, but not a good idea.)

Other changes look fine.


https://reviews.llvm.org/D34905





More information about the llvm-commits mailing list