Commit Graph

80812 Commits

Author SHA1 Message Date
Nadav Rotem
7eb0bf5fb7 Remove an unused function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152028 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 12:49:45 +00:00
Duncan Sands
8d12f72c11 This is not a common case, in fact it never happens!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 12:23:00 +00:00
Chandler Carruth
e5121f2e22 Switch mem2reg to use the new hashing infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 11:29:56 +00:00
Chandler Carruth
16003d0c0c Replace the ad-hoc hashing in GVN with the new hashing infrastructure.
This implicitly fixes a nasty bug in the GVN hashing (that thankfully
could only manifest as a performance bug): actually include the opcode
in the hash. The old code started the hash off with the opcode, but then
overwrote it with the type pointer.

Since this is likely to be pretty hot (GVN being already pretty
expensive) I've included a micro-optimization to just not bother with
the varargs hashing if they aren't present. I can't measure any change
in GVN performance due to this, even with a big test case like Duncan's
sqlite one. Everything I see is in the noise floor. That said, this
closes a loop hole for a potential scaling problem due to collisions if
the opcode were the differentiating aspect of the expression.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 11:29:54 +00:00
Chandler Carruth
c78bd9ba6b Switch the TableGen record's string-based DenseMap key to use the new
hashing infrastructure. I wonder why we don't just use StringMap here,
and I may revisit the issue if I have time, but for now I'm just trying
to consolidate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152023 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 10:36:16 +00:00
Chandler Carruth
179bc7cb59 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152021 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 09:56:12 +00:00
Craig Topper
52b89dd303 Shrink and reorder fields in MCRegisterClass to reduce size of static data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152019 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 08:33:33 +00:00
Craig Topper
9ebfbf8b9f Convert more GenRegisterInfo tables from unsigned to uint16_t to reduce static data size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 05:37:41 +00:00
Eli Friedman
ec93b6deca Make aliases for shld and shrd match gas. PR12173.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152014 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-05 04:31:54 +00:00
Jakob Stoklund Olesen
92b7df07af Stop fixing bad machine code in LiveIntervalAnalysis.
The first def of a virtual register cannot also read the register.
Assert on such bad machine code instead of trying to fix it.
TwoAddressInstructionPass should never create code like that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152010 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 19:19:10 +00:00
Jakob Stoklund Olesen
8d9c3a4ee7 Stop adding <imp-def> operands when coalescing sub-registers.
We are already setting <undef> flags, and that is good enough. The
<imp-def> operands don't mean anything any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 19:19:07 +00:00
Jakob Stoklund Olesen
fce711cb65 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 18:40:30 +00:00
Duncan Sands
190e5a3314 Nick pointed out on IRC that GVN's propagateEquality wasn't propagating
equalities into phi node operands for which the equality is known to
hold in the incoming basic block.  That's because replaceAllDominatedUsesWith
wasn't handling phi nodes correctly in general (that this didn't give wrong
results was just luck: the specific way GVN uses replaceAllDominatedUsesWith
precluded wrong changes to phi nodes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 13:25:19 +00:00
Chandler Carruth
ed7692a136 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 12:02:57 +00:00
Chandler Carruth
528f0bbe19 Add generic support for hashing StringRef objects using the new hashing library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:55:27 +00:00
Bill Wendling
e3e394d982 Do trivial CSE of dead BBs during codegen preparation.
Some BBs can become dead after codegen preparation. If we delete them here, it
could help enable tail-call optimizations later on.
<rdar://problem/10256573>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:46:01 +00:00
Craig Topper
e4fd907e72 Use uint16_t to store register overlaps to reduce static data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152001 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:43:23 +00:00
Chandler Carruth
9406da6e66 Teach the hashing facilities how to hash std::string objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:23:15 +00:00
Chandler Carruth
21d60d5161 Split this test up into two smaller, and more focused tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:23:11 +00:00
Craig Topper
b6632ba380 Use uint16_t instead of unsigned to store registers in reg classes. Reduces static data size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 10:16:38 +00:00
Craig Topper
015f228861 Use uint16_t to store registers in callee saved register tables to reduce size of static data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151996 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 03:33:22 +00:00
Craig Topper
991271d9c4 Use uint8_t instead of enums to store values in X86 disassembler table. Shaves 150k off the size of X86DisassemblerDecoder.o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-04 02:16:41 +00:00
Benjamin Kramer
b08bb34a6f Perform the string table optimization for OperandMatchEntries too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 20:44:43 +00:00
Benjamin Kramer
a4c5ecfb1b Shrink the asm matcher tables.
- Shrink the opcode field to 16 bits.
- Shrink the AsmVariantID field to 8 bits.
- Store the mnemonic string in a string table, store a 16 bit index.
- Store a pascal-style length byte in the string instead of a null terminator,
  so we can avoid calling strlen on every entry we visit during mnemonic search.

