1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/unittests/CodeGen
Quentin Colombet 02cfbd1931 [GISel][KnownBits] Update a comment regarding the effect of cache on PHIs
Unlike what I claimed in my previous commit. The caching is
actually not NFC on PHIs.

When we put a big enough max depth, we end up simulating loops.
The cache is effectively cutting the simulation short and we
get less information as a result.
E.g.,
```
v0 = G_CONSTANT i8 0xC0
jump
v1 = G_PHI i8 v0, v2
v2 = G_LSHR i8 v1, 1
```

Let say we want the known bits of v1.
- With cache:
Set v1 cache to we know nothing
v1 is v0 & v2
v0 gives us 0xC0
v2 gives us known bits of v1 >> 1
v1 is in the cache
=> v1 is 0, thus v2 is 0x80
Finally v1 is v0 & v2 => 0x80

- Without cache and enough depth to do two iteration of the loop:
v1 is v0 & v2
v0 gives us 0xC0
v2 gives us known bits of v1 >> 1
v1 is v0 & v2
v0 is 0xC0
v2 is v1 >> 1
Reach the max depth for v1...
unwinding
v1 is know nothing
v2 is 0x80
v0 is 0xC0
v1 is 0x80
v2 is 0xC0
v0 is 0xC0
v1 is 0xC0

Thus now v1 is 0xC0 instead of 0x80.

I've added a unittest demonstrating that.

NFC
2020-02-25 15:56:15 -08:00
..
GlobalISel [GISel][KnownBits] Update a comment regarding the effect of cache on PHIs 2020-02-25 15:56:15 -08:00
AArch64SelectionDAGTest.cpp [PGO][PGSO] DAG.shouldOptForSize part. 2019-11-21 14:16:00 -08:00
CMakeLists.txt Reverted r375254 as it has broken some build bots for a long time. 2019-10-20 20:39:33 +00:00
DIEHashTest.cpp
LowLevelTypeTest.cpp LLT: Add changeNumElements 2020-01-29 07:32:07 -08:00
MachineInstrBundleIteratorTest.cpp
MachineInstrTest.cpp Fix initialization-order-fiasco error in "Add a heap alloc site marker field to the ExtraInfo in MachineInstrs" 2019-10-31 10:52:53 -07:00
MachineOperandTest.cpp Revert "Revert "[MIR] Target specific MIR formating and parsing"" 2020-01-08 20:03:29 -08:00
ScalableVectorMVTsTest.cpp [SVE][CodeGen] Scalable vector MVT size queries 2019-11-18 12:30:59 +00:00
TargetOptionsTest.cpp [unittests] Add InitializePasses.h includes 2019-11-13 19:42:58 -08:00
TypeTraitsTest.cpp