oota-llvm.git
12 years agoUse uint16_t to store indices into string table since C++ only allows 64K string...
Craig Topper [Tue, 6 Mar 2012 06:04:39 +0000 (06:04 +0000)]
Use uint16_t to store indices into string table since C++ only allows 64K string literals so the index into the big string can never be larger than that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152105 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd asserts to ensure that values will fit into the tables.
Craig Topper [Tue, 6 Mar 2012 04:39:52 +0000 (04:39 +0000)]
Add asserts to ensure that values will fit into the tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152104 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIncrease number of allowed registers in register classes to 64k instead of 256. Widen...
Craig Topper [Tue, 6 Mar 2012 03:44:22 +0000 (03:44 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152100 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert r152016 and allow overlap, sub, super register tables to be more than 64k...
Craig Topper [Tue, 6 Mar 2012 03:28:45 +0000 (03:28 +0000)]
Revert r152016 and allow overlap, sub, super register tables to be more than 64k entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152099 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove UsuallyTinyPtrVector.
Argyrios Kyrtzidis [Tue, 6 Mar 2012 03:02:16 +0000 (03:02 +0000)]
Remove UsuallyTinyPtrVector.

It is just a worse version of TinyPtrVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152097 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd <imp-def> operands when reloading into physregs.
Jakob Stoklund Olesen [Tue, 6 Mar 2012 02:48:17 +0000 (02:48 +0000)]
Add <imp-def> operands when reloading into physregs.

When an instruction only writes sub-registers, it is still necessary to
add an <imp-def> operand for the super-register.  When reloading into a
virtual register, rewriting will add the operand, but when loading
directly into a virtual register, the <imp-def> operand is still
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152095 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix up link and a couple small edits.
Eric Christopher [Tue, 6 Mar 2012 02:25:41 +0000 (02:25 +0000)]
Fix up link and a couple small edits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152094 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd the beginnings of documentation for the Name Accelerator Tables.
Eric Christopher [Tue, 6 Mar 2012 02:25:38 +0000 (02:25 +0000)]
Add the beginnings of documentation for the Name Accelerator Tables.
Based on a writeup originally by Greg Clayton.

Abuse div and pre tags horribly. Needs a bit more cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152093 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDelete trailing whitespace to clean up.
Eric Christopher [Tue, 6 Mar 2012 02:25:36 +0000 (02:25 +0000)]
Delete trailing whitespace to clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152092 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd include/llvm/ADT/UsuallyTinyPtrVector.h which is a vector that
Argyrios Kyrtzidis [Tue, 6 Mar 2012 02:08:48 +0000 (02:08 +0000)]
Add include/llvm/ADT/UsuallyTinyPtrVector.h which is a vector that
optimizes the case where there is only one element.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152090 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAvoid finalizeBundles infinite looping.
Evan Cheng [Tue, 6 Mar 2012 02:00:52 +0000 (02:00 +0000)]
Avoid finalizeBundles infinite looping.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152089 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake it possible for a target to mark FSUB as Expand. This requires providing a...
Owen Anderson [Tue, 6 Mar 2012 00:29:31 +0000 (00:29 +0000)]
Make it possible for a target to mark FSUB as Expand.  This requires providing a default expansion (FADD+FNEG), and teaching DAGCombine not to form FSUBs post-legalize if they are not legal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152079 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSplit fpscr into two registers: FPSCR and FPSCR_NZCV.
Lang Hames [Tue, 6 Mar 2012 00:19:55 +0000 (00:19 +0000)]
Split fpscr into two registers: FPSCR and FPSCR_NZCV.

The fpscr register contains both flags (set by FP operations/comparisons) and
control bits. The control bits (FPSCR) should be reserved, since they're always
available and needn't be defined before use. The flag bits (FPSCR_NZCV) should
like to be unreserved so they can be hoisted by MachineCSE. This fixes PR12165.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152076 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoA few more cases of missing masking in ComputeMaskedBits; found by inspection.
Eli Friedman [Mon, 5 Mar 2012 23:22:40 +0000 (23:22 +0000)]
A few more cases of missing masking in ComputeMaskedBits; found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152070 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM vpush/vpop assembler mnemonics accept an optional size suffix.
Jim Grosbach [Mon, 5 Mar 2012 23:16:31 +0000 (23:16 +0000)]
ARM vpush/vpop assembler mnemonics accept an optional size suffix.

rdar://10988114

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152068 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNuke a bit of dead code.
Jim Grosbach [Mon, 5 Mar 2012 23:09:51 +0000 (23:09 +0000)]
Nuke a bit of dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152067 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure we don't return bits outside the mask in ComputeMaskedBits. PR12189.
Eli Friedman [Mon, 5 Mar 2012 23:09:40 +0000 (23:09 +0000)]
Make sure we don't return bits outside the mask in ComputeMaskedBits.  PR12189.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152066 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM Refactor VLD/VST spaced pair instructions.
Jim Grosbach [Mon, 5 Mar 2012 21:43:40 +0000 (21:43 +0000)]
ARM Refactor VLD/VST spaced pair instructions.

Use the new composite physical registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152063 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM Remove a bit of dead code.
Jim Grosbach [Mon, 5 Mar 2012 21:09:58 +0000 (21:09 +0000)]
ARM Remove a bit of dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152061 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM refactor away a bunch of VLD/VST pseudo instructions.
Jim Grosbach [Mon, 5 Mar 2012 19:33:30 +0000 (19:33 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152045 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMCRegisterInfo-ize getMatchingSuperReg.
Jim Grosbach [Mon, 5 Mar 2012 19:33:24 +0000 (19:33 +0000)]
MCRegisterInfo-ize getMatchingSuperReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152044 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake MCRegisterInfo available to the the MCInstPrinter.
Jim Grosbach [Mon, 5 Mar 2012 19:33:20 +0000 (19:33 +0000)]
Make MCRegisterInfo available to the the MCInstPrinter.

Used to allow context sensitive printing of super-register or sub-register
references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152043 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix warnings about adding a bool to a string.
Bill Wendling [Mon, 5 Mar 2012 19:29:36 +0000 (19:29 +0000)]
Fix warnings about adding a bool to a string.
Patch by Sean Silva!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152042 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAddress Evan's comments for r151877.
Chad Rosier [Mon, 5 Mar 2012 19:27:12 +0000 (19:27 +0000)]
Address Evan's comments for r151877.

Specifically, remove the magic number when checking to see if the copy has a
glue operand and simplify the checking logic.

rdar://10930395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152041 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove a test case that no longer makes sense.
Jakob Stoklund Olesen [Mon, 5 Mar 2012 19:10:13 +0000 (19:10 +0000)]
Remove a test case that no longer makes sense.

This was testing the handling of sub-register coalescing followed by
remat.  The original problem was caused by the extra <imp-def> operands
added by sub-register coalescing.  Those <imp-def> operands are not
added any longer, and the test case passes even when the original patch
is reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152040 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoupdated patch for the ARM fused multiply add/sub
Sebastian Pop [Mon, 5 Mar 2012 17:39:52 +0000 (17:39 +0000)]
updated patch for the ARM fused multiply add/sub

In this update:
- I assumed neon2 does not imply vfpv4, but neon and vfpv4 imply neon2.
- I kept setting .fpu=neon-vfpv4 code attribute because that is what the
assembler understands.

Patch by Ana Pazos <apazos@codeaurora.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152036 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofix typos
Sebastian Pop [Mon, 5 Mar 2012 17:39:47 +0000 (17:39 +0000)]
fix typos

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152035 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoremove spaces on empty lines
Sebastian Pop [Mon, 5 Mar 2012 17:39:45 +0000 (17:39 +0000)]
remove spaces on empty lines

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152034 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove an unused function.
Nadav Rotem [Mon, 5 Mar 2012 12:49:45 +0000 (12:49 +0000)]
Remove an unused function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152028 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThis is not a common case, in fact it never happens!
Duncan Sands [Mon, 5 Mar 2012 12:23:00 +0000 (12:23 +0000)]
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

12 years agoSwitch mem2reg to use the new hashing infrastructure.
Chandler Carruth [Mon, 5 Mar 2012 11:29:56 +0000 (11:29 +0000)]
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

12 years agoReplace the ad-hoc hashing in GVN with the new hashing infrastructure.
Chandler Carruth [Mon, 5 Mar 2012 11:29:54 +0000 (11:29 +0000)]
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

12 years agoSwitch the TableGen record's string-based DenseMap key to use the new
Chandler Carruth [Mon, 5 Mar 2012 10:36:16 +0000 (10:36 +0000)]
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

12 years agoSwitch to a C-style cast here to silence a brain-dead MSVC warning. It
Chandler Carruth [Mon, 5 Mar 2012 09:56:12 +0000 (09:56 +0000)]
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

12 years agoShrink and reorder fields in MCRegisterClass to reduce size of static data.
Craig Topper [Mon, 5 Mar 2012 08:33:33 +0000 (08:33 +0000)]
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

12 years agoConvert more GenRegisterInfo tables from unsigned to uint16_t to reduce static data...
Craig Topper [Mon, 5 Mar 2012 05:37:41 +0000 (05:37 +0000)]
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

12 years agoMake aliases for shld and shrd match gas. PR12173.
Eli Friedman [Mon, 5 Mar 2012 04:31:54 +0000 (04:31 +0000)]
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

12 years agoStop fixing bad machine code in LiveIntervalAnalysis.
Jakob Stoklund Olesen [Sun, 4 Mar 2012 19:19:10 +0000 (19:19 +0000)]
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

12 years agoStop adding <imp-def> operands when coalescing sub-registers.
Jakob Stoklund Olesen [Sun, 4 Mar 2012 19:19:07 +0000 (19:19 +0000)]
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

12 years agoUse <def,undef> operands when spilling NEON bundles.
Jakob Stoklund Olesen [Sun, 4 Mar 2012 18:40:30 +0000 (18:40 +0000)]
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

12 years agoNick pointed out on IRC that GVN's propagateEquality wasn't propagating
Duncan Sands [Sun, 4 Mar 2012 13:25:19 +0000 (13:25 +0000)]
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

12 years agoReplace the hashing functions on APInt and APFloat with overloads of the
Chandler Carruth [Sun, 4 Mar 2012 12:02:57 +0000 (12:02 +0000)]
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

12 years agoAdd generic support for hashing StringRef objects using the new hashing library.
Chandler Carruth [Sun, 4 Mar 2012 10:55:27 +0000 (10:55 +0000)]
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

12 years agoDo trivial CSE of dead BBs during codegen preparation.
Bill Wendling [Sun, 4 Mar 2012 10:46:01 +0000 (10:46 +0000)]
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

12 years agoUse uint16_t to store register overlaps to reduce static data.
Craig Topper [Sun, 4 Mar 2012 10:43:23 +0000 (10:43 +0000)]
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

12 years agoTeach the hashing facilities how to hash std::string objects.
Chandler Carruth [Sun, 4 Mar 2012 10:23:15 +0000 (10:23 +0000)]
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

12 years agoSplit this test up into two smaller, and more focused tests.
Chandler Carruth [Sun, 4 Mar 2012 10:23:11 +0000 (10:23 +0000)]
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

12 years agoUse uint16_t instead of unsigned to store registers in reg classes. Reduces static...
Craig Topper [Sun, 4 Mar 2012 10:16:38 +0000 (10:16 +0000)]
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

12 years agoUse uint16_t to store registers in callee saved register tables to reduce size of...
Craig Topper [Sun, 4 Mar 2012 03:33:22 +0000 (03:33 +0000)]
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

12 years agoUse uint8_t instead of enums to store values in X86 disassembler table. Shaves 150k...
Craig Topper [Sun, 4 Mar 2012 02:16:41 +0000 (02:16 +0000)]
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

12 years agoPerform the string table optimization for OperandMatchEntries too.
Benjamin Kramer [Sat, 3 Mar 2012 20:44:43 +0000 (20:44 +0000)]
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

12 years agoShrink the asm matcher tables.
Benjamin Kramer [Sat, 3 Mar 2012 19:13:26 +0000 (19:13 +0000)]
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

12 years agoStringToOffsetTable: Allow uniquing the first element, add an option to skip appendin...
Benjamin Kramer [Sat, 3 Mar 2012 19:13:20 +0000 (19:13 +0000)]
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

12 years agoEnable the small vector POD optimization for BitCodeAbbrevOp.
Benjamin Kramer [Sat, 3 Mar 2012 15:04:13 +0000 (15:04 +0000)]
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

12 years agoCorrectly initialize LineSectionSymbol. Thanks to Duncan Sands for noticing it.
Rafael Espindola [Sat, 3 Mar 2012 14:24:15 +0000 (14:24 +0000)]
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

12 years agoHonour --config-prefix also for lit.local.cfg.
Duncan Sands [Sat, 3 Mar 2012 13:30:56 +0000 (13:30 +0000)]
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

12 years agoMove the NonPOD struct out of the anonymous namespace instead of adding llvm:: everyw...
Francois Pichet [Sat, 3 Mar 2012 09:39:54 +0000 (09:39 +0000)]
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

12 years agoInclude cctype for isdigit. Patch by Stephen Hines.
Duncan Sands [Sat, 3 Mar 2012 09:36:58 +0000 (09:36 +0000)]
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

12 years agoFixes the Hashing tests on MSVC by adding llvm:: prefix to hash_value function call.
Francois Pichet [Sat, 3 Mar 2012 07:56:49 +0000 (07:56 +0000)]
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

12 years agounittests/ADT/HashingTest.cpp: Temporarily disable a new test introduced in r151891...
NAKAMURA Takumi [Sat, 3 Mar 2012 07:00:58 +0000 (07:00 +0000)]
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

12 years agollvm/docs/GarbageCollection.html: Prune utf8 BOM.
NAKAMURA Takumi [Sat, 3 Mar 2012 04:32:33 +0000 (04:32 +0000)]
llvm/docs/GarbageCollection.html: Prune utf8 BOM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151968 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agohash_state: Don't use initialization target during initialization.
Daniel Dunbar [Sat, 3 Mar 2012 00:35:48 +0000 (00:35 +0000)]
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

12 years agoFix RA-dependent test.
Jakob Stoklund Olesen [Sat, 3 Mar 2012 00:26:30 +0000 (00:26 +0000)]
Fix RA-dependent test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151958 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix comments for llvm-readobj, remove extraneous headers
David Meyer [Fri, 2 Mar 2012 23:43:51 +0000 (23:43 +0000)]
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

12 years agoFix indentation.
Benjamin Kramer [Fri, 2 Mar 2012 19:19:34 +0000 (19:19 +0000)]
Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151932 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTidy up. Trailing whitespace.
Jim Grosbach [Fri, 2 Mar 2012 17:46:15 +0000 (17:46 +0000)]
Tidy up. Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151926 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoautoconf: Set LLVM_CONFIGTIME to a stable value when using --disable-timestamps.
Daniel Dunbar [Fri, 2 Mar 2012 16:24:21 +0000 (16:24 +0000)]
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

12 years agoLVI: Recognize the form instcombine canonicalizes range checks into when forming...
Benjamin Kramer [Fri, 2 Mar 2012 15:34:43 +0000 (15:34 +0000)]
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

12 years agoHashing: microoptimize a truncate on 64 bit away. This currently blocks dead code...
Benjamin Kramer [Fri, 2 Mar 2012 15:34:35 +0000 (15:34 +0000)]
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

12 years agodelete dead code, patch by Michael Spencer.
Jia Liu [Fri, 2 Mar 2012 13:41:31 +0000 (13:41 +0000)]
delete dead code, patch by Michael Spencer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151909 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd llvm.gcroot into GarbageCollection.html, patch bylost lostfreeman@gmail.com.
Jia Liu [Fri, 2 Mar 2012 11:30:51 +0000 (11:30 +0000)]
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

12 years agoMake the hashing algorithm Endian neutral. This is a bit annoying, but
Chandler Carruth [Fri, 2 Mar 2012 11:16:10 +0000 (11:16 +0000)]
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

12 years agoSimplify the pair optimization. Rather than using complex type traits,
Chandler Carruth [Fri, 2 Mar 2012 10:56:40 +0000 (10:56 +0000)]
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

12 years agoASan: use getTypeAllocSize instead of getTypeStoreSize.
Evgeniy Stepanov [Fri, 2 Mar 2012 10:41:08 +0000 (10:41 +0000)]
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

12 years agoAdd a golden data test that I missed somehow the first time around.
Chandler Carruth [Fri, 2 Mar 2012 10:01:29 +0000 (10:01 +0000)]
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

12 years agoFix bad indenting that was left over from cut/paste of the golden values
Chandler Carruth [Fri, 2 Mar 2012 10:01:27 +0000 (10:01 +0000)]
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

12 years agoAdd a header that was technically missing to see if this gets the
Chandler Carruth [Fri, 2 Mar 2012 09:46:02 +0000 (09:46 +0000)]
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

12 years agoWe really want to hash pairs of directly-hashable data as directly
Chandler Carruth [Fri, 2 Mar 2012 09:26:36 +0000 (09:26 +0000)]
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

12 years agoAdd support for hashing pairs by delegating to each sub-object. There is
Chandler Carruth [Fri, 2 Mar 2012 08:32:29 +0000 (08:32 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151882 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPrevent obscure and incorrect tail-call optimization.
Chad Rosier [Fri, 2 Mar 2012 02:50:46 +0000 (02:50 +0000)]
Prevent obscure and incorrect tail-call optimization.

In this instance we are generating the tail-call during legalizeDAG.  The 2nd
floor call can't be a tail call because it clobbers %xmm1, which is defined by
the first floor call.  The first floor call can't be a tail-call because it's
not in the tail position.  The only reasonable way I could think to fix this
in a target-independent manner was to check for glue logic on the copy reg.

rdar://10930395

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151877 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGrammar-o in function name.
Eric Christopher [Fri, 2 Mar 2012 02:11:47 +0000 (02:11 +0000)]
Grammar-o in function name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151875 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoGrammar.
Eric Christopher [Fri, 2 Mar 2012 01:57:55 +0000 (01:57 +0000)]
Grammar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151874 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIf the linkage name doesn't exist we're supposed to emit a reference
Eric Christopher [Fri, 2 Mar 2012 01:57:52 +0000 (01:57 +0000)]
If the linkage name doesn't exist we're supposed to emit a reference
to the string table for the function name, not the function name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151873 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix an iterator invalidation problem. operator[] on a DenseMap
Dan Gohman [Fri, 2 Mar 2012 01:26:46 +0000 (01:26 +0000)]
Fix an iterator invalidation problem. operator[] on a DenseMap
can insert a new element, invalidating iterators. Use find
instead, and handle the case where the key is not found explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151871 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMisc micro-optimizations.
Dan Gohman [Fri, 2 Mar 2012 01:13:53 +0000 (01:13 +0000)]
Misc micro-optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151869 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the misguided extension here that reserved two special values in
Chandler Carruth [Fri, 2 Mar 2012 00:48:38 +0000 (00:48 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151865 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRevert "Reorder the sections being output to reduce the number of assembler"
Eric Christopher [Fri, 2 Mar 2012 00:30:24 +0000 (00:30 +0000)]
Revert "Reorder the sections being output to reduce the number of assembler"

The inline table needs to be constructed ahead of time so that it doesn't try to
create new strings while we're emitting everything.

This reverts commit a8ff9bccb399183cdd5f1c3cec2bda763664b4b0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151864 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoNeuter the optimization I implemented with r107852 and r108258 which turn some
Evan Cheng [Thu, 1 Mar 2012 23:27:13 +0000 (23:27 +0000)]
Neuter the optimization I implemented with r107852 and r108258 which turn some
floating point equality comparisons into integer ones with -ffast-math. The
issue is the optimization causes +0.0 != -0.0.

Now the optimization is only done when one side is known to be 0.0. The other
side's sign bit is masked off for the comparison.

rdar://10964603

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151861 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRe-disable the debug output. The comment is there explaining why we want
Chandler Carruth [Thu, 1 Mar 2012 23:20:45 +0000 (23:20 +0000)]
Re-disable the debug output. The comment is there explaining why we want
to keep this around -- updating golden tests is annoying otherwise.

Thanks to Benjamin for pointing this omission out on IRC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151860 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSwitch FoldingSet over to the new hashing infrastructure. We might want
Chandler Carruth [Thu, 1 Mar 2012 23:18:44 +0000 (23:18 +0000)]
Switch FoldingSet over to the new hashing infrastructure. We might want
to do more invasive refactoring here to get FoldingSet to use size_t or
even hash_code directly, but for now this is a good first step to remove
Yet Another Hashing Algorithm from LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151859 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoProvide the 32-bit variant of the golden tests. Not sure how I forgot to
Chandler Carruth [Thu, 1 Mar 2012 23:06:19 +0000 (23:06 +0000)]
Provide the 32-bit variant of the golden tests. Not sure how I forgot to
do this initially, sorry.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151857 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle regmasks in Thumb1RegisterInfo::saveScavengerRegister().
Jakob Stoklund Olesen [Thu, 1 Mar 2012 22:57:32 +0000 (22:57 +0000)]
Handle regmasks in Thumb1RegisterInfo::saveScavengerRegister().

This function could have r12 live across a function call when compiling
thumb1 code.

The test case for this is not included because it is very long. It must
provoke emergency spilling near a function call. The behavior is
provoked by MultiSource/Applications/JM/lencod, and it triggers an
assertion in the scavenger.

<rdar://problem/10963642>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151855 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReorder the sections being output to reduce the number of assembler
Eric Christopher [Thu, 1 Mar 2012 22:50:31 +0000 (22:50 +0000)]
Reorder the sections being output to reduce the number of assembler
fixups that are being used to determine section offsets. Reduces
the total number of fixups by 50% for a non-trivial testcase.

Part of rdar://10413936

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151852 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoARM use the right opcode for FP<->Integer move in fast-isel.
Jim Grosbach [Thu, 1 Mar 2012 22:47:09 +0000 (22:47 +0000)]
ARM use the right opcode for FP<->Integer move in fast-isel.

rdar://10965031

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151850 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinimal changes for LLVM to compile under VS11.
Michael J. Spencer [Thu, 1 Mar 2012 22:42:52 +0000 (22:42 +0000)]
Minimal changes for LLVM to compile under VS11.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151849 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChanges for migrating to using register mask operands.
Akira Hatanaka [Thu, 1 Mar 2012 22:27:29 +0000 (22:27 +0000)]
Changes for migrating to using register mask operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151847 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Object]
David Meyer [Thu, 1 Mar 2012 22:19:54 +0000 (22:19 +0000)]
[Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151845 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange ARMInstPrinter::printPredicateOperand() so it will not abort if it
Kevin Enderby [Thu, 1 Mar 2012 22:13:02 +0000 (22:13 +0000)]
Change ARMInstPrinter::printPredicateOperand() so it will not abort if it
runs into the undefined 15 condition code value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151844 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix bugs which were introduced when support for base+index floating point loads
Akira Hatanaka [Thu, 1 Mar 2012 22:12:30 +0000 (22:12 +0000)]
Fix bugs which were introduced when support for base+index floating point loads
and stores was added.

- SelectAddr should return false if Parent is an unaligned f32 load or store.
- Only aligned load and store nodes should be matched to select reg+imm
  floating point instructions.
- MIPS does not have support for f64 unaligned load or store instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151843 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoBumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller...
Benjamin Kramer [Thu, 1 Mar 2012 22:10:16 +0000 (22:10 +0000)]
BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size.

This replaces r151834 with a simpler fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151842 91177308-0d34-0410-b5e6-96231b3b80d8