[all-commits] [llvm/llvm-project] cdd339: [InstCombine] PHI-of-insertvalues -> insertvalue-o...
Roman Lebedev via All-commits
all-commits at lists.llvm.org
Tue Aug 25 00:38:36 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: cdd339c568fdd0fa2494745d0f661c4a0647c13c
https://github.com/llvm/llvm-project/commit/cdd339c568fdd0fa2494745d0f661c4a0647c13c
Author: Roman Lebedev <lebedev.ri at gmail.com>
Date: 2020-08-25 (Tue, 25 Aug 2020)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineInternal.h
M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
M llvm/test/Transforms/InstCombine/phi-aware-aggregate-reconstruction.ll
M llvm/test/Transforms/InstCombine/phi-of-insertvalues.ll
Log Message:
-----------
[InstCombine] PHI-of-insertvalues -> insertvalue-of-PHI's
As per statistic, this happens pretty exceedingly rare,
but i have seen it in exactly the situations the
Phi-aware aggregate reconstruction would have handled,
eventually, and allowed invoke -> call fold later on.
So while this might be something that other fold
will have to learn about, i believe we should be
doing this transform in general.
Here, we are okay with adding two PHI's to get both the base aggregate,
and the inserted value. I'm not sure it makes much sense to restrict
it to a single phi (to just the inserted value?), because originally
we'd be receiving the final aggregate already..
llvm test-suite + RawSpeed:
```
| statistic name | baseline | proposed | Δ | % | \|%\| |
|--------------------------------------------|-----------|-----------|-----:|-------:|------:|
| instcombine.NumPHIsOfInsertValues | 0 | 12 | 12 | 0.00% | 0.00% |
| asm-printer.EmittedInsts | 8926643 | 8926595 | -48 | 0.00% | 0.00% |
| instcombine.NumCombined | 3846614 | 3846640 | 26 | 0.00% | 0.00% |
| instcombine.NumConstProp | 24302 | 24293 | -9 | -0.04% | 0.04% |
| instcombine.NumDeadInst | 1620140 | 1620112 | -28 | 0.00% | 0.00% |
| instcount.NumBrInst | 898466 | 898464 | -2 | 0.00% | 0.00% |
| instcount.NumCallInst | 1760819 | 1760875 | 56 | 0.00% | 0.00% |
| instcount.NumExtractValueInst | 45659 | 45649 | -10 | -0.02% | 0.02% |
| instcount.NumInsertValueInst | 4991 | 4981 | -10 | -0.20% | 0.20% |
| instcount.NumIntToPtrInst | 27084 | 27087 | 3 | 0.01% | 0.01% |
| instcount.NumPHIInst | 371435 | 371429 | -6 | 0.00% | 0.00% |
| instcount.NumStoreInst | 906011 | 906019 | 8 | 0.00% | 0.00% |
| instcount.TotalBlocks | 1105520 | 1105518 | -2 | 0.00% | 0.00% |
| instcount.TotalInsts | 9795737 | 9795776 | 39 | 0.00% | 0.00% |
| simplifycfg.NumInvokes | 2784 | 2786 | 2 | 0.07% | 0.07% |
| simplifycfg.NumSimpl | 1001840 | 1001850 | 10 | 0.00% | 0.00% |
| simplifycfg.NumSinkCommonInstrs | 15174 | 15170 | -4 | -0.03% | 0.03% |
```
Reviewed By: spatel
Differential Revision: https://reviews.llvm.org/D86306
More information about the All-commits
mailing list