This is an archive of the discontinued LLVM Phabricator instance.

[CVP] Deduce no-wrap on `mul`
ClosedPublic

Authored by lebedev.ri on Oct 18 2019, 3:15 PM.

Details

Summary

ConstantRange::makeGuaranteedNoWrapRegion() knows how to deal with mul
since rL335646, there is exhaustive test coverage.
This is already used by CVP's processOverflowIntrinsic(),
and by SCEV's StrengthenNoWrapFlags()

That being said, currently, this doesn't help much in the end:

statisticoldnewdeltapercentage
correlated-value-propagation.NumMulNSW42752716775.00%
correlated-value-propagation.NumMulNUW41323131932975.00%
correlated-value-propagation.NumMulNW81598159019875.00%
correlated-value-propagation.NumNSW571559862714.74%
correlated-value-propagation.NumNUW919310512131914.35%
correlated-value-propagation.NumNW1490816498159010.67%
instcount.NumAddInst275871275869-20.00%
instcount.NumBrInst708234708232-20.00%
instcount.NumMulInst4381243810-20.00%
instcount.NumPHIInst316786316784-20.00%
instcount.NumTruncInst621656216720.00%
instcount.NumUDivInst25282526-2-0.08%
instcount.TotalBlocks842995842993-20.00%
instcount.TotalInsts73764867376478-80.00%

(^ test-suite plain, tests still pass)

Do we want this for consistency?

Diff Detail