Shrinks X86AsmParser.o from 434k to 201k on x86_64 and eliminates relocs from the table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151984 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 19:13:26 +00:00
Benjamin Kramer
02ee75393f StringToOffsetTable: Allow uniquing the first element, add an option to skip appending a terminating null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151983 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 19:13:20 +00:00
Benjamin Kramer
e19ead0f24 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 15:04:13 +00:00
Rafael Espindola
e6ec02e8af Correctly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 14:24:15 +00:00
Duncan Sands
61318736ee Honour --config-prefix also for lit.local.cfg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151977 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 13:30:56 +00:00
Francois Pichet
5fa6f5bc2e Move the NonPOD struct out of the anonymous namespace instead of adding llvm:: everywhere to fix the HashingTest on MSVC .
chandlerc proposed this better solution on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151974 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 09:39:54 +00:00
Duncan Sands
0aaf2f6369 Include cctype for isdigit. Patch by Stephen Hines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 09:36:58 +00:00
Francois Pichet
2547e7faba Fixes the Hashing tests on MSVC by adding llvm:: prefix to hash_value function call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151971 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 07:56:49 +00:00
NAKAMURA Takumi
edf24a8be4 unittests/ADT/HashingTest.cpp: Temporarily disable a new test introduced in r151891, to appease msvc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151970 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 07:00:58 +00:00
NAKAMURA Takumi
2aaf3fcbc0 llvm/docs/GarbageCollection.html: Prune utf8 BOM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151968 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 04:32:33 +00:00
Daniel Dunbar
a2a9b9e775 hash_state: Don't use initialization target during initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151959 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 00:35:48 +00:00
Jakob Stoklund Olesen
cf95d3a5d7 Fix RA-dependent test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151958 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-03 00:26:30 +00:00
David Meyer
ee37b6e4cd Fix comments for llvm-readobj, remove extraneous headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 23:43:51 +00:00
Benjamin Kramer
171cda96c8 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151932 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 19:19:34 +00:00
Jim Grosbach
ed4cf997ab Tidy up. Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151926 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 17:46:15 +00:00
Daniel Dunbar
c70b79eec1 autoconf: Set LLVM_CONFIGTIME to a stable value when using --disable-timestamps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 16:24:21 +00:00
Benjamin Kramer
8979e5f372 LVI: Recognize the form instcombine canonicalizes range checks into when forming constant ranges.
This could probably be made a lot smarter, but this is a common case and doesn't require LVI to scan a lot
of code. With this change CVP can optimize away the "shift == 0" case in Hashing.h that only gets hit when
"shift" is in a range not containing 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151919 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 15:34:43 +00:00
Benjamin Kramer
0c7374d87e 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 15:34:35 +00:00
Jia Liu
9b3b95fab7 delete dead code, patch by Michael Spencer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 13:41:31 +00:00
Jia Liu
08bc33dcbb add llvm.gcroot into GarbageCollection.html, patch bylost lostfreeman@gmail.com.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 11:30:51 +00:00
Chandler Carruth
dc62a90696 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 11:16:10 +00:00
Chandler Carruth
1c1448984d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:56:40 +00:00
Evgeniy Stepanov
d8313be410 ASan: use getTypeAllocSize instead of getTypeStoreSize.
This change replaces getTypeStoreSize with getTypeAllocSize in AddressSanitizer
instrumentation for stack allocations.

One case where old behaviour produced undesired results is an optimization in
InstCombine pass (PromoteCastOfAllocation), which can replace  alloca(T) with
alloca(S), where S has the same AllocSize, but a smaller StoreSize. Another
case is memcpy(long double => long double), where ASan will poison bytes 10-15
of a stack-allocated long double (StoreSize  10, AllocSize 16,
sizeof(long double) = 16).

See http://llvm.org/bugs/show_bug.cgi?id=12047 for more context.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151887 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:41:08 +00:00
Chandler Carruth
c3f99182be Add a golden data test that I missed somehow the first time around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:01:29 +00:00
Chandler Carruth
4fc5bdf16e Fix bad indenting that was left over from cut/paste of the golden values
for 32-bit builds in here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 10:01:27 +00:00
Chandler Carruth
88c48fae69 Add a header that was technically missing to see if this gets the
offsetof buildbot errors to go away...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 09:46:02 +00:00
Chandler Carruth
4d628e200f 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-02 09:26:36 +00:00