oota-llvm.git
13 years agoIf the alignment of the byval argument is greater than the alignment
Eric Christopher [Thu, 9 Jun 2011 00:15:19 +0000 (00:15 +0000)]
If the alignment of the byval argument is greater than the alignment
of the frame then increase the maximum alignment of the frame to
match.

Fixes PR6965

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

13 years agoAdd a parameter to CCState so that it can access the MachineFunction.
Eric Christopher [Wed, 8 Jun 2011 23:55:35 +0000 (23:55 +0000)]
Add a parameter to CCState so that it can access the MachineFunction.

No functional change.

Part of PR6965

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

13 years agoFix an assymmetry between ConvertScalar_ExtractValue and ConvertScalar_InsertValue...
Cameron Zwarich [Wed, 8 Jun 2011 22:08:31 +0000 (22:08 +0000)]
Fix an assymmetry between ConvertScalar_ExtractValue and ConvertScalar_InsertValue. The
former was using the size of the entire alloca, whereas the latter was correctly using
the allocated size of the immediate type being converted (which may differ from the size
of the alloca). This fixes PR10082.

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

13 years agoFix bug in lowering of DYNAMIC_STACKALLOC nodes. The correct offset of the
Akira Hatanaka [Wed, 8 Jun 2011 21:28:09 +0000 (21:28 +0000)]
Fix bug in lowering of DYNAMIC_STACKALLOC nodes. The correct offset of the
dynamically allocated stack area was not set.

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

13 years agoReorganize code in MipsTargetLowering::LowerCall to improve readability.
Akira Hatanaka [Wed, 8 Jun 2011 17:39:33 +0000 (17:39 +0000)]
Reorganize code in MipsTargetLowering::LowerCall to improve readability.

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

13 years agoRemove a temporary test case probe in CheckForLiveRegDef.
Andrew Trick [Wed, 8 Jun 2011 15:19:49 +0000 (15:19 +0000)]
Remove a temporary test case probe in CheckForLiveRegDef.

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

13 years agoFix count.
Rafael Espindola [Wed, 8 Jun 2011 14:23:19 +0000 (14:23 +0000)]
Fix count.

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

13 years agoCount how many phis we are creating.
Rafael Espindola [Wed, 8 Jun 2011 14:13:31 +0000 (14:13 +0000)]
Count how many phis we are creating.

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

13 years agoFix an issue where the two-address conversion pass incorrectly rewrites untied
Cameron Zwarich [Tue, 7 Jun 2011 23:54:00 +0000 (23:54 +0000)]
Fix an issue where the two-address conversion pass incorrectly rewrites untied
operands to an early clobber register. This fixes <rdar://problem/9566076>.

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

13 years agoFix a silly error I introduce in r131951.
Rafael Espindola [Tue, 7 Jun 2011 23:26:45 +0000 (23:26 +0000)]
Fix a silly error I introduce in r131951.
Fixes PR10095.

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

13 years agoCreate a new ARM directory for FrontendC tests and use it.
Eric Christopher [Tue, 7 Jun 2011 22:20:13 +0000 (22:20 +0000)]
Create a new ARM directory for FrontendC tests and use it.

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

13 years agoFixed a few illegal paths with llvm_unreachable. Patch by Cameron McInally.
Chad Rosier [Tue, 7 Jun 2011 20:41:31 +0000 (20:41 +0000)]
Fixed a few illegal paths with llvm_unreachable.  Patch by Cameron McInally.

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

13 years agoTypo.
Chad Rosier [Tue, 7 Jun 2011 20:03:13 +0000 (20:03 +0000)]
Typo.

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

13 years agoRefactor MipsTargetLowering::EmitInstrWithCustomInserter.
Akira Hatanaka [Tue, 7 Jun 2011 19:28:39 +0000 (19:28 +0000)]
Refactor MipsTargetLowering::EmitInstrWithCustomInserter.

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

13 years agoPut back removed line.
Akira Hatanaka [Tue, 7 Jun 2011 19:03:14 +0000 (19:03 +0000)]
Put back removed line.

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

13 years agoCoding style fixes.
Akira Hatanaka [Tue, 7 Jun 2011 18:58:42 +0000 (18:58 +0000)]
Coding style fixes.

- Fix indentation.
- Move comments.
- Fit lines in 80 columns.
- Remove dead code.

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

