c9e93a44be 
								
							 
						 
						
							
							
								
								Avoid a gcc warning about multiline comments.  
							
							... 
							
							
							
							llvm-svn: 132821 
							
						 
						
							2011-06-09 23:51:45 +00:00  
				
					
						
							
							
								 
						
							
								c735f13368 
								
							 
						 
						
							
							
								
								On last fix to the early tail duplication.  
							
							... 
							
							
							
							With this I am able to bootstrap clang with early tail duplication enabled
for any small bb and setting tail-dup-size to a relatively large value(8) to
stress this code.
llvm-svn: 132816 
							
						 
						
							2011-06-09 23:22:56 +00:00  
				
					
						
							
							
								 
						
							
								81512fc1bb 
								
							 
						 
						
							
							
								
								Also consider phi nodes when deciding if a register is live out.  
							
							... 
							
							
							
							llvm-svn: 132814 
							
						 
						
							2011-06-09 22:53:47 +00:00  
				
					
						
							
							
								 
						
							
								c90a32a4e6 
								
							 
						 
						
							
							
								
								AnalyzeBranch modifies the bb, but we don't want to modify a bb with  
							
							... 
							
							
							
							eh edges. Swap the order of the checks to avoid it.
llvm-svn: 132806 
							
						 
						
							2011-06-09 21:43:25 +00:00  
				
					
						
							
							
								 
						
							
								887fc1bdeb 
								
							 
						 
						
							
							
								
								A PHI in this basic block is a use in another basic block.  
							
							... 
							
							
							
							llvm-svn: 132805 
							
						 
						
							2011-06-09 20:55:41 +00:00  
				
					
						
							
							
								 
						
							
								73f93930e0 
								
							 
						 
						
							
							
								
								Refactor some checks into shouldTailDuplicate. Update comments.  
							
							... 
							
							
							
							No functionality change.
llvm-svn: 132798 
							
						 
						
							2011-06-09 19:54:42 +00:00  
				
					
						
							
							
								 
						
							
								eabd18b931 
								
							 
						 
						
							
							
								
								Fix count.  
							
							... 
							
							
							
							llvm-svn: 132749 
							
						 
						
							2011-06-08 14:23:19 +00:00  
				
					
						
							
							
								 
						
							
								dfbf6de747 
								
							 
						 
						
							
							
								
								Count how many phis we are creating.  
							
							... 
							
							
							
							llvm-svn: 132748 
							
						 
						
							2011-06-08 14:13:31 +00:00  
				
					
						
							
							
								 
						
							
								f7073d1445 
								
							 
						 
						
							
							
								
								Update comments.  
							
							... 
							
							
							
							llvm-svn: 124843 
							
						 
						
							2011-02-04 01:10:12 +00:00  
				
					
						
							
							
								 
						
							
								9af7afcb7f 
								
							 
						 
						
							
							
								
								Respect the -tail-dup-size command line option even when optimizing for size.  
							
							... 
							
							
							
							This is similar to the -unroll-threshold option. There should be no change in
behavior when -tail-dup-size is not explicit on the llc command line.
llvm-svn: 124564 
							
						 
						
							2011-01-30 20:38:12 +00:00  
				
					
						
							
							
								 
						
							
								d983eba7dc 
								
							 
						 
						
							
							
								
								Re-apply r124518 with fix. Watch out for invalidated iterator.  
							
							... 
							
							
							
							llvm-svn: 124526 
							
						 
						
							2011-01-29 04:46:23 +00:00  
				
					
						
							
							
								 
						
							
								65b8ccf6ac 
								
							 
						 
						
							
							
								
								Revert r124518. It broke Linux self-host.  
							
							... 
							
							
							
							llvm-svn: 124522 
							
						 
						
							2011-01-29 02:43:04 +00:00  
				
					
						
							
							
								 
						
							
								d4eff31476 
								
							 
						 
						
							
							
								
								Re-commit r124462 with fixes. Tail recursion elim will now dup ret into unconditional predecessor to enable TCE on demand.  
							
							... 
							
							
							
							llvm-svn: 124518 
							
						 
						
							2011-01-29 01:29:26 +00:00  
				
					
						
							
							
								 
						
							
								aaa9606b2f 
								
							 
						 
						
							
							
								
								Revert r124462. There are a few big regressions that I need to fix first.  
							
							... 
							
							
							
							llvm-svn: 124478 
							
						 
						
							2011-01-28 07:12:38 +00:00  
				
					
						
							
							
								 
						
							
								417fca86c4 
								
							 
						 
						
							
							
								
								- Stop simplifycfg from duplicating "ret" instructions into unconditional  
							
							... 
							
							
							
							branches. PR8575, rdar://5134905, rdar://8911460.
