1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

15468 Commits

Author SHA1 Message Date
Andrew Trick
8474910b42 Cleanup in preparation for misched: Move DAG visualization logic.
Soon, ScheduleDAG will not refer to the BB.

llvm-svn: 152177
2012-03-07 00:18:22 +00:00
Andrew Trick
d35b75a36c Added MachineBasicBlock::getFullName() to standardize/factor codegen diagnostics.
llvm-svn: 152176
2012-03-07 00:18:18 +00:00
Andrew Trick
1fb15f4f48 Cleanup: DAG building is specific to either SD or MI scheduling. Not part of the target interface.
llvm-svn: 152174
2012-03-07 00:18:12 +00:00
Andrew Trick
80ff2f2d36 misched comments
llvm-svn: 152173
2012-03-07 00:18:08 +00:00
Benjamin Kramer
0637e87d74 SmallPtrSet: Provide a more efficient implementation of swap than the default triple-copy std::swap.
This currently assumes that both sets have the same SmallSize to keep the implementation simple,
a limitation that can be lifted if someone cares.

llvm-svn: 152143
2012-03-06 20:40:02 +00:00
Ted Kremenek
b98ec7f4ed Add new load commands for MachO.
llvm-svn: 152135
2012-03-06 19:54:44 +00:00
Benjamin Kramer
2303c94eb1 Remove excess const, a const_iterator shouldn't be const itself.
Fixes 1242 warnings from gcc during clang build.

llvm-svn: 152120
2012-03-06 13:32:36 +00:00
Argyrios Kyrtzidis
c919e757e2 [TinyPtrVector] Add erase method and const-goodness.
llvm-svn: 152107
2012-03-06 07:14:58 +00:00
Argyrios Kyrtzidis
267b14e42c PointerUnion::getAddrOf() does not need to be template since we can only
use the first pointer type for it. Rename it to getAddrOfPtr1().

llvm-svn: 152106
2012-03-06 07:14:54 +00:00
Craig Topper
723f98cc58 Increase number of allowed registers in register classes to 64k instead of 256. Widen register class ID to 16-bits. Widen register size and alignment to be up to 64k bytes instead of 256 bytes. This partially reverts r152019 to be less restrictive.
llvm-svn: 152100
2012-03-06 03:44:22 +00:00
Craig Topper
ab4842ceda Revert r152016 and allow overlap, sub, super register tables to be more than 64k entries.
llvm-svn: 152099
2012-03-06 03:28:45 +00:00
Argyrios Kyrtzidis
e07aa2dee3 Remove UsuallyTinyPtrVector.
It is just a worse version of TinyPtrVector.

llvm-svn: 152097
2012-03-06 03:02:16 +00:00
Argyrios Kyrtzidis
c9658a580e Add include/llvm/ADT/UsuallyTinyPtrVector.h which is a vector that
optimizes the case where there is only one element.

llvm-svn: 152090
2012-03-06 02:08:48 +00:00
Jim Grosbach
fdfaed95ae ARM refactor away a bunch of VLD/VST pseudo instructions.
With the new composite physical registers to represent arbitrary pairs
of DPR registers, we don't need the pseudo-registers anymore. Get rid of
a bunch of them that use DPR register pairs and just use the real
instructions directly instead.

llvm-svn: 152045
2012-03-05 19:33:30 +00:00
Jim Grosbach
a64613af7a MCRegisterInfo-ize getMatchingSuperReg.
llvm-svn: 152044
2012-03-05 19:33:24 +00:00
Jim Grosbach
2eea383b12 Make MCRegisterInfo available to the the MCInstPrinter.
Used to allow context sensitive printing of super-register or sub-register
references.

llvm-svn: 152043
2012-03-05 19:33:20 +00:00
Nadav Rotem
19596d8755 Remove an unused function.
llvm-svn: 152028
2012-03-05 12:49:45 +00:00
Chandler Carruth
fd1948653d Switch to a C-style cast here to silence a brain-dead MSVC warning. It
complains about the truncation of a 64-bit constant to a 32-bit value
when size_t is 32-bits wide, but *only with static_cast*!!! The exact
signal that should *silence* such a warning, and in fact does silence it
with both GCC and Clang.

Anyways, this was causing grief for all the MSVC builds, so pointless
change made. Thanks to Nikola on IRC for confirming that this works.

llvm-svn: 152021
2012-03-05 09:56:12 +00:00
Craig Topper
3362e91b1d Shrink and reorder fields in MCRegisterClass to reduce size of static data.
llvm-svn: 152019
2012-03-05 08:33:33 +00:00
Craig Topper
a95d527c6a Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce static data size.
llvm-svn: 152016
2012-03-05 05:37:41 +00:00
Jakob Stoklund Olesen
fd29132e44 Use <def,undef> operands when spilling NEON bundles.
MachineOperands that define part of a virtual register must have an
<undef> flag if they are not intended as read-modify-write operands.