13 years agoUse tabs to separate opcode and operand strings.
Akira Hatanaka [Tue, 7 Jun 2011 18:16:51 +0000 (18:16 +0000)]
Use tabs to separate opcode and operand strings.

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

13 years agoAdd comments for wrapper node patterns in MipsInstrInfo.td.
Akira Hatanaka [Tue, 7 Jun 2011 18:00:14 +0000 (18:00 +0000)]
Add comments for wrapper node patterns in MipsInstrInfo.td.

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

13 years agoTest that ".byte 1, 2, 3, 4" does the right thing.
Roman Divacky [Tue, 7 Jun 2011 17:32:17 +0000 (17:32 +0000)]
Test that ".byte 1, 2, 3, 4" does the right thing.

Requested by nbjoerg!

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

13 years agoMake EmitIntValue() work properly on big-endian targets.
Roman Divacky [Tue, 7 Jun 2011 17:31:02 +0000 (17:31 +0000)]
Make EmitIntValue() work properly on big-endian targets.

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

13 years agoTweak this test for ARM-hosted 'bot.
Stuart Hastings [Tue, 7 Jun 2011 15:23:11 +0000 (15:23 +0000)]
Tweak this test for ARM-hosted 'bot.

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

13 years agoSwitched to DenseMap for allowed sets in PBQP. Reduces total LLC time by 15% on CINT2...
Lang Hames [Tue, 7 Jun 2011 06:05:58 +0000 (06:05 +0000)]
Switched to DenseMap for allowed sets in PBQP. Reduces total LLC time by 15% on CINT2006 for x86-32.

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

13 years agoMove the legalizer tests to the X86 directory because the test uses the x86
Nadav Rotem [Tue, 7 Jun 2011 05:23:58 +0000 (05:23 +0000)]
Move the legalizer tests to the X86 directory because the test uses the x86
codegen. Thanks Galina.

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

13 years agoAdd test case for C++ exception handling and fix the following mistakes in MipsFrameL...
Akira Hatanaka [Tue, 7 Jun 2011 02:17:21 +0000 (02:17 +0000)]
Add test case for C++ exception handling and fix the following mistakes in MipsFrameLowering::emitPrologue:

- cfi directives are not inserted at the right location or in the right order.
- The source MachineLocation for the cfi directive that changes the cfa register
  to $fp should be MachineLocation::VirtualFP.
- A PROLOG_LABEL that marks the beginning of cfi_offset directives for
  callee-saved register is emitted even when no callee-saved registers are
  saved.
- When a callee-saved double precision register is saved, two cfi_offset
  directives, one for each of the paired single precision registers, should be
  emitted.

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

13 years agoFix a merge bug in preRAsched for handling physreg aliases.
Andrew Trick [Tue, 7 Jun 2011 00:38:12 +0000 (00:38 +0000)]
Fix a merge bug in preRAsched for handling physreg aliases.

I've been sitting on this long enough trying to find a test case. I
think the fix should go in now, but I'll keep working on the test case.

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

13 years agoFix for setjmp/longjmp exception handling on ARM. setjmp clobbers CPSR.
Andrew Trick [Tue, 7 Jun 2011 00:08:49 +0000 (00:08 +0000)]
Fix for setjmp/longjmp exception handling on ARM. setjmp clobbers CPSR.
rdar://problem/9556069

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

13 years agoSimplify local live range splitting's safeguard to fix PR10070.
Jakob Stoklund Olesen [Mon, 6 Jun 2011 23:55:20 +0000 (23:55 +0000)]
Simplify local live range splitting's safeguard to fix PR10070.

When local live range splitting creates a live range with the same
number of instructions as the old range, mark it as RS_Local. When such
a range is seen again, require that it be split in a way that reduces
the number of instructions. That guarantees we are making progress while
still being able to perform 3 -> 2+3 splits as required by PR10070.

This also means that the PrevSlot map is no longer needed. This was also
used to estimate new spill weights, but that is no longer necessary
after slotIndexes::insertMachineInstrInMaps() got the extra Late
insertion argument.

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

13 years agoFollowup to 132458, omit unnecessary stack copy when x87 input is a
Stuart Hastings [Mon, 6 Jun 2011 23:15:58 +0000 (23:15 +0000)]
Followup to 132458, omit unnecessary stack copy when x87 input is a
load.  rdar://problem/6373334

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

