#
862db369 |
| 14-Jun-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Fix class indentation (NFC)
This class uses a mix of different indentation levels, normalize it.
|
#
83e7230e |
| 13-Jun-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Cache lookup of experimental.guard intrinsic (NFC)
When LVI is performing assume intersections, it also checks for llvm.experimental.guard intrinsics. To avoid unnecessary block scans, it firs
[LVI] Cache lookup of experimental.guard intrinsic (NFC)
When LVI is performing assume intersections, it also checks for llvm.experimental.guard intrinsics. To avoid unnecessary block scans, it first checks whether this intrinsic is declared in the module at all. I've noticed that we end up spending quite a lot of time looking up that function again and again...
Avoid this by only looking it up once when LazyValueInfo is constructed. This of course assumes that we don't introduce new guard intrinsics (which is the case for all existing uses of LVI -- and even if it weren't, it would not introduce miscompiles, just potentially lose optimization power.)
Differential Revision: https://reviews.llvm.org/D81796
show more ...
|
Revision tags: llvmorg-9.0.1-rc1 |
|
#
f87b785a |
| 16-Nov-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
Reapply [LVI] Restructure caching to fix non-determinism
This was reverted due to a reported memory usage increase. However, a test case was never provided, and I wasn't able to reproduce it myself.
Reapply [LVI] Restructure caching to fix non-determinism
This was reverted due to a reported memory usage increase. However, a test case was never provided, and I wasn't able to reproduce it myself.
Relative to the original patch, I have moved the block cache structure behind a unique_ptr, to avoid storing a huge structure inside a DenseMap.
---
Variant on D70103 to fix https://bugs.llvm.org/show_bug.cgi?id=43909. The caching is switched to always use a BB to cache entry map, which then contains per-value caches. A separate set contains value handles with a deletion callback. This allows us to properly invalidate overdefined values.
A possible alternative would be to always cache by value first and have per-BB maps/sets in the each cache entry. In that case we could use a ValueMap and would avoid the separate value handle set. I went with the BB indexing at the top level to make it easier to integrate D69914, but possibly that's not the right choice.
Differential Revision: https://reviews.llvm.org/D70376
show more ...
|
#
5fae613a |
| 25-Mar-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Don't require DominatorTree in LVI (NFC)
After D76797 the dominator tree is no longer used in LVI, so we can remove it as a pass dependency, and also get rid of the dominator tree enabling/dis
[LVI] Don't require DominatorTree in LVI (NFC)
After D76797 the dominator tree is no longer used in LVI, so we can remove it as a pass dependency, and also get rid of the dominator tree enabling/disabling logic in JumpThreading.
Apart from cleaning up the code, this also clarifies LVI cache consistency, in that the LVI cache can no longer depend on whether the DT was or wasn't enabled due to pending DT updates at any given time.
Differential Revision: https://reviews.llvm.org/D76985
show more ...
|
#
39beeeff |
| 25-Mar-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Don't use dominator tree in isValidAssumeForContext()
LVI and its consumers currently have quite a bit of complexity related to dominator tree management. However, it doesn't look like it is a
[LVI] Don't use dominator tree in isValidAssumeForContext()
LVI and its consumers currently have quite a bit of complexity related to dominator tree management. However, it doesn't look like it is actually needed...
The only use of the dominator tree is inside isValidAssumeForContext(). However, due to the way LVI queries work, it is not needed: If we query a value for some block, we will first get the edge values from all predecessor blocks, which also includes an intersection with assumptions that apply to the terminator of the predecessor. As such, we will already have processed all assumptions from predecessor blocks (this is actually stronger than what isValidAssumeForContext() does with a DT, because this is capable of combining non-dominating assumptions). The only additional assumptions we need to take into account are those in the block being queried. And we don't need a dominator tree for that.
This patch only removes the use of DT, I will drop the machinery around it in a followup.
Differential Revision: https://reviews.llvm.org/D76797
show more ...
|
#
82ce3347 |
| 25-Apr-2020 |
Florian Hahn <flo@fhahn.com> |
[ValueLattice] Merging unknown with empty CR is unknown.
Currently an unknown/undef value is marked as overdefined when merged with an empty range. An empty range can occur in unreachable/dead code.
[ValueLattice] Merging unknown with empty CR is unknown.
Currently an unknown/undef value is marked as overdefined when merged with an empty range. An empty range can occur in unreachable/dead code. When merging the new unknown state (= no value known yet) with an empty range, there still isn't any information about the value yet and we can stay in unknown.
This gives a few nice improvements on the number of instructions removed by IPSCCP: Same hash: 170 (filtered out) Remaining: 67 Metric: sccp.IPNumInstRemoved
Program base patch diff test-suite...rks/FreeBench/mason/mason.test 3.00 6.00 100.0% test-suite...nchmarks/McCat/18-imp/imp.test 3.00 5.00 66.7% test-suite...C/CFP2000/179.art/179.art.test 2.00 3.00 50.0% test-suite...ijndael/security-rijndael.test 2.00 3.00 50.0% test-suite...ks/Prolangs-C/agrep/agrep.test 40.00 58.00 45.0% test-suite...ce/Applications/Burg/burg.test 26.00 37.00 42.3% test-suite...cCat/03-testtrie/testtrie.test 3.00 4.00 33.3% test-suite...Source/Benchmarks/sim/sim.test 29.00 36.00 24.1% test-suite.../Applications/spiff/spiff.test 9.00 11.00 22.2% test-suite...s/FreeBench/neural/neural.test 5.00 6.00 20.0% test-suite...pplications/treecc/treecc.test 66.00 79.00 19.7% test-suite...langs-C/football/football.test 85.00 101.00 18.8% test-suite...ce/Benchmarks/PAQ8p/paq8p.test 90.00 105.00 16.7% test-suite...oxyApps-C++/miniFE/miniFE.test 37.00 43.00 16.2% test-suite...rks/FreeBench/pifft/pifft.test 26.00 30.00 15.4% test-suite...lications/sqlite3/sqlite3.test 481.00 548.00 13.9% test-suite...marks/7zip/7zip-benchmark.test 4875.00 5522.00 13.3% test-suite.../CINT2000/176.gcc/176.gcc.test 1117.00 1197.00 7.2% test-suite...0.perlbench/400.perlbench.test 1618.00 1732.00 7.0%
Reviewers: efriedma, nikic, davide
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D78667
show more ...
|
#
f52e0507 |
| 09-Apr-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Use Optional instead of out parameter (NFC)
As suggested on D76788, this switches the LVI implementation to return Optional<ValueLatticeElement> from various methods, instead of passing in a V
[LVI] Use Optional instead of out parameter (NFC)
As suggested on D76788, this switches the LVI implementation to return Optional<ValueLatticeElement> from various methods, instead of passing in a ValueLatticeElement reference and returning a boolean.
Differential Revision: https://reviews.llvm.org/D78383
show more ...
|
#
f715eda6 |
| 24-Mar-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Cleanup/unify cache access
This patch combines the "has" and "get" parts of the cache access. getCachedValueInfo() now both sets the BBLV return argument, and returns whether the value was fou
[LVI] Cleanup/unify cache access
This patch combines the "has" and "get" parts of the cache access. getCachedValueInfo() now both sets the BBLV return argument, and returns whether the value was found.
Additionally, the management of the work stack is now integrated into getBlockValue(). If the value is not cached yet, we try to push to the stack (and return false, indicating that we need to solve first), or return overdefined in case of a cycle.
These changes a) avoid a duplicate cache lookup for has & get and b) ensure that the logic is uniform everywhere. For this reason this change is also not quite NFC, because previously overdefined values from the cache, and overdefined values from a cycle received different treatment when it came to assumption intersection.
Differential Revision: https://reviews.llvm.org/D76788
show more ...
|
#
e833e583 |
| 14-Apr-2020 |
Aaron Puchert <aaronpuchert@alice-dsl.net> |
[ValueLattice] Remove unused DataLayout parameter of mergeIn, NFC
Reviewed By: fhahn, echristo
Differential Revision: https://reviews.llvm.org/D78061
|
#
b3754375 |
| 31-Mar-2020 |
Florian Hahn <flo@fhahn.com> |
[ValueLattice] Distinguish between constant ranges with/without undef.
This patch updates ValueLattice to distinguish between ranges that are guaranteed to not include undef and ranges that may incl
[ValueLattice] Distinguish between constant ranges with/without undef.
This patch updates ValueLattice to distinguish between ranges that are guaranteed to not include undef and ranges that may include undef.
A constant range guaranteed to not contain undef can be used to simplify instructions to arbitrary values. A constant range that may contain undef can only be used to simplify to a constant. If the value can be undef, it might take a value outside the range. For example, consider the snipped below
define i32 @f(i32 %a, i1 %c) { br i1 %c, label %true, label %false true: %a.255 = and i32 %a, 255 br label %exit false: br label %exit exit: %p = phi i32 [ %a.255, %true ], [ undef, %false ] %f.1 = icmp eq i32 %p, 300 call void @use(i1 %f.1) %res = and i32 %p, 255 ret i32 %res }
In the exit block, %p would be a constant range [0, 256) including undef as %p could be undef. We can use the range information to replace %f.1 with false because we remove the compare, effectively forcing the use of the constant to be != 300. We cannot replace %res with %p however, because if %a would be undef %cond may be true but the second use might not be < 256.
Currently LazyValueInfo uses the new behavior just when simplifying AND instructions and does not distinguish between constant ranges with and without undef otherwise. I think we should address the remaining issues in LVI incrementally.
Reviewers: efriedma, reames, aqjune, jdoerfert, sstefan1
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D76931
show more ...
|
#
ec184dd5 |
| 24-Mar-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Convert some checks to assertions; NFC
solveBlockValue() should only be called if the value isn't cached yet. Similarly, it does not make sense to "solve" a constant.
|
#
dbf78ae1 |
| 21-Mar-2020 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Use SmallDenseMap for getValueFromCondition(); NFC
For the common case, we will only insert one value into this map.
|
#
4878aa36 |
| 14-Mar-2020 |
Florian Hahn <flo@fhahn.com> |
[ValueLattice] Add new state for undef constants.
This patch adds a new undef lattice state, which is used to represent UndefValue constants or instructions producing undef.
The main difference to
[ValueLattice] Add new state for undef constants.
This patch adds a new undef lattice state, which is used to represent UndefValue constants or instructions producing undef.
The main difference to the unknown state is that merging undef values with constants (or single element constant ranges) produces the constant/constant range, assuming all uses of the merge result will be replaced by the found constant.
Contrary, merging non-single element ranges with undef needs to go to overdefined. Using unknown for UndefValues currently causes mis-compiles in CVP/LVI (PR44949) and will become problematic once we use ValueLatticeElement for SCCP.
Reviewers: efriedma, reames, davide, nikic
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D75120
show more ...
|
#
02a6b0bc |
| 20-Dec-2019 |
Jordan Rupprecht <rupprecht@google.com> |
Temporarily revert "Reapply [LVI] Normalize pointer behavior" and "[LVI] Restructure caching"
This reverts commits 7e18aeba5062cd4324a9efb7bc25c9dbc4a34c2c (D70376) 21fbd5587cdfa11dabb3aeb0ead2d3d5f
Temporarily revert "Reapply [LVI] Normalize pointer behavior" and "[LVI] Restructure caching"
This reverts commits 7e18aeba5062cd4324a9efb7bc25c9dbc4a34c2c (D70376) 21fbd5587cdfa11dabb3aeb0ead2d3d5fd0b490d (D69914) due to increased memory usage.
show more ...
|
#
21fbd558 |
| 04-Dec-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
Reapply [LVI] Normalize pointer behavior
This is a rebase of the change over D70376, which fixes an LVI cache invalidation issue that also affected this patch.
-----
Related to D69686. As noted th
Reapply [LVI] Normalize pointer behavior
This is a rebase of the change over D70376, which fixes an LVI cache invalidation issue that also affected this patch.
-----
Related to D69686. As noted there, LVI currently behaves differently for integer and pointer values: For integers, the block value is always valid inside the basic block, while for pointers it is only valid at the end of the basic block. I believe the integer behavior is the correct one, and CVP relies on it via its getConstantRange() uses.
The reason for the special pointer behavior is that LVI checks whether a pointer is dereferenced in a given basic block and marks it as non-null in that case. Of course, this information is valid only after the dereferencing instruction, or in conservative approximation, at the end of the block.
This patch changes the treatment of dereferencability: Instead of including it inside the block value, we instead treat it as something similar to an assume (it essentially is a non-nullness assume) and incorporate this information in intersectAssumeOrGuardBlockValueConstantRange() if the context instruction is the terminator of the basic block. This happens either when determining an edge-value internally in LVI, or when a terminator was explicitly passed to getValueAt(). The latter case makes this change not fully NFC, because we can now fold terminator icmps based on the dereferencability information in the same block. This is the reason why I changed one JumpThreading test (it would optimize the condition away without the change).
Of course, we do not want to recompute dereferencability on each intersectAssume call, so we need a new cache for this. The dereferencability analysis requires walking the entire basic block and computing underlying objects of all memory operands. This was previously done separately for each queried pointer value. In the new implementation (both because this makes the caching simpler, and because it is faster), I instead only walk the full BB once and cache all the dereferenced pointers. So the traversal is now performed only once per BB, instead of once per queried pointer value.
I think the overall model now makes more sense than before, and there will be no more pitfalls due to differing integer/pointer behavior.
Differential Revision: https://reviews.llvm.org/D69914
show more ...
|
#
7e18aeba |
| 16-Nov-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Restructure caching
Variant on D70103. The caching is switched to always use a BB to cache entry map, which then contains per-value caches. A separate set contains value handles with a deletio
[LVI] Restructure caching
Variant on D70103. The caching is switched to always use a BB to cache entry map, which then contains per-value caches. A separate set contains value handles with a deletion callback. This allows us to properly invalidate overdefined values.
A possible alternative would be to always cache by value first and have per-BB maps/sets in the each cache entry. In that case we could use a ValueMap and would avoid the separate value handle set. I went with the BB indexing at the top level to make it easier to integrate D69914, but possibly that's not the right choice.
Differential Revision: https://reviews.llvm.org/D70376
show more ...
|
#
05da2fe5 |
| 13-Nov-2019 |
Reid Kleckner <rnk@google.com> |
Sink all InitializePasses.h includes
This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of reco
Sink all InitializePasses.h includes
This file lists every pass in LLVM, and is included by Pass.h, which is very popular. Every time we add, remove, or rename a pass in LLVM, it caused lots of recompilation.
I found this fact by looking at this table, which is sorted by the number of times a file was changed over the last 100,000 git commits multiplied by the number of object files that depend on it in the current checkout: recompiles touches affected_files header 342380 95 3604 llvm/include/llvm/ADT/STLExtras.h 314730 234 1345 llvm/include/llvm/InitializePasses.h 307036 118 2602 llvm/include/llvm/ADT/APInt.h 213049 59 3611 llvm/include/llvm/Support/MathExtras.h 170422 47 3626 llvm/include/llvm/Support/Compiler.h 162225 45 3605 llvm/include/llvm/ADT/Optional.h 158319 63 2513 llvm/include/llvm/ADT/Triple.h 140322 39 3598 llvm/include/llvm/ADT/StringRef.h 137647 59 2333 llvm/include/llvm/Support/Error.h 131619 73 1803 llvm/include/llvm/Support/FileSystem.h
Before this change, touching InitializePasses.h would cause 1345 files to recompile. After this change, touching it only causes 550 compiles in an incremental rebuild.
Reviewers: bkramer, asbirlea, bollu, jdoerfert
Differential Revision: https://reviews.llvm.org/D70211
show more ...
|
#
7a3ad48d |
| 12-Nov-2019 |
Eric Christopher <echristo@gmail.com> |
Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python 3.6.
Reverting to figure out if it's a problem in python or the compiler for now.
This reverts commit 885a05f48a5
Temporarily Revert "Reapply [LVI] Normalize pointer behavior" as it's broken python 3.6.
Reverting to figure out if it's a problem in python or the compiler for now.
This reverts commit 885a05f48a5d320946c89590b73a764e5884fe4f.
show more ...
|
#
885a05f4 |
| 08-Nov-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
Reapply [LVI] Normalize pointer behavior
Fix cache invalidation by not guarding the dereferenced pointer cache erasure by SeenBlocks. SeenBlocks is only populated when actually caching a value in th
Reapply [LVI] Normalize pointer behavior
Fix cache invalidation by not guarding the dereferenced pointer cache erasure by SeenBlocks. SeenBlocks is only populated when actually caching a value in the block, which doesn't necessarily have to happen just because dereferenced pointers were calculated.
-----
Related to D69686. As noted there, LVI currently behaves differently for integer and pointer values: For integers, the block value is always valid inside the basic block, while for pointers it is only valid at the end of the basic block. I believe the integer behavior is the correct one, and CVP relies on it via its getConstantRange() uses.
The reason for the special pointer behavior is that LVI checks whether a pointer is dereferenced in a given basic block and marks it as non-null in that case. Of course, this information is valid only after the dereferencing instruction, or in conservative approximation, at the end of the block.
This patch changes the treatment of dereferencability: Instead of including it inside the block value, we instead treat it as something similar to an assume (it essentially is a non-nullness assume) and incorporate this information in intersectAssumeOrGuardBlockValueConstantRange() if the context instruction is the terminator of the basic block. This happens either when determining an edge-value internally in LVI, or when a terminator was explicitly passed to getValueAt(). The latter case makes this change not fully NFC, because we can now fold terminator icmps based on the dereferencability information in the same block. This is the reason why I changed one JumpThreading test (it would optimize the condition away without the change).
Of course, we do not want to recompute dereferencability on each intersectAssume call, so we need a new cache for this. The dereferencability analysis requires walking the entire basic block and computing underlying objects of all memory operands. This was previously done separately for each queried pointer value. In the new implementation (both because this makes the caching simpler, and because it is faster), I instead only walk the full BB once and cache all the dereferenced pointers. So the traversal is now performed only once per BB, instead of once per queried pointer value.
I think the overall model now makes more sense than before, and there will be no more pitfalls due to differing integer/pointer behavior.
Differential Revision: https://reviews.llvm.org/D69914
show more ...
|
#
43ae5f43 |
| 08-Nov-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
Revert "[LVI] Normalize pointer behavior"
This reverts commit 15bc4dc9a8949f9cffd46ec647baf0818d28fb28.
clang-cmake-x86_64-sde-avx512-linux buildbot reported quite a few compile-time regressions in
Revert "[LVI] Normalize pointer behavior"
This reverts commit 15bc4dc9a8949f9cffd46ec647baf0818d28fb28.
clang-cmake-x86_64-sde-avx512-linux buildbot reported quite a few compile-time regressions in test-suite, will investigate.
show more ...
|
#
15bc4dc9 |
| 05-Nov-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Normalize pointer behavior
Related to D69686. As noted there, LVI currently behaves differently for integer and pointer values: For integers, the block value is always valid inside the basic b
[LVI] Normalize pointer behavior
Related to D69686. As noted there, LVI currently behaves differently for integer and pointer values: For integers, the block value is always valid inside the basic block, while for pointers it is only valid at the end of the basic block. I believe the integer behavior is the correct one, and CVP relies on it via its getConstantRange() uses.
The reason for the special pointer behavior is that LVI checks whether a pointer is dereferenced in a given basic block and marks it as non-null in that case. Of course, this information is valid only after the dereferencing instruction, or in conservative approximation, at the end of the block.
This patch changes the treatment of dereferencability: Instead of including it inside the block value, we instead treat it as something similar to an assume (it essentially is a non-nullness assume) and incorporate this information in intersectAssumeOrGuardBlockValueConstantRange() if the context instruction is the terminator of the basic block. This happens either when determining an edge-value internally in LVI, or when a terminator was explicitly passed to getValueAt(). The latter case makes this change not fully NFC, because we can now fold terminator icmps based on the dereferencability information in the same block. This is the reason why I changed one JumpThreading test (it would optimize the condition away without the change).
Of course, we do not want to recompute dereferencability on each intersectAssume call, so we need a new cache for this. The dereferencability analysis requires walking the entire basic block and computing underlying objects of all memory operands. This was previously done separately for each queried pointer value. In the new implementation (both because this makes the caching simpler, and because it is faster), I instead only walk the full BB once and cache all the dereferenced pointers. So the traversal is now performed only once per BB, instead of once per queried pointer value.
I think the overall model now makes more sense than before, and there will be no more pitfalls due to differing integer/pointer behavior.
Differential Revision: https://reviews.llvm.org/D69914
show more ...
|
#
c39ba042 |
| 24-Oct-2019 |
Simon Pilgrim <llvm-dev@redking.me.uk> |
Fix MSVC "switch statement contains 'default' but no 'case' labels" warning. NFCI.
|
#
8eda8f8c |
| 23-Oct-2019 |
Roman Lebedev <lebedev.ri@gmail.com> |
[LVI][NFC] Factor solveBlockValueSaturatingIntrinsic() out of solveBlockValueIntrinsic()
Now that there's SaturatingInst class, this is cleaner.
|
#
1f665046 |
| 23-Oct-2019 |
Roman Lebedev <lebedev.ri@gmail.com> |
[LVI][CVP] LazyValueInfoImpl::solveBlockValueBinaryOp(): use no-wrap flags from `add` op
Summary: This was suggested in https://reviews.llvm.org/D69277#1717210 In this form (this is what was suggest
[LVI][CVP] LazyValueInfoImpl::solveBlockValueBinaryOp(): use no-wrap flags from `add` op
Summary: This was suggested in https://reviews.llvm.org/D69277#1717210 In this form (this is what was suggested, right?), the results aren't staggering (especially since given LVI cross-block focus) this does catch some things (as per test-suite), but not too much:
| statistic | old | new | delta | % change | | correlated-value-propagation.NumAddNSW | 4981 | 4982 | 1 | 0.0201% | | correlated-value-propagation.NumAddNW | 12125 | 12126 | 1 | 0.0082% | | correlated-value-propagation.NumCmps | 1199 | 1202 | 3 | 0.2502% | | correlated-value-propagation.NumDeadCases | 112 | 111 | -1 | -0.8929% | | correlated-value-propagation.NumMulNSW | 275 | 278 | 3 | 1.0909% | | correlated-value-propagation.NumMulNUW | 1323 | 1326 | 3 | 0.2268% | | correlated-value-propagation.NumMulNW | 1598 | 1604 | 6 | 0.3755% | | correlated-value-propagation.NumNSW | 7158 | 7167 | 9 | 0.1257% | | correlated-value-propagation.NumNUW | 13304 | 13310 | 6 | 0.0451% | | correlated-value-propagation.NumNW | 20462 | 20477 | 15 | 0.0733% | | correlated-value-propagation.NumOverflows | 4 | 7 | 3 | 75.0000% | | correlated-value-propagation.NumPhis | 15366 | 15381 | 15 | 0.0976% | | correlated-value-propagation.NumSExt | 6273 | 6277 | 4 | 0.0638% | | correlated-value-propagation.NumShlNSW | 1172 | 1171 | -1 | -0.0853% | | correlated-value-propagation.NumShlNUW | 2793 | 2794 | 1 | 0.0358% | | correlated-value-propagation.NumSubNSW | 730 | 736 | 6 | 0.8219% | | correlated-value-propagation.NumSubNUW | 2044 | 2046 | 2 | 0.0978% | | correlated-value-propagation.NumSubNW | 2774 | 2782 | 8 | 0.2884% | | instcount.NumAddInst | 277586 | 277569 | -17 | -0.0061% | | instcount.NumAndInst | 66056 | 66054 | -2 | -0.0030% | | instcount.NumBrInst | 709147 | 709146 | -1 | -0.0001% | | instcount.NumCallInst | 528579 | 528576 | -3 | -0.0006% | | instcount.NumExtractValueInst | 18307 | 18301 | -6 | -0.0328% | | instcount.NumOrInst | 102660 | 102665 | 5 | 0.0049% | | instcount.NumPHIInst | 318008 | 318007 | -1 | -0.0003% | | instcount.NumSelectInst | 46373 | 46370 | -3 | -0.0065% | | instcount.NumSExtInst | 79496 | 79488 | -8 | -0.0101% | | instcount.NumShlInst | 40654 | 40657 | 3 | 0.0074% | | instcount.NumTruncInst | 62251 | 62249 | -2 | -0.0032% | | instcount.NumZExtInst | 68211 | 68221 | 10 | 0.0147% | | instcount.TotalBlocks | 843910 | 843909 | -1 | -0.0001% | | instcount.TotalInsts | 7387448 | 7387423 | -25 | -0.0003% |
Reviewers: nikic, reames
Reviewed By: nikic
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69321
show more ...
|
Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4 |
|
#
fdc6977f |
| 07-Sep-2019 |
Nikita Popov <nikita.ppv@gmail.com> |
[LVI] Look through extractvalue of insertvalue
This addresses the issue mentioned on D19867. When we simplify with.overflow instructions in CVP, we leave behind extractvalue of insertvalue sequences
[LVI] Look through extractvalue of insertvalue
This addresses the issue mentioned on D19867. When we simplify with.overflow instructions in CVP, we leave behind extractvalue of insertvalue sequences that LVI no longer understands. This means that we can not simplify any instructions based on the with.overflow anymore (until some over pass like InstCombine cleans them up).
This patch extends LVI extractvalue handling by calling SimplifyExtractValueInst (which doesn't do anything more than constant folding + looking through insertvalue) and using the block value of the simplification.
A possible alternative would be to do something similar to SimplifyIndVars, where we instead directly try to replace extractvalue users of the with.overflow. This would need some additional structural changes to CVP, as it's currently not legal to remove anything but the current instruction -- we'd have to introduce a worklist with instructions scheduled for deletion or similar.
Differential Revision: https://reviews.llvm.org/D67035
llvm-svn: 371306
show more ...
|