The old trick of adding an <imp-def> operand doesn't work any longer.

Fixes PR12177.

llvm-svn: 152008
2012-03-04 18:40:30 +00:00
Chandler Carruth
a93fbd8fff Replace the hashing functions on APInt and APFloat with overloads of the
new hash_value infrastructure, and replace their implementations using
hash_combine. This removes a complete copy of Jenkin's lookup3 hash
function (which is both significantly slower and lower quality than the
one implemented in hash_combine) along with a somewhat scary xor-only
hash function.

Now that APInt and APFloat can be passed directly to hash_combine,
simplify the rest of the LLVMContextImpl hashing to use the new
infrastructure.

llvm-svn: 152004
2012-03-04 12:02:57 +00:00
Chandler Carruth
b4a6f80d2e Add generic support for hashing StringRef objects using the new hashing library.
llvm-svn: 152003
2012-03-04 10:55:27 +00:00
Craig Topper
8cc9d75c6a Use uint16_t to store register overlaps to reduce static data.
llvm-svn: 152001
2012-03-04 10:43:23 +00:00
Chandler Carruth
9b15a1b01a Teach the hashing facilities how to hash std::string objects.
llvm-svn: 152000
2012-03-04 10:23:15 +00:00
Craig Topper
4ca8c48cc1 Use uint16_t instead of unsigned to store registers in reg classes. Reduces static data size.
llvm-svn: 151998
2012-03-04 10:16:38 +00:00
Craig Topper
585b4225c3 Use uint16_t to store registers in callee saved register tables to reduce size of static data.
llvm-svn: 151996
2012-03-04 03:33:22 +00:00
Benjamin Kramer
0226d184ca Enable the small vector POD optimization for BitCodeAbbrevOp.
While at it bump the small vector size a bit, it's inside a heap-allocated class.

llvm-svn: 151980
2012-03-03 15:04:13 +00:00
Daniel Dunbar
5ffbedef13 hash_state: Don't use initialization target during initialization.
llvm-svn: 151959
2012-03-03 00:35:48 +00:00
Benjamin Kramer
dc1ee2e852 Fix indentation.
llvm-svn: 151932
2012-03-02 19:19:34 +00:00
Jim Grosbach
ff3c53b2d6 Tidy up. Trailing whitespace.
llvm-svn: 151926
2012-03-02 17:46:15 +00:00
Benjamin Kramer
730f1fb5b3 Hashing: microoptimize a truncate on 64 bit away. This currently blocks dead code eliminating the conditional.
The optimizer should handle this eventually, but currently LVI isn't really designed for this kind of stuff.

llvm-svn: 151918
2012-03-02 15:34:35 +00:00
Jia Liu
cdce896007 delete dead code, patch by Michael Spencer.
llvm-svn: 151909
2012-03-02 13:41:31 +00:00
Chandler Carruth
53ca2f8c9e Make the hashing algorithm Endian neutral. This is a bit annoying, but
folks who know something about PPC tell me that the byte swap is crazy
fast and without this the bit mixture would actually be different. It
might not be worse, but I've not measured it and so I'd rather not trust
it. This way, the algorithm is identical on both endianness hosts. I'll
look into any performance issues etc stemming from this.

llvm-svn: 151892
2012-03-02 11:16:10 +00:00
Chandler Carruth
37925e436c Simplify the pair optimization. Rather than using complex type traits,
just ensure that the number of bytes in the pair is the sum of the bytes
in each side of the pair. As long as thats true, there are no extra
bytes that might be padding.

Also add a few tests that previously would have slipped through the
checking. The more accurate checking mechanism catches these and ensures
they are handled conservatively correctly.

Thanks to Duncan for prodding me to do this right and more simply.

llvm-svn: 151891
2012-03-02 10:56:40 +00:00
Chandler Carruth
a2eeeeaa5a Add a header that was technically missing to see if this gets the
offsetof buildbot errors to go away...

llvm-svn: 151884
2012-03-02 09:46:02 +00:00
Chandler Carruth
8ef1184049 We really want to hash pairs of directly-hashable data as directly
hashable data. This matters when we have pair<T*, U*> as a key, which is
quite common in DenseMap, etc. To that end, we need to detect when this
is safe. The requirements on a generic std::pair<T, U> are:

1) Both T and U must satisfy the existing is_hashable_data trait. Note
   that this includes the requirement that T and U have no internal
   padding bits or other bits not contributing directly to equality.
2) The alignment constraints of std::pair<T, U> do not require padding
   between consecutive objects.
3) The alignment constraints of U and the size of T do not conspire to
   require padding between the first and second elements.

Grow two somewhat magical traits to detect this by forming a pod
structure and inspecting offset artifacts on it. Hopefully this won't
cause any compilers to panic.

Added and adjusted tests now that pairs, even nested pairs, are treated
as just sequences of data.

