[PATCH] D69277: [CVP] No-wrap deduction for `shl`

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 12:49:13 PDT 2019


lebedev.ri created this revision.
lebedev.ri added reviewers: nikic, reames, sanjoy, timshen.
lebedev.ri added a project: LLVM.
Herald added a subscriber: hiraditya.

This is the last `OverflowingBinaryOperator` for which we don't deduce flags.
D69217 <https://reviews.llvm.org/D69217> taught `ConstantRange::makeGuaranteedNoWrapRegion()` about it.

The effect is better than of the `mul` patch (D69203 <https://reviews.llvm.org/D69203>):

| statistic                              | old    | new    | delta | % change |
| correlated-value-propagation.NumAddNUW | 7145   | 7144   | -1    | -0.0140% |
| correlated-value-propagation.NumAddNW  | 12126  | 12125  | -1    | -0.0082% |
| correlated-value-propagation.NumAnd    | 443    | 446    | 3     | 0.6772%  |
| correlated-value-propagation.NumNSW    | 5986   | 7158   | 1172  | 19.5790% |
| correlated-value-propagation.NumNUW    | 10512  | 13304  | 2792  | 26.5601% |
| correlated-value-propagation.NumNW     | 16498  | 20462  | 3964  | 24.0272% |
| correlated-value-propagation.NumShlNSW | 0      | 1172   | 1172  |          |
| correlated-value-propagation.NumShlNUW | 0      | 2793   | 2793  |          |
| correlated-value-propagation.NumShlNW  | 0      | 3965   | 3965  |          |
| instcount.NumAShrInst                  | 13824  | 13790  | -34   | -0.2459% |
| instcount.NumAddInst                   | 277584 | 277586 | 2     | 0.0007%  |
| instcount.NumAndInst                   | 66061  | 66056  | -5    | -0.0076% |
| instcount.NumBrInst                    | 709153 | 709147 | -6    | -0.0008% |
| instcount.NumICmpInst                  | 483709 | 483708 | -1    | -0.0002% |
| instcount.NumSExtInst                  | 79497  | 79496  | -1    | -0.0013% |
| instcount.NumShlInst                   | 40691  | 40654  | -37   | -0.0909% |
| instcount.NumSubInst                   | 61997  | 61996  | -1    | -0.0016% |
| instcount.NumZExtInst                  | 68208  | 68211  | 3     | 0.0044%  |
| instcount.TotalBlocks                  | 843916 | 843910 | -6    | -0.0007% |
| instcount.TotalInsts                   | 7387528      | 7387448      | -80   | -0.0011% |


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69277

Files:
  llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
  llvm/test/Transforms/CorrelatedValuePropagation/icmp.ll
  llvm/test/Transforms/CorrelatedValuePropagation/shl.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69277.225941.patch
Type: text/x-patch
Size: 6273 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191021/d33e71fb/attachment.bin>


More information about the llvm-commits mailing list