llvm-6502/include/llvm/ADT
Chris Lattner ea03e10fac Implement rdar://7415680 - Twine integer support lacks greatness
Microoptimize Twine's with unsigned and int to not pin their value to
the stack.  This saves stack space in common cases and allows mem2reg
in the caller.  A simple example is:

void foo(const Twine &);
void bar(int x) {
  foo("xyz: " + Twine(x));
}

Before:

__Z3bari:
	subq	$40, %rsp
	movl	%edi, 36(%rsp)
	leaq	L_.str3(%rip), %rax
	leaq	36(%rsp), %rcx
	leaq	8(%rsp), %rdi
	movq	%rax, 8(%rsp)
	movq	%rcx, 16(%rsp)
	movb	$3, 24(%rsp)
	movb	$7, 25(%rsp)
	callq	__Z3fooRKN4llvm5TwineE
	addq	$40, %rsp
	ret

After:

__Z3bari:
	subq	$24, %rsp
	leaq	L_.str3(%rip), %rax
	movq	%rax, (%rsp)
	movslq	%edi, %rax
	movq	%rax, 8(%rsp)
	movb	$3, 16(%rsp)
	movb	$7, 17(%rsp)
	leaq	(%rsp), %rdi
	callq	__Z3fooRKN4llvm5TwineE
	addq	$24, %rsp
	ret

It saves 16 bytes of stack and one instruction in this case.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103107 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 18:40:33 +00:00
..
APFloat.h make APFloat::toString be const. 2010-03-06 19:20:13 +00:00
APInt.h Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience. 2010-04-08 23:03:40 +00:00
APSInt.h Fix bug where APSInt::operator-- incremented instead of decremented. 2009-02-16 22:39:08 +00:00
BitVector.h Update BitVectorTest.cpp to stay in sync with SmallBitVectorTest.cpp, 2010-04-30 20:50:28 +00:00
DeltaAlgorithm.h Fix comment. 2010-02-17 19:26:45 +00:00
DenseMap.h Iterator traits and swap. closes PR6548 and PR6549 2010-03-08 20:45:52 +00:00
DenseMapInfo.h Add DenseMapInfo for int. 2010-04-29 18:50:35 +00:00
DenseSet.h Iterator traits and swap. closes PR6548 and PR6549 2010-03-08 20:45:52 +00:00
DepthFirstIterator.h Clean up the minor mess I caused with removing iterator.h. I shall take care of 80-col violations and the FIXME later. (Thanks goodness that I live in another continent, so the monkeypox did not strike me :-) 2009-08-27 06:41:46 +00:00
EquivalenceClasses.h Nick wants these alphabetized 2010-03-18 18:18:00 +00:00
FoldingSet.h Add the ability to "intern" FoldingSetNodeID data into a 2010-03-18 16:16:38 +00:00
GraphTraits.h 1. Allow SCCIterator to work with GraphT types that are constant. 2009-11-17 10:54:25 +00:00
ilist_node.h Public and private corrections, warned about by icc (#304). 2009-09-06 08:55:57 +00:00
ilist.h Names from dependent base classes are not found by unqualified lookup. 2009-12-15 03:10:26 +00:00
ImmutableIntervalMap.h ImmutableIntervalMap: Fix for unqualified lookup into dependent base class, done 2010-02-08 18:08:46 +00:00
ImmutableList.h Remove isPod() from DenseMapInfo, splitting it out to its own 2009-12-15 07:26:43 +00:00
ImmutableMap.h 11.8p1: A nested class is a member and as such has the same access rights as 2010-02-02 01:57:01 +00:00
ImmutableSet.h Fix -Asserts warnings. 2010-04-13 23:34:11 +00:00
IndexedMap.h Public and private corrections, warned about by icc (#304). 2009-09-06 08:55:57 +00:00
IntrusiveRefCntPtr.h Fixed lint errors: 2009-02-20 22:20:18 +00:00
Optional.h Move 'Optional' class from Clang to LLVM/ADT. 2010-04-09 20:25:54 +00:00
OwningPtr.h Remove MaybeOwningPtr. We're going to use reference-counting instead. 2010-04-05 23:53:46 +00:00
PointerIntPair.h Remove isPod() from DenseMapInfo, splitting it out to its own 2009-12-15 07:26:43 +00:00
PointerUnion.h Change PointerUnionX::getFromOpaqueValue() to be declared 'static inline' instead of 'static'. 2010-03-30 16:20:03 +00:00
PostOrderIterator.h eliminate all 80-col violations that I have introduced in my recent checkins (and some others more) 2009-08-27 23:44:33 +00:00
PriorityQueue.h Make a few more LLVM headers parsable as standalone headers. 2009-11-05 23:01:30 +00:00
SCCIterator.h reenable r101565, removing a problematic assertion. 2010-04-17 07:17:19 +00:00
ScopedHashTable.h TopLevelMap[] reference is a pointer. 2010-03-03 20:46:48 +00:00
SetOperations.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00
SetVector.h Fixed lint errors: 2009-02-20 22:20:18 +00:00
SmallBitVector.h SmallBitVector: Rework find_first/find_next and tweak test to test them (at least on 64 bit platforms). 2010-04-30 13:40:27 +00:00
SmallPtrSet.h Fix a comment typo. 2010-02-12 22:34:54 +00:00
SmallSet.h Fix apostrophos. 2009-09-15 15:08:33 +00:00
SmallString.h Allow SmallString to implicitly convert to StringRef. 2009-11-21 02:01:24 +00:00
SmallVector.h Fix PR6910. 2010-04-29 06:43:12 +00:00
SparseBitVector.h Move DataTypes.h to include/llvm/System, update all users. This breaks the last 2009-10-26 01:35:46 +00:00
Statistic.h Introduce namespace-scope functions to enable LLVM statistics without 2010-03-30 17:32:08 +00:00
STLExtras.h Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of 2010-03-12 17:45:06 +00:00
StringExtras.h utostr isn't going away too soon, try to make it slightly smaller. 2010-04-11 19:00:03 +00:00
StringMap.h Add a method to get a StringMapEntry from a pointer to the string 2010-03-24 00:53:27 +00:00
StringRef.h These functions don't need to access this. 2010-04-19 15:38:38 +00:00
StringSet.h Remove extra blank line and space. 2009-01-08 06:11:51 +00:00
StringSwitch.h Simplify this class by removing the result cache. 2009-12-11 15:30:07 +00:00
Trie.h Remove forgotten ShortNames in Trie and CompilationGraph 2009-11-30 13:14:13 +00:00
Triple.h Adding the MicroBlaze backend. 2010-02-23 19:15:24 +00:00
Twine.h Implement rdar://7415680 - Twine integer support lacks greatness 2010-05-05 18:40:33 +00:00
UniqueVector.h Removed trailing whitespace. 2009-01-09 19:25:42 +00:00
ValueMap.h Remove isPod() from DenseMapInfo, splitting it out to its own 2009-12-15 07:26:43 +00:00
VectorExtras.h Don't attribute in file headers anymore. See llvmdev for the 2007-12-29 19:59:42 +00:00