13 years agoAdd -O1/2/3 to bugpoint, so when you conclude opt -O2 reproduces an issue, you can...
Eli Friedman [Mon, 6 Jun 2011 22:45:46 +0000 (22:45 +0000)]
Add -O1/2/3 to bugpoint, so when you conclude opt -O2 reproduces an issue, you can just run bugpoint -O2. :)  My implementation isn't precisely equivalent to what opt does, but as far as I can tell, it's close enough.

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

13 years agoWe only do always-inlining at -O1; make opt reflect that.
Eli Friedman [Mon, 6 Jun 2011 22:13:27 +0000 (22:13 +0000)]
We only do always-inlining at -O1; make opt reflect that.

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

13 years agoGet allocation orders from RegisterClassInfo when possible.
Jakob Stoklund Olesen [Mon, 6 Jun 2011 21:02:04 +0000 (21:02 +0000)]
Get allocation orders from RegisterClassInfo when possible.

Only target-dependent hints require callbacks. The RCI allocation order
has CSR aliases last according to their order of appearance in the
getCalleeSavedRegs list. This can depend on the calling convention.

This way, AllocationOrder::next doesn't have to check for reserved
registers, and CSRs are always allocated last, even with weird calling
conventions.

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

13 years agoAdd methods to support the integer-promotion of vector types. Methods to
Nadav Rotem [Mon, 6 Jun 2011 20:55:56 +0000 (20:55 +0000)]
Add methods to support the integer-promotion of vector types. Methods to
legalize SDNodes such as BUILD_VECTOR, EXTRACT_VECTOR_ELT, etc.

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

13 years agoThis directory was missing the dg.exp to cause the tests to run. Some time since
Nick Lewycky [Mon, 6 Jun 2011 20:23:00 +0000 (20:23 +0000)]
This directory was missing the dg.exp to cause the tests to run. Some time since
it was added, the test has regressed, so XFAIL it.

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

13 years agoTest case for PR10085.
Stuart Hastings [Mon, 6 Jun 2011 20:03:22 +0000 (20:03 +0000)]
Test case for PR10085.

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

13 years agoAvoid FGETSIGN of 80-bit types. Fixes PR10085.
Stuart Hastings [Mon, 6 Jun 2011 16:44:31 +0000 (16:44 +0000)]
Avoid FGETSIGN of 80-bit types.  Fixes PR10085.

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

13 years agoDon't try to be clever, just preserve the target's allocation order.
Jakob Stoklund Olesen [Mon, 6 Jun 2011 16:36:30 +0000 (16:36 +0000)]
Don't try to be clever, just preserve the target's allocation order.

The order of registers returned by getCalleeSavedRegs is used to lay out
the fixed stack slots for CSRs. Some targets like their CSRs used from
one end, and some targets want them used from the other end.

When computing an allocation order, simply preserve the relative
ordering of CSRs that the target specifies in its allocation order.
Reordering CSRs would break some targets, ARM in particular.

We still place volatiles before the CSRs, providing slightly better
results with different calling conventions.

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

13 years agoPR10077: fix fast-isel of extractvalue of aggregate constants.
Eli Friedman [Mon, 6 Jun 2011 05:46:34 +0000 (05:46 +0000)]
PR10077: fix fast-isel of extractvalue of aggregate constants.

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

13 years agoHarden tests for windows path separators.
Benjamin Kramer [Sun, 5 Jun 2011 18:20:05 +0000 (18:20 +0000)]
Harden tests for windows path separators.

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

13 years agoUse path API for path concatenation.
Benjamin Kramer [Sun, 5 Jun 2011 14:36:47 +0000 (14:36 +0000)]
Use path API for path concatenation.

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

13 years agoBasic support for macros with explicit arguments.
Rafael Espindola [Sun, 5 Jun 2011 02:43:45 +0000 (02:43 +0000)]
Basic support for macros with explicit arguments.

We still don't handle

* default values
* :req
* :vararg
* \()

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

13 years agoProduce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have a
Rafael Espindola [Sun, 5 Jun 2011 01:20:06 +0000 (01:20 +0000)]
Produce an undefined reference to _GLOBAL_OFFSET_TABLE_ if we have a
VK_GOTOFF reloc. This matches as' behavior, but it is not clear why the linker
might need this, so I added a FIXME.

I could test this by duplicating test/MC/ELF/got.s, but it doesn't look
worthwhile.

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

13 years agoFix a test that keeps breaking when allocation orders change.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 23:34:40 +0000 (23:34 +0000)]
Fix a test that keeps breaking when allocation orders change.

