Page MenuHomePhabricator

[NFC][CVP] Count all the no-wraps we prooved
ClosedPublic

Authored by lebedev.ri on Oct 9 2019, 3:35 PM.

Details

Summary

I'm not sure if i'm going overboard with this..
It looks like this is the only missing statistic in the CVP pass.
Since we proove NSW and NUW separately i'd think we should count them separately too.

test-suite:

correlated-value-propagation.NumAddNSW4381
correlated-value-propagation.NumAddNUW6532
correlated-value-propagation.NumMulNUW4
correlated-value-propagation.NumNSW5099
correlated-value-propagation.NumNUW8570
correlated-value-propagation.NumNW13669
correlated-value-propagation.NumOverflows4
correlated-value-propagation.NumSubNSW718
correlated-value-propagation.NumSubNUW2034

Diff Detail

Event Timeline

lebedev.ri created this revision.Oct 9 2019, 3:35 PM
lebedev.ri edited reviewers, added: reames; removed: dberlin.Oct 10 2019, 9:53 AM

I'll likely just land this.

spatel accepted this revision.Oct 18 2019, 4:45 AM

LGTM

llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
434

Nit - have the function name specify the action, so something like:

static void setDeducedOverflowingFlags(...)
This revision is now accepted and ready to land.Oct 18 2019, 4:45 AM
lebedev.ri marked 2 inline comments as done.Oct 18 2019, 5:36 AM
lebedev.ri added inline comments.
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
437–440

Oh, this is what was irking me.
We should increment those stats regardless of whether Inst is null or not.

This revision was automatically updated to reflect the committed changes.