1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
llvm-mirror/unittests/Support
Cong Hou 3919ffc012 Use fixed-point representation for BranchProbability.
BranchProbability now is represented by its numerator and denominator in uint32_t type. This patch changes this representation into a fixed point that is represented by the numerator in uint32_t type and a constant denominator 1<<31. This is quite similar to the representation of BlockMass in BlockFrequencyInfoImpl.h. There are several pros and cons of this change:

Pros:

1. It uses only a half space of the current one.
2. Some operations are much faster like plus, subtraction, comparison, and scaling by an integer.

Cons:

1. Constructing a probability using arbitrary numerator and denominator needs additional calculations.
2. It is a little less precise than before as we use a fixed denominator. For example, 1 - 1/3 may not be exactly identical to 1 / 3 (this will lead to many BranchProbability unit test failures). This should not matter when we only use it for branch probability. If we use it like a rational value for some precise calculations we may need another construct like ValueRatio.

One important reason for this change is that we propose to store branch probabilities instead of edge weights in MachineBasicBlock. We also want clients to use probability instead of weight when adding successors to a MBB. The current BranchProbability has more space which may be a concern.

Differential revision: http://reviews.llvm.org/D12603

llvm-svn: 248633
2015-09-25 23:09:59 +00:00
..
AlignOfTest.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
AllocatorTest.cpp Fix "the the" in comments. 2015-06-19 01:53:21 +00:00
ArrayRecyclerTest.cpp
BlockFrequencyTest.cpp Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
BranchProbabilityTest.cpp Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
Casting.cpp Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:00:20 +00:00
CMakeLists.txt Add a TrailingObjects template class. 2015-08-05 22:57:34 +00:00
CommandLineTest.cpp There is only one saver of strings. 2015-08-13 01:07:02 +00:00
CompressionTest.cpp
ConvertUTFTest.cpp
DataExtractorTest.cpp
DwarfTest.cpp Support: Add dwarf::getOperationEncoding() 2015-02-13 01:05:00 +00:00
EndianStreamTest.cpp
EndianTest.cpp
ErrorOrTest.cpp Don't use std::errc. 2015-06-13 17:23:04 +00:00
FileOutputBufferTest.cpp Return ErrorOr from FileOutputBuffer::create. NFC. 2015-08-13 00:31:39 +00:00
formatted_raw_ostream_test.cpp
IteratorTest.cpp
LEB128Test.cpp
LineIteratorTest.cpp
LockFileManagerTest.cpp
Makefile Unbreak build: Makefile must have the same change as CMakeLists.txt 2015-05-08 16:39:59 +00:00
ManagedStatic.cpp
MathExtrasTest.cpp Try to fix the MSVC build. 2015-02-12 19:53:49 +00:00
MD5Test.cpp
MemoryBufferTest.cpp Use 'override/final' instead of 'virtual' for overridden methods 2015-04-11 02:11:45 +00:00
MemoryTest.cpp
Path.cpp [ADT] Switch a bunch of places in LLVM that were doing single-character 2015-09-10 06:12:31 +00:00
ProcessTest.cpp
ProgramTest.cpp
raw_ostream_test.cpp
raw_pwrite_stream_test.cpp Disable failing TestDevNull test on Windows 2015-04-29 16:54:11 +00:00
RegexTest.cpp
ScaledNumberTest.cpp Fix infinite recursion in ScaledNumber::toInt. 2015-05-01 17:59:15 +00:00
SourceMgrTest.cpp
SpecialCaseListTest.cpp
StreamingMemoryObject.cpp Use std::unique_ptr to manage the DataStreamer in bitcode parsing. 2015-06-16 23:29:49 +00:00
StringPool.cpp
SwapByteOrderTest.cpp Unit tests for the getSwappedBytes(double) fix from r237673. 2015-05-20 14:57:43 +00:00
TargetRegistry.cpp Readdress r236990, use of static members on a non-static variable. 2015-05-11 22:20:48 +00:00
ThreadLocalTest.cpp
TimeValueTest.cpp
TrailingObjectsTest.cpp Fix Visual C++ error C2248: 2015-08-06 07:59:26 +00:00
UnicodeTest.cpp
YAMLIOTest.cpp Revert r239972 (YAML: Assign a value returned by the default constructor to the value in an optional mapping). 2015-06-17 23:48:06 +00:00
YAMLParserTest.cpp YAML: Null terminate block scalar's value. 2015-05-21 19:45:02 +00:00