Who said FileCheck couldn't handle arbitrarily complex conditions?

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

13 years agoTypeLegalizer: Add support for passing of vector-promoted types in registers (copyFro...
Nadav Rotem [Sat, 4 Jun 2011 20:58:08 +0000 (20:58 +0000)]
TypeLegalizer: Add support for passing of vector-promoted types in registers (copyFromParts/copyToParts).

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

13 years agoTypeLegalizer: Fix a bug in the promotion of elements of integer vectors.
Nadav Rotem [Sat, 4 Jun 2011 20:32:01 +0000 (20:32 +0000)]
TypeLegalizer: Fix a bug in the promotion of elements of integer vectors.
(only happens when using the -promote-elements option).

The correct legalization order is to first try to promote element. Next, we try
to widen vectors.

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

13 years agoRefactor parsing of variable names (ie., %foo and @foo) since they have the same
Nick Lewycky [Sat, 4 Jun 2011 18:16:26 +0000 (18:16 +0000)]
Refactor parsing of variable names (ie., %foo and @foo) since they have the same
rules. Also refactor "read string until quote" into its own function. No
functionality change!

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

13 years agoAdd support for @GOTPTOFF in i386 mode.
Nick Lewycky [Sat, 4 Jun 2011 17:38:07 +0000 (17:38 +0000)]
Add support for @GOTPTOFF in i386 mode.

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

13 years agoCast unused parameter to void.
Hans Wennborg [Sat, 4 Jun 2011 16:00:19 +0000 (16:00 +0000)]
Cast unused parameter to void.

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

13 years agoIf the block that we're threading through is jumped to by an indirect branch,
Bill Wendling [Sat, 4 Jun 2011 09:42:04 +0000 (09:42 +0000)]
If the block that we're threading through is jumped to by an indirect branch,
then we don't want to set the destination in the indirect branch to the
destination. This is because the indirect branch needs its destinations to have
had their block addresses taken. This isn't so of the new critical edge that's
split during this process. If it turns out that the destination block has only
one predecessor, and that being a BB with an indirect branch, then it won't be
marked as 'used' and may be removed.
PR10072

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

13 years agoDrop a RecordKeeper reference that wasn't necessary.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 07:49:55 +0000 (07:49 +0000)]
Drop a RecordKeeper reference that wasn't necessary.

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

13 years agoAdd a testcase to demonstrate the problem where phi translation is
Dan Gohman [Sat, 4 Jun 2011 07:05:05 +0000 (07:05 +0000)]
Add a testcase to demonstrate the problem where phi translation is
ignored for clobbering partial-alias loads.

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

13 years agoReapply r131781, now that the GVN bug with partially-aliasing loads
Dan Gohman [Sat, 4 Jun 2011 06:50:18 +0000 (06:50 +0000)]
Reapply r131781, now that the GVN bug with partially-aliasing loads
is disabled.

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

13 years agoDisable the main feature of 130180, the elimination of loads that are
Dan Gohman [Sat, 4 Jun 2011 06:48:50 +0000 (06:48 +0000)]
Disable the main feature of 130180, the elimination of loads that are
redundant with partially-aliasing loads.

When computing what portion of a clobbering load value is needed,
it doesn't consider phi-translation which may have occurred
between the clobbing load and the redundant load.

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

13 years agoRemove this test, which should have been reverted along with r131781.
Dan Gohman [Sat, 4 Jun 2011 06:21:23 +0000 (06:21 +0000)]
Remove this test, which should have been reverted along with r131781.

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

13 years agoUse processor name in the target triple. This fixes PowerPC64 to generate
Roman Divacky [Sat, 4 Jun 2011 06:15:42 +0000 (06:15 +0000)]
Use processor name in the target triple. This fixes PowerPC64 to generate
64bit code for example.

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

13 years agoRevert r131781 again. Apparently there is more going on here.
Dan Gohman [Sat, 4 Jun 2011 05:11:22 +0000 (05:11 +0000)]
Revert r131781 again. Apparently there is more going on here.

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

13 years agoSilence compiler warnings.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 05:09:36 +0000 (05:09 +0000)]
Silence compiler warnings.

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

13 years agoTeach TableGen to evaluate DAG expressions as set operations.
Jakob Stoklund Olesen [Sat, 4 Jun 2011 04:11:37 +0000 (04:11 +0000)]
Teach TableGen to evaluate DAG expressions as set operations.

