[PATCH] D45448: [CVP] simplify phi with constant incoming values that match common variable edge values

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 10 07:44:47 PDT 2018


spatel updated this revision to Diff 141845.
spatel marked an inline comment as done.
spatel added a comment.

Patch updated:

1. Move the dominance check, so it only happens once. This matches the logic in InstSimplify that handles the simpler case of a phi where all incoming values are identical except for undefs.
2. Added a debug statistic to count how often this fires.

To expand on the previous test-suite experiment, I moved the existing counter above the call to InstSimplify (that's not in this patch though). This tells us how often the phi-select transform fires vs. the common value simplification in InstSimplify. The split of the 6758 cases is: 1830 are here in CVP for the select transform and 4928 is the easy elimination of a phi with all common incoming values in InstSimplify. So we use the more complicated common value analysis of this patch about 2% (94/4928) of the time to eliminate a phi.


https://reviews.llvm.org/D45448

Files:
  lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
  test/Transforms/CorrelatedValuePropagation/phi-common-val.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45448.141845.patch
Type: text/x-patch
Size: 6280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180410/22441116/attachment.bin>


More information about the llvm-commits mailing list