[PATCH] D37467: Add a new pass to speculate around PHI nodes with constant (integer) operands when profitable.
Daniel Berlin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 7 21:24:06 PDT 2017
dberlin added a comment.
Other random note:
NewGVN can do this value-wise, not just lexically.
So in some future when NewGVN is the default, you may just want to make this part of one of the things it does after the analysis (probably after elimination too).
The eliminator will already have eliminated all cases where doing the above eliminates redundancies without costing anything (IE the part where you see how it simplifies)
We could also, for zero cost, track the things where it it would have just been code motion (IE one operand constant, one operand not), and where we didn't do it because it required speculation of multiple operands.
Then your cost model does not need to take into how much something simplifies, look for constants, etc. We could just tell you, and you could make a decision whether to do the duplication or not.
https://reviews.llvm.org/D37467
More information about the llvm-commits
mailing list