1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

13411 Commits

Author SHA1 Message Date
Chris Lattner
e2ca13d366 turn on memset idiom recognition by default. Though there are still lots of
limitations, this kicks in dozens of times in the 4 specfp2000 benchmarks, 
and hundreds of times in the int part.  It also kicks in hundreds of times 
in multisource.

This kicks in right before loop deletion, which has the pleasant effect of
deleting loops that *just* do a memset.

llvm-svn: 122664
2011-01-01 20:39:18 +00:00
Daniel Dunbar
9ee74282a6 MC/Mach-O/Thumb: Set the thumb bit in the symbol table.
llvm-svn: 122630
2010-12-29 14:14:06 +00:00
Rafael Espindola
d51ed1fc6a Implement cfi_def_cfa. Also don't convert to dwarf reg numbers twice. Looks
like 6 is a fixed point of that and so the previous tests were OK :-)

llvm-svn: 122614
2010-12-29 01:42:56 +00:00
Rafael Espindola
3fdd045643 Implement .cfi_remember_state and .cfi_restore_state.
llvm-svn: 122602
2010-12-28 18:36:23 +00:00
Duncan Sands
87515f1e57 Clarify that InstructionSimplify only returns values that dominate the
original instruction.

llvm-svn: 122601
2010-12-28 18:01:19 +00:00
Duncan Sands
707bdbd129 Small optimization to speed up replacementPreservesLCSSAForm.
llvm-svn: 122600
2010-12-28 18:00:24 +00:00
Rafael Espindola
c97d642bf7 Relax address updates in the eh_frame section.
llvm-svn: 122591
2010-12-28 05:39:27 +00:00
Rafael Espindola
0552cb0638 Start adding basic support for emitting the call frame instructions.
llvm-svn: 122590
2010-12-28 04:15:37 +00:00
Michael J. Spencer
b604751adb Support/Path: Deprecate Path::hasMagicNumber and replace all uses with fs::has_magic.
llvm-svn: 122589
2010-12-28 01:49:21 +00:00
Michael J. Spencer
6d174b7e25 Fix typo.
llvm-svn: 122588
2010-12-28 01:49:10 +00:00
Michael J. Spencer
018595cf3a Support/PathV2: Implement has_magic.
llvm-svn: 122587
2010-12-28 01:49:01 +00:00
Rafael Espindola
12c30aed07 Add support for .cfi_lsda.
llvm-svn: 122584
2010-12-27 15:56:22 +00:00
Michael J. Spencer
26654048d7 Support/PathV1: Deprecate GetRootDirectory.
llvm-svn: 122580
2010-12-27 03:21:41 +00:00
Rafael Espindola
e7e67fce10 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
30e1ba0fcc BuildLibCalls: Nuke EmitMemCpy, EmitMemMove and EmitMemSet. They are dead and superseded by IRBuilder.
llvm-svn: 122576
2010-12-27 00:25:32 +00:00
Chris Lattner
d4daf9f002 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
a46fd80777 add methods to IRBuilder to create memcpy/memset/memmove.
llvm-svn: 122571
2010-12-26 22:49:25 +00:00
Rafael Espindola
99f1527316 Add basic support for .cfi_personality.
llvm-svn: 122566
2010-12-26 20:20:31 +00:00
Chris Lattner
c56d20aa48 move isBytewiseValue out to ValueTracking.h/cpp
llvm-svn: 122565
2010-12-26 20:15:01 +00:00
Chris Lattner
e210c31646 Start of a pass for recognizing memset and memcpy idioms.
No functionality yet.

llvm-svn: 122562
2010-12-26 19:32:44 +00:00
Chris Lattner
c4cb20b9bf Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils.
llvm-svn: 122554
2010-12-25 20:37:57 +00:00
Michael J. Spencer
b3e50a570f Support/PathV1: Deprecate makeAbsolute and remove Unix impl because it annoys people.
llvm-svn: 122553
2010-12-25 20:10:11 +00:00
Eric Christopher
61974eb1f8 Header warning patrol.
llvm-svn: 122551
2010-12-25 02:38:01 +00:00
Rafael Espindola
b2e09adc62 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
Andrew Trick
dfa31b1cf9 Minor cleanup related to my latest scheduler changes.
llvm-svn: 122545
2010-12-24 07:10:19 +00:00
Andrew Trick
134b2a5907 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
Andrew Trick
53f4556c64 whitespace
llvm-svn: 122539
2010-12-24 04:28:06 +00:00
Chris Lattner
01e8c46349 Flag -> Glue, the ongoing saga
llvm-svn: 122513
2010-12-23 18:28:41 +00:00
Chris Lattner
b607e7deda flags -> glue for selectiondag
llvm-svn: 122509
2010-12-23 17:24:32 +00:00
Chris Lattner
fb9ff7a4ff sdisel flag -> glue.
llvm-svn: 122507
2010-12-23 17:13:18 +00:00
Jeffrey Yasskin
a199652a3e Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.