Thanks to Jeffrey Yasskin for helping me sort through this and reviewing
the somewhat subtle traits.

llvm-svn: 151883
2012-03-02 09:26:36 +00:00
Chandler Carruth
09d76cf26d Add support for hashing pairs by delegating to each sub-object. There is
an open question of whether we can do better than this by treating pairs
as boring data containers and directly hashing the two subobjects. This
at least makes the API reasonable.

In order to make this change, I reorganized the header a bit. I lifted
the declarations of the hash_value functions up to the top of the header
with their doxygen comments as these are intended for users to interact
with. They shouldn't have to wade through implementation details. I then
defined them at the very end so that they could be defined in terms of
hash_combine or any other hashing infrastructure.

Added various pair-hashing unittests.

llvm-svn: 151882
2012-03-02 08:32:29 +00:00
Eric Christopher
bb8f3701cd Grammar-o in function name.
llvm-svn: 151875
2012-03-02 02:11:47 +00:00
Chandler Carruth
e07f473768 Remove the misguided extension here that reserved two special values in
the hash_code. I'm not sure what I was thinking here, the use cases for
special values are in the *keys*, not in the hashes of those keys.

We can always resurrect this if needed, or clients can accomplish the
same goal themselves. This makes the general case somewhat faster (~5
cycles faster on my machine) and smaller with less branching.

llvm-svn: 151865
2012-03-02 00:48:38 +00:00
David Meyer
7f21ecb667 [Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.

llvm-svn: 151845
2012-03-01 22:19:54 +00:00
Chandler Carruth
5bca3bef43 Fix two warnings in this code that I missed.
llvm-svn: 151839
2012-03-01 21:45:51 +00:00
Argyrios Kyrtzidis
791437e5f8 Move include/llvm/ADT/SaveAndRestore.h -> include/llvm/Support/SaveAndRestore.h
llvm-svn: 151828
2012-03-01 19:45:47 +00:00
Chandler Carruth
cc9b4516cb Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.

Some of the highlights of this change:
 -- Significantly higher quality hashing algorithm with very well
    distributed results, and extremely few collisions. Should be close to
    a checksum for up to 64-bit keys. Very little clustering or clumping of
    hash codes, to better distribute load on probed hash tables.
 -- Built-in support for reserved values.
 -- Simplified API that composes cleanly with other C++ idioms and APIs.
 -- Better scaling performance as keys grow. This is the fastest
    algorithm I've found and measured for moderately sized keys (such as
    show up in some of the uniquing and folding use cases)
 -- Support for enabling per-execution seeds to prevent table ordering
    or other artifacts of hashing algorithms to impact the output of
    LLVM. The seeding would make each run different and highlight these
    problems during bootstrap.

This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.

I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.

My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.

Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.

Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.

llvm-svn: 151822
2012-03-01 18:55:25 +00:00
Benjamin Kramer
111608aae1 Move getSubRegIndex out of generated code into MCRegisterInfo, devirtualize it.
llvm-svn: 151821
2012-03-01 18:16:35 +00:00
Jim Grosbach
9b3f9f1d37 Move TargetRegisterInfo::getSubReg() to MCRegisterInfo.
Allows us to de-virtualize the function and provides access to it in
the instruction printer, which is useful for handling composite
physical registers (e.g., ARM register lists).

llvm-svn: 151815
2012-03-01 17:30:39 +00:00
Benjamin Kramer
44c3c88cb7 Make TargetRegisterClasses non-virtual by making the only virtual function a function pointer.
This allows us to make TRC non-polymorphic and value-initializable, eliminating a huge static
initializer and a ton of cruft from the generated code.

Shrinks ARMBaseRegisterInfo.o by ~100k.

llvm-svn: 151806
2012-03-01 13:37:55 +00:00
Jakob Stoklund Olesen
2055fc1331 Make InlineSpiller bundle-aware.
Simply treat bundles as instructions. Spill code is inserted between
bundles, never inside a bundle.  Rewrite all operands in a bundle at
once.

Don't attempt and memory operand folding inside bundles.

llvm-svn: 151787
2012-03-01 01:43:25 +00:00
David Meyer
44201a2d17 [Object]
* Add begin_dynamic_table() / end_dynamic_table() private interface to ELFObjectFile.
* Add begin_libraries_needed() / end_libraries_needed() interface to ObjectFile, for grabbing the list of needed libraries for a shared object or dynamic executable.
* Implement this new interface completely for ELF, leave stubs for COFF and MachO.
* Add 'llvm-readobj' tool for dumping ObjectFile information.

llvm-svn: 151785
2012-03-01 01:36:50 +00:00
Jakob Stoklund Olesen
1885bf0ac7 Move getBundleStart() into MachineInstrBundle.h.
This allows the function to be inlined, and makes it suitable for use in
getInstructionIndex().

Also provide a const version. C++ is great for touch typing practice.

llvm-svn: 151782
2012-03-01 01:26:01 +00:00