- Allow codegen tail duplication to dup small return blocks after register
  allocation is done.
llvm-svn: 124462 
							
						 
						
							2011-01-28 02:19:21 +00:00  
				
					
						
							
							
								 
						
							
								2fb5b31578 
								
							 
						 
						
							
							
								
								Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.  
							
							... 
							
							
							
							These functions not longer assert when passed 0, but simply return false instead.
No functional change intended.
llvm-svn: 123155 
							
						 
						
							2011-01-10 02:58:51 +00:00  
				
					
						
							
							
								 
						
							
								a7aed18624 
								
							 
						 
						
							
							
								
								Reapply r110396, with fixes to appease the Linux buildbot gods.  
							
							... 
							
							
							
							llvm-svn: 110460 
							
						 
						
							2010-08-06 18:33:48 +00:00  
				
					
						
							
							
								 
						
							
								bda59bd247 
								
							 
						 
						
							
							
								
								Revert r110396 to fix buildbots.  
							
							... 
							
							
							
							llvm-svn: 110410 
							
						 
						
							2010-08-06 00:23:35 +00:00  
				
					
						
							
							
								 
						
							
								755aceb5d0 
								
							 
						 
						
							
							
								
								Don't use PassInfo* as a type identifier for passes.  Instead, use the address of the static  
							
							... 
							
							
							
							ID member as the sole unique type identifier.  Clean up APIs related to this change.
llvm-svn: 110396 
							
						 
						
							2010-08-05 23:42:04 +00:00  
				
					
						
							
							
								 
						
							
								37c42a3d02 
								
							 
						 
						
							
							
								
								Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.  
							
							... 
							
							
							
							TII::isMoveInstr is going tobe completely removed.
llvm-svn: 108507 
							
						 
						
							2010-07-16 04:45:42 +00:00  
				
					
						
							
							
								 
						
							
								0c76d6ec21 
								
							 
						 
						
							
							
								
								Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.  
							
							... 
							
							
							
							llvm-svn: 108062 
							
						 
						
							2010-07-10 22:42:59 +00:00  
				
					
						
							
							
								 
						
							
								779c69bbc5 
								
							 
						 
						
							
							
								
								Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it  
							
							... 
							
							
							
							doesn't have to guess.
llvm-svn: 103194 
							
						 
						
							2010-05-06 20:33:48 +00:00  
				
					
						
							
							
								 
						
							
								a0bb715977 
								
							 
						 
						
							
							
								
								Ignore debug value instructions while analyzing BB for tail duplication.  
							
							... 
							
							
							
							llvm-svn: 98675 
							
						 
						
							2010-03-16 21:02:07 +00:00  
				
					
						
							
							
								 
						
							
								07293da97e 
								
							 
						 
						
							
							
								
								eliminate InvalidateLabel and LabelIDList from MMI and replace  
							
							... 
							
							
							
							them with a counter.
llvm-svn: 98462 
							
						 
						
							2010-03-14 02:24:55 +00:00  
				
					
						
							
							
								 
						
							
								75521cab3e 
								
							 
						 
						
							
							
								
								Reuse operand location when updating PHI instructions.  
							
							... 
							
							
							
							Calling RemoveOperand is very expensive on huge PHI instructions. This makes
early tail duplication run twice as fast on the Firefox JavaScript
interpreter.
llvm-svn: 95832 
							
						 
						
							2010-02-11 00:34:33 +00:00  
				
					
						
							
							
								 
						
							
								b06015aa69 
								
							 
						 
						
							
							
								
								move target-independent opcodes out of TargetInstrInfo  
							
							... 
							
							
							
							into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.
llvm-svn: 95687 
							
						 
						
							2010-02-09 19:54:29 +00:00  
				
					
						
							
							
								 
						
							
								97598f0cba 
								
							 
						 
						
							
							
								
								Treat indirect branches specially only during pre-regalloc tail duplication,  
							
							... 
							
							
							
							not during the later post-alloc tail duplication.
llvm-svn: 93600 
							
						 
						
							2010-01-16 00:42:25 +00:00  
				
					
						
							
							
								 
						
							
								73ef9556dd 
								
							 
						 
						
							
							
								
								Simplify logic. Any functional change is unintended.  
							
							... 
							
							
							
							llvm-svn: 93540 
							
						 
						
							2010-01-15 19:59:57 +00:00  
				
					
						
							
							
								 
						
							
								1a234c0aee 
								
							 
						 
						
							
							
								
								Change pre-regalloc tail duplication to only duplicate indirect branch blocks.  
							
							... 
							
							
							
							The pre-regalloc pass caused some regressions in both compile time and