A TableGen backend can define how certain classes can be expanded into
ordered sets of defs, typically by evaluating a specific field in the
record. The SetTheory class can then evaluate DAG expressions that refer
to these named sets.

A number of standard set and list operations are predefined, and the
backend can add more specialized operators if needed. The -print-sets
backend is used by SetTheory.td to provide examples.

This is intended to simplify how register classes are defined:

  def GR32_NOSP : RegisterClass<"X86", [i32], 32, (sub GR32, ESP)>;

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

13 years agoFold assert-only-used variable into the assert.
Nick Lewycky [Sat, 4 Jun 2011 02:07:10 +0000 (02:07 +0000)]
Fold assert-only-used variable into the assert.

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

13 years agoMissing include of climits in the new BranchProbability pass.
Andrew Trick [Sat, 4 Jun 2011 01:30:52 +0000 (01:30 +0000)]
Missing include of climits in the new BranchProbability pass.

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

13 years agoNew BranchProbabilityInfo analysis. Patch by Jakub Staszak!
Andrew Trick [Sat, 4 Jun 2011 01:16:30 +0000 (01:16 +0000)]
New BranchProbabilityInfo analysis. Patch by Jakub Staszak!

BranchProbabilityInfo provides an interface for IR passes to query the
likelihood that control follows a CFG edge. This patch provides an
initial implementation of static branch predication that will populate
BranchProbabilityInfo for branches with no external profile
information using very simple heuristics. It currently isn't hooked up
to any external profile data, so static prediction does all the work.

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

13 years agoReapply r131781 (revert r131809), now that some BasicAA shortcomings
Dan Gohman [Sat, 4 Jun 2011 00:46:31 +0000 (00:46 +0000)]
Reapply r131781 (revert r131809), now that some BasicAA shortcomings
it exposed are fixed.

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

13 years agoFix BasicAA's recursion detection so that it doesn't pessimize
Dan Gohman [Sat, 4 Jun 2011 00:31:50 +0000 (00:31 +0000)]
Fix BasicAA's recursion detection so that it doesn't pessimize
queries in the case of a DAG, where a query reaches a node
visited earlier, but it's not on a cycle. This avoids
MayAlias results in cases where BasicAA is expected to
return MustAlias or PartialAlias in order to protect TBAA.

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

13 years agoReapply 132424 with fixes. This fixes PR10068.
Stuart Hastings [Fri, 3 Jun 2011 23:53:54 +0000 (23:53 +0000)]
Reapply 132424 with fixes.  This fixes PR10068.
rdar://problem/5993888

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

13 years agoFix some tests that depend on register allocation.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 22:45:21 +0000 (22:45 +0000)]
Fix some tests that depend on register allocation.

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

13 years agoBlackfin always uses a reserved call frame.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 22:45:18 +0000 (22:45 +0000)]
Blackfin always uses a reserved call frame.

Materializing the stack pointer update before a call requires a scratch
register that may not be available.

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

13 years agoAnother possible bug. Stopgap until we can autogenerate tables and
Eric Christopher [Fri, 3 Jun 2011 22:09:12 +0000 (22:09 +0000)]
Another possible bug. Stopgap until we can autogenerate tables and
constraint lengths.

Part of rdar://9037836 and rdar://9119939

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

13 years agoTestcase for llvm-gcc commit r132591.
Eric Christopher [Fri, 3 Jun 2011 20:56:31 +0000 (20:56 +0000)]
Testcase for llvm-gcc commit r132591.

Part of rdar://9037836 and rdar://9119939

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

13 years agoFix an off by one error.
Eric Christopher [Fri, 3 Jun 2011 20:44:52 +0000 (20:44 +0000)]
Fix an off by one error.

Part of rdar://9037836 and rdar://9119939

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

13 years agoRemove testcase. It's problematic for the buildbots.
Bill Wendling [Fri, 3 Jun 2011 20:43:58 +0000 (20:43 +0000)]
Remove testcase. It's problematic for the buildbots.

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

13 years agoSwitch AllocationOrder to using RegisterClassInfo instead of a BitVector
Jakob Stoklund Olesen [Fri, 3 Jun 2011 20:34:53 +0000 (20:34 +0000)]
Switch AllocationOrder to using RegisterClassInfo instead of a BitVector
of reserved registers.

Use RegisterClassInfo in RABasic as well. This slightly changes som
allocation orders because RegisterClassInfo puts CSR aliases last.

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

