Commit Graph

52988 Commits

Author SHA1 Message Date
Chandler Carruth 6ea6de7cad Replace a hand rolled loop with a lovely StringRef helper we have these
days. No functionality changed.

llvm-svn: 151048
2012-02-21 09:12:48 +00:00
Chandler Carruth aec9708988 Pull the parsing helper functions out of the Triple interface entirely.
They're private static methods but we can just make them static
functions in the implementation. It makes the implementations a touch
more wordy, but takes another chunk out of the header file.

Also, take the opportunity to switch the names to the new coding
conventions.

No functionality changed here.

llvm-svn: 151047
2012-02-21 08:53:32 +00:00
Chandler Carruth 1f3325a6d9 Clean up comments that I missed when changing the triple representation.
Somehow, I even missed the ones I wrote just the other day...

Thanks to Matt for the code review.

llvm-svn: 151045
2012-02-21 08:31:18 +00:00
Andrew Trick da84e64683 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.

llvm-svn: 151032
2012-02-21 04:51:23 +00:00
Andrew Trick 5c714e7985 StackSlotColoring does not use a VirtRegMap
llvm-svn: 151031
2012-02-21 04:51:19 +00:00
Rafael Espindola 729e3aae92 Use more idiomatic assert.
llvm-svn: 151026
2012-02-21 03:51:14 +00:00
Rafael Espindola b2defca267 Avoid warning on non assert builds.
llvm-svn: 151025
2012-02-21 03:48:30 +00:00
Chandler Carruth 2d27b0f0ed 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.

llvm-svn: 151024
2012-02-21 03:39:36 +00:00
Rafael Espindola 7d445e92c3 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.

llvm-svn: 151015
2012-02-21 01:19:51 +00:00
Lang Hames 7e2ce889a0 Fix some bugs in HMEditor's moveAllOperandsInto logic.
llvm-svn: 151006
2012-02-21 00:00:36 +00:00
Nick Lewycky 519561f418 Check for the correct size in the invariant marker.
llvm-svn: 151003
2012-02-20 23:32:26 +00:00
Evan Cheng 63618f9ba6 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

llvm-svn: 151002
2012-02-20 23:28:17 +00:00
Chad Rosier 47eeddde24 Fix 80-column violation.
llvm-svn: 150998
2012-02-20 23:13:17 +00:00
Benjamin Kramer ac8ecc4e7e InstCombine: Removing the base from the address calculation is only safe when the GEPs are inbounds.
llvm-svn: 150978
2012-02-20 18:45:10 +00:00
Eric Christopher 4826c8fbe8 Make this a bit prettier and more obvious when a derived type isn't
derived from anything.

llvm-svn: 150975
2012-02-20 18:04:39 +00:00
Eric Christopher 300871076e If a derived type is also a composite type, print that information
too.

llvm-svn: 150974
2012-02-20 18:04:35 +00:00
Eric Christopher 8979712685 Add support for runtime languages on our forward declarations.
llvm-svn: 150973
2012-02-20 18:04:14 +00:00
Benjamin Kramer 7adb189538 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.

llvm-svn: 150962
2012-02-20 15:07:47 +00:00
Benjamin Kramer 7746eb62fb 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".

llvm-svn: 150961
2012-02-20 14:34:57 +00:00
James Molloy 862fe49c55 Teach the DAGCombiner that certain loadext nodes followed by ANDs can be converted to zeroexts.
llvm-svn: 150957
2012-02-20 12:02:38 +00:00
James Molloy 547d4c0662 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.

llvm-svn: 150956
2012-02-20 09:24:05 +00:00
Evan Cheng d0c02966d2 Make post-ra tail duplication bundle safe. No test case as recent codegen
flow changes have already hidden the bug. rdar://10893812

llvm-svn: 150949
2012-02-20 07:51:58 +00:00
Nick Lewycky 60829a587a Rename class Evaluate to Evaluator and put it in an anonymous namespace.
llvm-svn: 150947
2012-02-20 03:25:59 +00:00
Chris Lattner 445d8c6b50 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.

llvm-svn: 150944
2012-02-20 00:42:49 +00:00
Chandler Carruth 0d887dd0b9 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.

llvm-svn: 150941
2012-02-20 00:02:47 +00:00
Nick Lewycky 73be5e31a6 Move EvaluateFunction and EvaluateBlock into a class, and make the class store
the information that they pass around between them. No functionality change!