performance of the generated code, and it did not improve performance, except
for indirect branches.  I also moved the check for single-block loops to speed
up the common case when running the taildup pass before reg allocation.
llvm-svn: 93505 
							
						 
						
							2010-01-15 06:29:17 +00:00  
				
					
						
							
							
								 
						
							
								29a64c9575 
								
							 
						 
						
							
							
								
								Add Target hook to duplicate machine instructions.  
							
							... 
							
							
							
							Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.
llvm-svn: 92873 
							
						 
						
							2010-01-06 23:47:07 +00:00  
				
					
						
							
							
								 
						
							
								85afc853b5 
								
							 
						 
						
							
							
								
								Change errs() to dbgs().  
							
							... 
							
							
							
							llvm-svn: 92582 
							
						 
						
							2010-01-05 01:25:15 +00:00  
				
					
						
							
							
								 
						
							
								45430bbfaa 
								
							 
						 
						
							
							
								
								Tail duplication should zap a copy it inserted for SSA update if the copy is the only use of its source.  
							
							... 
							
							
							
							llvm-svn: 91390 
							
						 
						
							2009-12-15 01:44:10 +00:00  
				
					
						
							
							
								 
						
							
								d9cb324d7c 
								
							 
						 
						
							
							
								
								Delete code accidentally left behind.  
							
							... 
							
							
							
							llvm-svn: 90804 
							
						 
						
							2009-12-07 21:19:33 +00:00  
				
					
						
							
							
								 
						
							
								cc77062194 
								
							 
						 
						
							
							
								
								Pre-regalloc tale duplication. Work in progress.  
							
							... 
							
							
							
							llvm-svn: 90759 
							
						 
						
							2009-12-07 10:15:19 +00:00  
				
					
						
							
							
								 
						
							
								9e67255748 
								
							 
						 
						
							
							
								
								Handle recursive PHI's.  
							
							... 
							
							
							
							llvm-svn: 90575 
							
						 
						
							2009-12-04 19:09:10 +00:00  
				
					
						
							
							
								 
						
							
								6154dbd5ee 
								
							 
						 
						
							
							
								
								Add a pre-regalloc tail duplication pass.  
							
							... 
							
							
							
							llvm-svn: 90567 
							
						 
						
							2009-12-04 09:42:45 +00:00  
				
					
						
							
							
								 
						
							
								1bbe6be037 
								
							 
						 
						
							
							
								
								Teach tail duplication to update SSA form. Work in progress.  
							
							... 
							
							
							
							llvm-svn: 90432 
							
						 
						
							2009-12-03 08:43:53 +00:00  
				
					
						
							
							
								 
						
							
								fffbc0c5d9 
								
							 
						 
						
							
							
								
								Don't count PHI instructions toward the limit for tail duplicating a block.  
							
							... 
							
							
							
							llvm-svn: 90326 
							
						 
						
							2009-12-02 17:15:24 +00:00  
				
					
						
							
							
								 
						
							
								598f8ff9e5 
								
							 
						 
						
							
							
								
								Reprioritize tests for tail duplication to be aggressive about indirect  
							
							... 
							
							
							
							branches even when optimizing for code size.  Unless we find evidence to the
contrary in the future, the special treatment for indirect branches does not
have a significant effect on code size, and performance still matters with -Os.
llvm-svn: 90147 
							
						 
						
							2009-11-30 18:56:45 +00:00  
				
					
						
							
							
								 
						
							
								505ddaa4dc 
								
							 
						 
						
							
							
								
								Remove isProfitableToDuplicateIndirectBranch target hook.  It is profitable  
							
							... 
							
							
							
							for all the processors where I have tried it, and even when it might not help
performance, the cost is quite low.  The opportunities for duplicating
indirect branches are limited by other factors so code size does not change
much due to tail duplicating indirect branches aggressively.
llvm-svn: 90144 
							
						 
						
							2009-11-30 18:35:03 +00:00  
				
					
						
							
							
								 
						
							
								9594db5693 
								
							 
						 
						
							
							
								
								Rename new TailDuplicationPass to avoid name conflict with the old one.  
							
							... 
							
							
							
							llvm-svn: 89968 
							
						 
						
							2009-11-26 21:38:41 +00:00  
				
					
						
							
							
								 
						
							
								2d4ff12da9 
								
							 
						 
						
							
							
								
								Split tail duplication into a separate pass.  This is needed to avoid  
							
							... 
							
							
							
							running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems.  Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.
llvm-svn: 89904 
							
						 
						
							2009-11-26 00:32:21 +00:00