13 years agoPreserve the original ordering when a CSR has multiple aliases.
Jakob Stoklund Olesen [Fri, 3 Jun 2011 20:34:50 +0000 (20:34 +0000)]
Preserve the original ordering when a CSR has multiple aliases.

Previously, these aliases would be ordered alphabetically. (BH, BL)

Print out the computed allocation orders.

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

13 years agoWhen merging MustAlias and PartialAlias, chose PartialAlias instead
Dan Gohman [Fri, 3 Jun 2011 20:17:36 +0000 (20:17 +0000)]
When merging MustAlias and PartialAlias, chose PartialAlias instead
of conservatively choosing MayAlias.

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

13 years agoUse IRBuilder, preserve line numbers.
Devang Patel [Fri, 3 Jun 2011 19:46:19 +0000 (19:46 +0000)]
Use IRBuilder, preserve line numbers.

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

13 years agoAccomodate front-ends which use private instead of internal here.
Bill Wendling [Fri, 3 Jun 2011 19:21:05 +0000 (19:21 +0000)]
Accomodate front-ends which use private instead of internal here.

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

13 years agoMake the Uv constraint a memory operand. This doesn't solve the
Eric Christopher [Fri, 3 Jun 2011 17:24:37 +0000 (17:24 +0000)]
Make the Uv constraint a memory operand. This doesn't solve the
addressing mode problem mentioned in r132559.

Backend part of rdar://9037836 and part of rdar://9119939

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

13 years agoAdd a TODO about memory operands.
Eric Christopher [Fri, 3 Jun 2011 17:21:23 +0000 (17:21 +0000)]
Add a TODO about memory operands.

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

13 years agoTest commit.
Hans Wennborg [Fri, 3 Jun 2011 17:15:37 +0000 (17:15 +0000)]
Test commit.

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

13 years agoA typedef's context is not the same as type's context. It is the context of typedef...
Devang Patel [Fri, 3 Jun 2011 17:04:51 +0000 (17:04 +0000)]
A typedef's context is not the same as type's context. It is the context of typedef decl itself. Use extra parameter to communicate this to DIBuilder.

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

13 years agoRevert name change from r132533. Lower case naming was intended per style guidelines.
Chad Rosier [Fri, 3 Jun 2011 17:02:19 +0000 (17:02 +0000)]
Revert name change from r132533.  Lower case naming was intended per style guidelines.

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

13 years agoFix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.
Roman Divacky [Fri, 3 Jun 2011 15:47:49 +0000 (15:47 +0000)]
Fix wrong usages of CTR/MCTR where CTR8/MCTR8 was meant.

- Check for MTCTR8 in addition to MTCTR when looking up a hazard.

- When lowering an indirect call use CTR8 when targeting 64bit.

- Introduce BCTR8 that uses CTR8 and use it on 64bit when expanding ISD::BRIND.

The last change fixes PR8487. With those changes, we are able to compile a
running "ls" and "sh" on FreeBSD/PowerPC64.

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

13 years agosinged int causes signed extension, which contradicts the intention to pick up
Zhongxing Xu [Fri, 3 Jun 2011 08:29:51 +0000 (08:29 +0000)]
singed int causes signed extension, which contradicts the intention to pick up
integers with high 32 bits being zero.

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

13 years agoRework the logic to not rely on undefined behaviour (1LL << 64). Also simplify.
Nick Lewycky [Fri, 3 Jun 2011 08:25:39 +0000 (08:25 +0000)]
Rework the logic to not rely on undefined behaviour (1LL << 64). Also simplify.

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

13 years agoBail on unswitching a switch statement for a case with a critical edge. We name
Nick Lewycky [Fri, 3 Jun 2011 06:27:15 +0000 (06:27 +0000)]
Bail on unswitching a switch statement for a case with a critical edge. We name
which edge to split by pred/succ pair, which means that we can end up splitting
the wrong edge (by case value) in the switch statement entirely. Fixes PR10031!

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

13 years agoWhitespace and other cleanup. Functionallity unchanged.
Chad Rosier [Fri, 3 Jun 2011 05:09:12 +0000 (05:09 +0000)]
Whitespace and other cleanup.  Functionallity unchanged.

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

