[PATCH] D45330: [WIP][IPSCCP] Use PredicateInfo to propagate facts from cmp instructions.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 5 11:42:29 PDT 2018


efriedma added a comment.

This is interesting.

One of the weaknesses of the SCCP algorithm is that it's not path-sensitive; a value is only "constant" if it has the same value on all possible paths.  The use of ssa_copy provides a way around this restriction, to some extent: the result of an ssa_copy can be a constant even if the operand is overdefined.  That said, this is adding substantial complexity to IPSCCP, and I'm not sure how much benefit you'll get in practice; the example `@test2` isn't really compelling.

Building the PredicateInfo up-front is probably fine; I would guess it's not that expensive compared to the other work IPSCCP is doing (but you should measure to quantify that).

> We should be able to extend it to also propagate additional facts about floats

We need to be very cautious about propagating facts about floats... things which are "obviously" true might not actually be true due to fast-math.


https://reviews.llvm.org/D45330





More information about the llvm-commits mailing list