llvm-svn: 150939
2012-02-19 23:26:27 +00:00
Benjamin Kramer c84ded88ea Silence operator precedence warning.
llvm-svn: 150921
2012-02-19 12:25:07 +00:00
Ahmed Charles 636a3d618c Remove dead code. Improve llvm_unreachable text. Simplify some control flow.
llvm-svn: 150918
2012-02-19 11:37:01 +00:00
Ahmed Charles a4704ab080 StringRef'ize EmitSourceFileHeader().
llvm-svn: 150917
2012-02-19 11:35:20 +00:00
Craig Topper de121a1000 Remove some unneeded includes and fix ordering in X86ISelLowering.cpp. Remove unneeded 'using namespace'.
llvm-svn: 150916
2012-02-19 07:15:48 +00:00
Lang Hames 13b11527d8 Add machinery for pushing live ranges onto bundle starts while bundling.
llvm-svn: 150915
2012-02-19 07:13:05 +00:00
Lang Hames 8140e84757 Simplify moveEnteringDownFrom rules.
llvm-svn: 150914
2012-02-19 06:13:56 +00:00
Craig Topper 65a4ceea1e Unify all shuffle mask checking functions take a mask and VT instead of VectorShuffleSDNode.
llvm-svn: 150913
2012-02-19 05:41:45 +00:00
Lang Hames ed7f1f0b08 Skip through instructions rather than operands when looking for last use slot.
llvm-svn: 150912
2012-02-19 04:38:25 +00:00
NAKAMURA Takumi 5adeb93d8a APFloat::toString(): Fix overrun at scanning.
FYI, clang/test/SemaTemplate/template-id-printing.cpp had been failing due to it on cygwin-clang.

llvm-svn: 150911
2012-02-19 03:18:29 +00:00
Lang Hames da2ed648b5 Fix TODO and trailing whitespace.
llvm-svn: 150910
2012-02-19 03:09:55 +00:00
Lang Hames 4645a72763 Defer sanity checks on live intervals until after all have been updated. Hold (LiveInterval, LiveRange) pairs to update, rather than vregs.
llvm-svn: 150909
2012-02-19 03:00:30 +00:00
Craig Topper 3e5c04e432 Make a bunch of X86ISelLowering shuffle functions static now that they are no longer needed by isel.
llvm-svn: 150908
2012-02-19 02:53:47 +00:00
Jia Liu 608dc6e257 comment fix ARM.h
llvm-svn: 150904
2012-02-19 02:04:03 +00:00
Jia Liu e1d619691b some comment fix for X86 and ARM
llvm-svn: 150902
2012-02-19 02:03:36 +00:00
Craig Topper 66a3597a4a Add vmfunc instruction to X86 assembler and disassembler.
llvm-svn: 150899
2012-02-19 01:39:49 +00:00
Ahmed Charles 4f9484722c Fix issue with bitwise and precedence.
llvm-svn: 150897
2012-02-18 22:56:41 +00:00
Talin f2291c908b Hashing.h - utilities for hashing various data types.
llvm-svn: 150890
2012-02-18 21:00:49 +00:00
Rafael Espindola 082d482981 White space fixes.
llvm-svn: 150886
2012-02-18 19:46:02 +00:00
Rafael Espindola 991356e89b Temporarily disable this assert. Looks like it found a similar issue when
building bullet.

llvm-svn: 150885
2012-02-18 17:51:43 +00:00
Rafael Espindola 82d957593e 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).

llvm-svn: 150884
2012-02-18 17:22:58 +00:00
Jia Liu b22310fda6 Emacs-tag and some comment fix for all ARM, CellSPU, Hexagon, MBlaze, MSP430, PPC, PTX, Sparc, X86, XCore.
llvm-svn: 150878
2012-02-18 12:03:15 +00:00
Craig Topper 57d3aaed78 Add X86InstrSVM.td that I forgot to add in r150873.
llvm-svn: 150874
2012-02-18 08:34:12 +00:00
Craig Topper ed7aa46366 Add X86 assembler and disassembler support for AMD SVM instructions. Original patch by Kay Tiong Khoo. Few tweaks by me for code density and to reduce replication.
llvm-svn: 150873
2012-02-18 08:19:49 +00:00
Chandler Carruth b54950bef4 Trivial cleanup to group the generic 'armvN' cases with the 'arm' case,
etc. No functionality changed.

llvm-svn: 150867
2012-02-18 04:34:17 +00:00