13 years agoTreat Win64 EH as a DWARF EH scheme. For GCC-style exceptions, the layout of
Charles Davis [Fri, 3 Jun 2011 05:09:12 +0000 (05:09 +0000)]
Treat Win64 EH as a DWARF EH scheme. For GCC-style exceptions, the layout of
the handler's data area is similar to a DWARF-format LSDA. (It is, in fact,
a 32-bit pointer to the personality routine followed by the DWARF LSDA.)

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

13 years agoCorrections and additional information for "Creating and LLVM Project"
Andrew Trick [Fri, 3 Jun 2011 02:20:48 +0000 (02:20 +0000)]
Corrections and additional information for "Creating and LLVM Project"
documentation. This should now reflect the current state of LLVM Makefiles.

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

13 years agowhitespace
Andrew Trick [Fri, 3 Jun 2011 02:16:53 +0000 (02:16 +0000)]
whitespace

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

13 years agoAdd ARM fast-isel support for materializing the address of a global in cases where...
Eli Friedman [Fri, 3 Jun 2011 01:13:19 +0000 (01:13 +0000)]
Add ARM fast-isel support for materializing the address of a global in cases where the global uses an indirect symbol.

rdar://9431157

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

13 years agoBasic PassManager diagnostics.
Andrew Trick [Fri, 3 Jun 2011 00:48:58 +0000 (00:48 +0000)]
Basic PassManager diagnostics.

Added asserts whenever attempting to use a potentially
uninitialized pass. This helps people trying to develop a new pass and
people trying to understand the bug reports filed by the former people.

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

13 years agowhitespace
Andrew Trick [Fri, 3 Jun 2011 00:44:32 +0000 (00:44 +0000)]
whitespace

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

13 years agoTest case pasto (failed when run with IR verifier).
Andrew Trick [Thu, 2 Jun 2011 23:57:27 +0000 (23:57 +0000)]
Test case pasto (failed when run with IR verifier).

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

13 years agoAvoid calling TRI->getAllocatableSet in RAFast.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:41:40 +0000 (23:41 +0000)]
Avoid calling TRI->getAllocatableSet in RAFast.

When compiling a program with lots of small functions like
483.xalancbmk, this makes RAFast 11% faster.

Add some comments to clarify the difference between unallocatable and
reserved registers. It's quite subtle.

The fast register allocator depends on EFLAGS' not being allocatable on
x86. That way it can completely avoid tracking liveness, and it won't
mind when there are multiple uses of a single def.

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

13 years agoHave LowerOperandForConstraint handle multiple character constraints.
Eric Christopher [Thu, 2 Jun 2011 23:16:42 +0000 (23:16 +0000)]
Have LowerOperandForConstraint handle multiple character constraints.

Part of rdar://9119939

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

13 years agoFlag unallocatable register classes instead of giving them empty
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:24 +0000 (23:07 +0000)]
Flag unallocatable register classes instead of giving them empty
allocation orders.

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

13 years agoMake it possible to have unallocatable register classes.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 23:07:20 +0000 (23:07 +0000)]
Make it possible to have unallocatable register classes.

Some register classes are only used for instruction operand constraints.
They should never be used for virtual registers. Previously, those
register classes were given an empty allocation order, but now you can
say 'let isAllocatable=0' in the register class definition.

TableGen calculates if a register is part of any allocatable register
class, and makes that information available in TargetRegisterDesc::inAllocatableClass.

The goal here is to eliminate use cases for overriding allocation_order_*
methods.

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

13 years agoPreserve line number information while converting Invoke into a Call.
Devang Patel [Thu, 2 Jun 2011 22:46:58 +0000 (22:46 +0000)]
Preserve line number information while converting Invoke into a Call.

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

13 years agoThis should have been a C++ testcase.
Bill Wendling [Thu, 2 Jun 2011 22:26:15 +0000 (22:26 +0000)]
This should have been a C++ testcase.

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

13 years agoJust use a SmallVector.
Jakob Stoklund Olesen [Thu, 2 Jun 2011 22:22:43 +0000 (22:22 +0000)]
Just use a SmallVector.

I was confused whether new uint8_t[] would zero-initialize the returned
array, and it seems that so is gcc-4.0.

This should fix the test failures on darwin 9.

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

13 years agoTestcase for r132493.
Bill Wendling [Thu, 2 Jun 2011 22:12:42 +0000 (22:12 +0000)]
Testcase for r132493.

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

13 years agoUpdate for r132493 change.
Bill Wendling [Thu, 2 Jun 2011 22:11:49 +0000 (22:11 +0000)]
Update for r132493 change.

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