Commit Graph

80464 Commits

Author SHA1 Message Date
Craig Topper
902af25abd Merge some tables in generated RegisterInfo file. Store indices into larger table instead of pointers to reduce relocations and shrink table size on 64-bit builds. Shaves ~24K off X86MCTargetDesc.o. Accidentally commited only part of this in r151038.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151039 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 06:23:21 +00:00
Craig Topper
4472838fc8 Merge some tables in generated RegisterInfo file. Store indices into larger table instead of pointers to reduce relocations and shrink table size on 64-bit builds. Shaves ~24K off X86MCTargetDesc.o
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 06:22:36 +00:00
Andrew Trick
19273aec44 Clear virtual registers after they are no longer referenced.
Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
This makes sharing code for pre/postRA passes more robust.
Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().

PEI resets virtual regs when it's done scavenging.

PTX will either have to provide its own PEI pass or assign physregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 04:51:23 +00:00
Andrew Trick
e8ccb04913 StackSlotColoring does not use a VirtRegMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151031 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 04:51:19 +00:00
Andrew Trick
90019479f9 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 04:51:17 +00:00
Rafael Espindola
705b48d960 Use more idiomatic assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 03:51:14 +00:00
Rafael Espindola
161fb5d936 Avoid warning on non assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151025 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 03:48:30 +00:00
Chandler Carruth
124e51c0d2 Switch the llvm::Triple class to immediately parse the triple string on
construction. Simplify its interface, implementation, and users
accordingly as there is no longer an 'uninitialized' state to check for.
Also, fixes a bug lurking in the interface as there was one method that
didn't correctly check for initialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151024 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 03:39:36 +00:00
Rafael Espindola
4b04578d65 It turns out that with the current scev organization ReuseOrCreateCast cannot
know where users will be added. Because of this, it cannot use
Builder.GetInsertPoint at all.

This patch
* removes the FIXME about adding the assert.
* adds a comment explaining hy we don't have one.
* removes a broken logic that only works for some callers and is not needed
  since r150884.
* adds an assert to caller that would have caught the bug fixed by r150884.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151015 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 01:19:51 +00:00
Lang Hames
fd6d3217d3 Fix some bugs in HMEditor's moveAllOperandsInto logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151006 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-21 00:00:36 +00:00
Nick Lewycky
0ef0557ab5 Check for the correct size in the invariant marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 23:32:26 +00:00
Evan Cheng
01b623c8c2 Fix machine-cp by having it to check sub-register indicies. e.g.
ecx = mov eax
al  = mov ch
The second copy is not a nop because the sub-indices of ecx,ch is not the
same of that of eax/al.

Re-enabled machine-cp.
PR11940


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 23:28:17 +00:00
Chad Rosier
acb6f5096f Fix 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 23:13:17 +00:00
Benjamin Kramer
117314009e Test case for r150978.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150979 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 19:00:28 +00:00
Benjamin Kramer
6ad48f4137 InstCombine: Removing the base from the address calculation is only safe when the GEPs are inbounds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150978 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 18:45:10 +00:00
Eric Christopher
1c7f744bbb Make this a bit prettier and more obvious when a derived type isn't
derived from anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150975 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 18:04:39 +00:00
Eric Christopher
dc1eeb89f2 If a derived type is also a composite type, print that information
too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150974 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 18:04:35 +00:00
Eric Christopher
9f90e8760f Add support for runtime languages on our forward declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150973 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 18:04:14 +00:00
Benjamin Kramer
9bb40853ee InstCombine: When comparing two GEPs that were derived from the same base pointer but use different types, expand the offset calculation and to the compare on the offset if profitable.
This came up in SmallVector code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150962 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 15:07:47 +00:00
Benjamin Kramer
d2348639e6 InstCombine: Make OptimizePointerDifference more aggressive.
- Ignore pointer casts.
- Also expand GEPs that aren't constantexprs when they have one use or only constant indices.

- We now compile "&foo[i] - &foo[j]" into "i - j".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150961 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 14:34:57 +00:00
James Molloy
6259dcdc57 Teach the DAGCombiner that certain loadext nodes followed by ANDs can be converted to zeroexts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 12:02:38 +00:00
James Molloy
873fd5f753 Improve generated code for extending loads and some trunc stores on ARM.
Teach TargetSelectionDAG about lengthening loads for vector types and set v4i8 as legal. Allow FP_TO_UINT for v4i16 from v4i32.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150956 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 09:24:05 +00:00
Evan Cheng
df7e8bd702 Make post-ra tail duplication bundle safe. No test case as recent codegen
flow changes have already hidden the bug. rdar://10893812


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150949 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 07:51:58 +00:00
Nick Lewycky
7fa7677705 Rename class Evaluate to Evaluator and put it in an anonymous namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150947 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 03:25:59 +00:00
Chris Lattner
b053fc1c92 fold comparisons of gep'd alloca points with null to false,
implementing PR12013.  We now compile the testcase to:

__Z4testv:                              ## @_Z4testv
## BB#0:                                ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	pushq	%rbx
	subq	$64, %rsp
	leaq	32(%rsp), %rbx
	movq	%rbx, (%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 16(%rsp)
	movl	$1, 32(%rsp)
	leaq	36(%rsp), %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_2
## BB#1:
	callq	_free
LBB0_2:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

instead of:

__Z4testv:                              ## @_Z4testv
## BB#0:
	pushq	%rbx
	subq	$64, %rsp
	xorl	%eax, %eax
	leaq	(%rsp), %rbx
	addq	$32, %rbx
	movq	%rbx, (%rsp)
	movq	%rbx, 8(%rsp)
	leaq	64(%rsp), %rcx
	movq	%rcx, 16(%rsp)
	je	LBB0_2
## BB#1:
	movl	$1, 32(%rsp)
	movq	%rbx, %rax
LBB0_2:                                 ## %_ZN4llvm15SmallVectorImplIiE9push_backERKi.exit
	addq	$4, %rax
	movq	%rax, 8(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z1gRN4llvm11SmallVectorIiLj8EEE
	movq	(%rsp), %rdi
	cmpq	%rbx, %rdi
	je	LBB0_4
## BB#3:
	callq	_free
LBB0_4:                                 ## %_ZN4llvm11SmallVectorIiLj8EED1Ev.exit
	addq	$64, %rsp
	popq	%rbx
	ret

This doesn't shrink clang noticably though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150944 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 00:42:49 +00:00
Chandler Carruth
637f949a7f Switch to a more idiomatic way of silencing unused variable warnings in
release builds. Silences clang's -Wself-assign.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 00:02:49 +00:00
Chandler Carruth
cceb8f44a0 Move constructors out-of-line and flesh out their documentation. No
functionality changed. This is in preparation for some refactoring of
how this class behaves.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150941 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-20 00:02:47 +00:00
Nick Lewycky
23ec5d7759 Move EvaluateFunction and EvaluateBlock into a class, and make the class store
the information that they pass around between them. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150939 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 23:26:27 +00:00
Benjamin Kramer
7db76e7ca3 Silence operator precedence warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150921 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 12:25:07 +00:00
NAKAMURA Takumi
273df0b910 autoconf/m4/visibility_inlines_hidden.m4: Tweak for cygwin-g++-4.5.3. It folded conftest regardress of attributge((noinline)) with >=O1 .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150920 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 12:05:12 +00:00
Ahmed Charles
b0934ab7d8 Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150918 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 11:37:01 +00:00
Ahmed Charles
d7ace3f8d1 StringRef'ize EmitSourceFileHeader().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150917 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 11:35:20 +00:00
Craig Topper
1bf724b28b Remove some unneeded includes and fix ordering in X86ISelLowering.cpp. Remove unneeded 'using namespace'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150916 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 07:15:48 +00:00
Lang Hames
6aceab1392 Add machinery for pushing live ranges onto bundle starts while bundling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150915 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 07:13:05 +00:00
Lang Hames
4a0b2d658a Simplify moveEnteringDownFrom rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 06:13:56 +00:00
Craig Topper
dd637ae0c3 Unify all shuffle mask checking functions take a mask and VT instead of VectorShuffleSDNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150913 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 05:41:45 +00:00
Lang Hames
038d2d5ced Skip through instructions rather than operands when looking for last use slot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150912 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 04:38:25 +00:00
NAKAMURA Takumi
752b2f0d88 APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150911 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 03:18:29 +00:00
Lang Hames
ac027144e8 Fix TODO and trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150910 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 03:09:55 +00:00
Lang Hames
55fed62c9e Defer sanity checks on live intervals until after all have been updated. Hold (LiveInterval, LiveRange) pairs to update, rather than vregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150909 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 03:00:30 +00:00
Craig Topper
5aaffa8470 Make a bunch of X86ISelLowering shuffle functions static now that they are no longer needed by isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 02:53:47 +00:00
Jia Liu
9ad012a29c comment fix ARM.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 02:04:03 +00:00
Jia Liu
44de83a7f6 some comment fix for X86 and ARM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150902 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 02:03:36 +00:00
Craig Topper
28a713b20a Add vmfunc instruction to X86 assembler and disassembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150899 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-19 01:39:49 +00:00
Ahmed Charles
507329912a Fix issue with bitwise and precedence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150897 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 22:56:41 +00:00
Talin
1a4b19ef9b Hashing.h - utilities for hashing various data types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 21:00:49 +00:00
Rafael Espindola
b155c23f98 White space fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 19:46:02 +00:00
Rafael Espindola
f3b32b3572 Temporarily disable this assert. Looks like it found a similar issue when
building bullet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 17:51:43 +00:00
Rafael Espindola
ef4c80e07b Don't skip debug instructions when looking for the insertion point of
the cast. If we do, we can end up with

   inst1
   ---------------  < Insertion point
   dbg inst
   new inst

instead of the desired

   inst1
   new inst
   ---------------  < Insertion point
   dbg inst

Another option would be for InsertNoopCastOfTo (or its callers) to move the
insertion point and we would end up with

   inst1
   dbg inst
   new inst
   ---------------  < Insertion point

but that complicates the callers. This fixes PR12018 (and firefox's build).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 17:22:58 +00:00
Jia Liu
31d157ae1a Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, MSP430, PPC, PTX, Sparc, X86, XCore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150878 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-18 12:03:15 +00:00