llvm-svn: 122458
2010-12-23 00:58:24 +00:00
Dan Gohman
db69a33d9f Constify.
llvm-svn: 122447
2010-12-22 22:10:08 +00:00
Rafael Espindola
81ac7c5fad Rename NeedsSetToChangeDiffSize to HasAggressiveSymbolFolding which is a much
better name and matches what is used in the MachO writer.

llvm-svn: 122443
2010-12-22 21:51:29 +00:00
Rafael Espindola
c05eac148d Use references and simplify.
llvm-svn: 122405
2010-12-22 16:11:57 +00:00
Rafael Espindola
3d9afa3c44 Don't relax org or align. They change size as the relaxation happens, but they
are not actually relaxed. For example, a section with only alignments will never
needs relaxation.

llvm-svn: 122356
2010-12-21 20:35:18 +00:00
Daniel Dunbar
1c98bbd915 MC/Mach-O: Shuffle enums a bit to make it harder to inadvertently use the wrong
type.

llvm-svn: 122334
2010-12-21 15:26:45 +00:00
Duncan Sands
6b0ed93a81 Pull a few more simplifications out of instcombine (there are still
plenty left though!), in particular for multiplication.

llvm-svn: 122330
2010-12-21 14:00:22 +00:00
Rafael Espindola
e0e966982a Layout one section until no relaxations are done and then move to the next
section.

This helps because in practice sections form a dag with debug sections pointing
to text sections. Finishing up the text sections first makes the debug section
relaxation trivial.

llvm-svn: 122314
2010-12-21 04:22:09 +00:00
Chris Lattner
65c5243bd6 rename MVT::Flag to MVT::Glue. "Flag" is a terrible name for
something that just glues two nodes together, even if it is
sometimes used for flags.

llvm-svn: 122310
2010-12-21 02:38:05 +00:00
Jakob Stoklund Olesen
86786c46c2 Use IntEqClasses to compute connected components of live intervals.
llvm-svn: 122296
2010-12-21 00:48:17 +00:00
Jakob Stoklund Olesen
26b4e8ec0a Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.
This implementation already exists as ConnectedVNInfoEqClasses in
LiveInterval.cpp, and it seems to be generally useful to have a light-weight way
of forming equivalence classes of small integers.

IntEqClasses doesn't allow enumeration of the elements in a class.

llvm-svn: 122293
2010-12-21 00:04:46 +00:00
Owen Anderson
c1eee5ac49 Revert r122114 (CallbackVH observing use-list changes) because it caused severe slowdowns on the Linux self-host configuration.
llvm-svn: 122279
2010-12-20 22:28:03 +00:00
Bill Wendling
265b7b81b6 This is still used and issuing an annoying warning. Don't deprecate something in
the library unless *all* uses have been converted over to the new form.

llvm-svn: 122267
2010-12-20 21:14:18 +00:00
Duncan Sands
09fbb211eb Add a new convenience pass for testing InstructionSimplify. Previously
it could only be tested indirectly, via instcombine, gvn or some other
pass that makes use of InstructionSimplify, which means that testcases
had to be carefully contrived to dance around any other transformations
that that pass did.

llvm-svn: 122264
2010-12-20 20:54:37 +00:00
Michael J. Spencer
4781534e1c Fix spelling.
llvm-svn: 122244
2010-12-20 13:30:37 +00:00
Duncan Sands
a37d282962 There is no need for isAssociative to take the type as an argument anymore.
llvm-svn: 122242
2010-12-20 13:10:23 +00:00
Duncan Sands
d72bd136f2 Discourage people from using isWeakForLinker when they should be using
mayBeOverridden.

llvm-svn: 122241
2010-12-20 10:57:01 +00:00
Chris Lattner
47b7bc98ae update comment.
llvm-svn: 122212
2010-12-20 00:56:59 +00:00
Nick Lewycky
de10f6132c Use the new way of silencing this warning.
llvm-svn: 122195
2010-12-19 20:57:14 +00:00
Nick Lewycky
c85935836b Add missing standard headers. Patch by Joerg Sonnenberger!
llvm-svn: 122193
2010-12-19 20:43:38 +00:00