Rafael Espindola
8fc59a682f
Handle reloc_riprel_4byte_movq_load. Should make the bots happy.
...
llvm-svn: 122579
2010-12-27 02:03:24 +00:00
Francois Pichet
b7577657cd
More __uuidof validation:
...
1. Do not validate for uuid attribute if the type is template dependent.
2. Search every class declaration and definition for the uuid attribute.
llvm-svn: 122578
2010-12-27 01:32:00 +00:00
Rafael Espindola
2ac8355ecd
Add support for the same encodings of the personality function that gnu as
...
supports.
llvm-svn: 122577
2010-12-27 00:36:05 +00:00
Benjamin Kramer
84bd73c527
BuildLibCalls: Nuke EmitMemCpy, EmitMemMove and EmitMemSet. They are dead and superseded by IRBuilder.
...
llvm-svn: 122576
2010-12-27 00:25:32 +00:00
Benjamin Kramer
7cba269dfb
SimplifyLibCalls: Use IRBuilder to simplify code.
...
llvm-svn: 122575
2010-12-27 00:16:46 +00:00
Chris Lattner
b9fe685b9a
have loop-idiom nuke instructions that feed stores that get removed.
...
llvm-svn: 122574
2010-12-27 00:03:23 +00:00
Chris Lattner
29e14edc8d
implement enough of the memset inference algorithm to recognize and insert
...
memsets. This is still missing one important validity check, but this is enough
to compile stuff like this:
void test0(std::vector<char> &X) {
for (std::vector<char>::iterator I = X.begin(), E = X.end(); I != E; ++I)
*I = 0;
}
void test1(std::vector<int> &X) {
for (long i = 0, e = X.size(); i != e; ++i)
X[i] = 0x01010101;
}
With:
$ clang t.cpp -S -o - -O2 -emit-llvm | opt -loop-idiom | opt -O3 | llc
to:
__Z5test0RSt6vectorIcSaIcEE: ## @_Z5test0RSt6vectorIcSaIcEE
## BB#0: ## %entry
subq $8, %rsp
movq (%rdi), %rax
movq 8(%rdi), %rsi
cmpq %rsi, %rax
je LBB0_2
## BB#1: ## %bb.nph
subq %rax, %rsi
movq %rax, %rdi
callq ___bzero
LBB0_2: ## %for.end
addq $8, %rsp
ret
...
__Z5test1RSt6vectorIiSaIiEE: ## @_Z5test1RSt6vectorIiSaIiEE
## BB#0: ## %entry
subq $8, %rsp
movq (%rdi), %rax
movq 8(%rdi), %rdx
subq %rax, %rdx
cmpq $4, %rdx
jb LBB1_2
## BB#1: ## %for.body.preheader
andq $-4, %rdx
movl $1, %esi
movq %rax, %rdi
callq _memset
LBB1_2: ## %for.end
addq $8, %rsp
ret
llvm-svn: 122573
2010-12-26 23:42:51 +00:00
Chris Lattner
6cf8d6cc6e
start using irbuilder to make mem intrinsics in a few passes.
...
llvm-svn: 122572
2010-12-26 22:57:41 +00:00
Chris Lattner
143a07cfee
add methods to IRBuilder to create memcpy/memset/memmove.
...
llvm-svn: 122571
2010-12-26 22:49:25 +00:00
Rafael Espindola
54462cd730
Fix .cfi_personality on 32 bit systems.
...
llvm-svn: 122570
2010-12-26 22:47:37 +00:00
David Chisnall
168b80f2c0
Add support for GNU runtime property set / get structure functions. Minor refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point).
...
llvm-svn: 122569
2010-12-26 22:13:16 +00:00
Rafael Espindola
9ae2d05d45
Add support for @note. Patch by Jörg Sonnenberger.
...
llvm-svn: 122568
2010-12-26 21:30:59 +00:00
Chris Lattner
7c5f9c35d1
sketch more of this out.
...
llvm-svn: 122567
2010-12-26 20:45:45 +00:00
Rafael Espindola
9141b611ad
Add basic support for .cfi_personality.
...
llvm-svn: 122566
2010-12-26 20:20:31 +00:00
Chris Lattner
9cb1035f94
move isBytewiseValue out to ValueTracking.h/cpp
...
llvm-svn: 122565
2010-12-26 20:15:01 +00:00
David Chisnall
6f0a7d224b
Fix for PR8695.
...
llvm-svn: 122564
2010-12-26 20:12:30 +00:00
Chris Lattner
81ae3f299a
actually add the file...
...
llvm-svn: 122563
2010-12-26 19:39:38 +00:00
Chris Lattner
2ef535a4e4
Start of a pass for recognizing memset and memcpy idioms.
...
No functionality yet.
llvm-svn: 122562
2010-12-26 19:32:44 +00:00
Benjamin Kramer
30342fb1fd
Simplify code.
...
llvm-svn: 122561
2010-12-26 15:23:45 +00:00
Chris Lattner
f9e0a56b94
fix some sort of weird pasto
...
llvm-svn: 122560
2010-12-26 12:05:11 +00:00
Chris Lattner
424de3498b
add a note
...
llvm-svn: 122559
2010-12-26 03:53:31 +00:00
Chris Lattner
ad3467ee89
The -fshort-wchar option causes wchar_t to become unsigned, in addition to being
...
16-bits in size. Implement this by splitting WChar into two enums, like we have
for char. This fixes a miscompmilation of XULRunner, PR8856.
llvm-svn: 122558
2010-12-25 23:25:43 +00:00
Chris Lattner
03a102bff3
Generalize a previous change, fixing PR8855 - an valid large immediate
...
rejected by the mc assembler.
llvm-svn: 122557
2010-12-25 21:36:35 +00:00
Chris Lattner
d729d0dcdb
don't lose TD info
...
llvm-svn: 122556
2010-12-25 20:52:04 +00:00
Chris Lattner
20fca48341
switch the inliner alignment enforcement stuff to use the
...
getOrEnforceKnownAlignment function, which simplifies the code
and makes it stronger.
llvm-svn: 122555
2010-12-25 20:42:38 +00:00
Chris Lattner
6fcd32e7d7
Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils.
...
llvm-svn: 122554
2010-12-25 20:37:57 +00:00
Michael J. Spencer
e13f1ead9b
Support/PathV1: Deprecate makeAbsolute and remove Unix impl because it annoys people.
...
llvm-svn: 122553
2010-12-25 20:10:11 +00:00
Michael J. Spencer
bc7fcc2191
Remove all uses of PathV1::GetRootDirectory.
...
llvm-svn: 122552
2010-12-25 20:09:27 +00:00
Eric Christopher
481de07b00
Header warning patrol.
...
llvm-svn: 122551
2010-12-25 02:38:01 +00:00
Benjamin Kramer
b90b2f0635
Fix a thinko pointed out by Frits van Bommel: looking through global variables in isBytewiseValue is not safe.
...
llvm-svn: 122550
2010-12-24 22:23:59 +00:00
Rafael Espindola
0f8abeba1d
Merge IsFixupFullyResolved and IsSymbolRefDifferenceFullyResolved. We now
...
have a single point where targets test if a relocation is needed.
llvm-svn: 122549
2010-12-24 21:22:02 +00:00
Benjamin Kramer
ea9152e551
MemCpyOpt: Turn memcpys from a constant into a memset if possible.
...
This allows us to compile "int cst[] = {-1, -1, -1};" into
movl $-1, 16(%rsp)
movq $-1, 8(%rsp)
instead of
movl _cst+8(%rip), %eax
movl %eax, 16(%rsp)
movq _cst(%rip), %rax
movq %rax, 8(%rsp)
llvm-svn: 122548
2010-12-24 21:17:12 +00:00
Daniel Dunbar
7f2bb4dcae
MC/Mach-O/ARM: Start handling some Thumb branches.
...
llvm-svn: 122547
2010-12-24 16:41:46 +00:00
Ted Kremenek
5614c46fcf
Add basic support for pointer arithmetic in
...
SimpleSValBuilder. This clears up some
false positives emitted by ArrayBoundCheckerV2
due to the lack of support for pointer arithmetic.
llvm-svn: 122546
2010-12-24 08:39:33 +00:00
Andrew Trick
5ce945ca3a
Minor cleanup related to my latest scheduler changes.
...
llvm-svn: 122545
2010-12-24 07:10:19 +00:00
Andrew Trick
c94056692a
Fix a few cases where the scheduler is not checking for phys reg copies. The scheduling node may have a NULL DAG node, yuck.
...
llvm-svn: 122544
2010-12-24 06:46:50 +00:00
Argyrios Kyrtzidis
9d6af5328e
Remove the EntoSA directories.
...
llvm-svn: 122543
2010-12-24 06:19:58 +00:00
Jim Grosbach
50986b5d39
Trailing whitespace.
...
llvm-svn: 122542
2010-12-24 05:06:32 +00:00
Andrew Trick
10ffc2b6c2
Various bits of framework needed for precise machine-level selection
...
DAG scheduling during isel. Most new functionality is currently
guarded by -enable-sched-cycles and -enable-sched-hazard.
Added InstrItineraryData::IssueWidth field, currently derived from
ARM itineraries, but could be initialized differently on other targets.
Added ScheduleHazardRecognizer::MaxLookAhead to indicate whether it is
active, and if so how many cycles of state it holds.
Added SchedulingPriorityQueue::HasReadyFilter to allowing gating entry
into the scheduler's available queue.
ScoreboardHazardRecognizer now accesses the ScheduleDAG in order to
get information about it's SUnits, provides RecedeCycle for bottom-up
scheduling, correctly computes scoreboard depth, tracks IssueCount, and
considers potential stall cycles when checking for hazards.
ScheduleDAGRRList now models machine cycles and hazards (under
flags). It tracks MinAvailableCycle, drives the hazard recognizer and
priority queue's ready filter, manages a new PendingQueue, properly
accounts for stall cycles, etc.
llvm-svn: 122541
2010-12-24 05:03:26 +00:00
Chris Lattner
9c47b4ac28
don't use #pragma mark, it isn't portable.
...
llvm-svn: 122540
2010-12-24 04:45:23 +00:00
Andrew Trick
c416ba612b
whitespace
...
llvm-svn: 122539
2010-12-24 04:28:06 +00:00
Michael J. Spencer
38e92f6734
ifndef _MSC_VER out #pragma mark on MSVC. It still tries to parse the text even
...
though it doesn't know what it is, and complains about invalid tokens ;/.
llvm-svn: 122538
2010-12-24 04:07:39 +00:00
Cameron Zwarich
ab434079d3
Simplify a check for implicit defs and remove a FIXME.
...
llvm-svn: 122537
2010-12-24 03:09:36 +00:00
Argyrios Kyrtzidis
338f9aaab2
Handle locations coming from macro instantiations properly in SourceManager::isBeforeInTranslationUnit().
...
Fixes rdar://8790245 and http://llvm.org/PR8821 .
llvm-svn: 122536
2010-12-24 02:53:53 +00:00
John McCall
53fa71476d
Refactor how we collect attributes during parsing, and add slots for attributes
...
on array and function declarators. This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.
llvm-svn: 122535
2010-12-24 02:08:15 +00:00
Douglas Gregor
b4d271ef46
Fix a thinko in a helper routine for template argument deduction that
...
caused an assertion when dealing with non-type template parameter
packs. Add some tests for deduction and instantiation of non-type
template parameter packs.
llvm-svn: 122534
2010-12-24 00:35:52 +00:00
Douglas Gregor
0da4a99ad3
Non-type template parameter packs cannot have default arguments.
...
llvm-svn: 122533
2010-12-24 00:20:52 +00:00
Douglas Gregor
eb5a39deb2
When instantiating a non-type template parameter pack, be sure to
...
extract the appropriate argument from the argument pack (based on the
current substitution index, of course). Simple instantiation of pack
expansions involving non-type template parameter packs now works.
llvm-svn: 122532
2010-12-24 00:15:10 +00:00
Kevin Enderby
fa3c6f148c
In llvm-mc parse a Hash token as a full line comment. Allows handling of
...
preprocessed .s files and matches darwin gas. rdar://8798690
Also fix a comment on the next line of AsmParser.cpp after this new code.
llvm-svn: 122531
2010-12-24 00:12:02 +00:00
Jim Grosbach
ffaea0f017
Use a StringSwitch<> instead of a manually constructed string matcher.
...
llvm-svn: 122530
2010-12-24 00:03:39 +00:00