1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

13270 Commits

Author SHA1 Message Date
Bill Wendling
d3389949ad s/SjLjEHPass/SjLjEHPrepare/
No functionality change.

llvm-svn: 152658
2012-03-13 20:04:21 +00:00
Bill Wendling
c5e906092b Add a return type.
llvm-svn: 152614
2012-03-13 05:52:28 +00:00
Bill Wendling
a77901b3ba Inline the d'tor and add an anchor instead.
llvm-svn: 152613
2012-03-13 05:51:56 +00:00
Bill Wendling
2cbe0fc313 Refactor the SelectionDAG's 'dump' methods into their own .cpp file.
No functionality change.

llvm-svn: 152611
2012-03-13 05:47:27 +00:00
Lang Hames
19d04fbc96 Fixed typo in comment.
llvm-svn: 152610
2012-03-13 05:43:30 +00:00
Bill Wendling
c2b6b0d28b Revert due to nightly test failures.
--- Reverse-merging r152486 into '.':
U    lib/CodeGen/SjLjEHPrepare.cpp

llvm-svn: 152571
2012-03-12 20:19:41 +00:00
Benjamin Kramer
c798b7be6d DwarfDebug: Store the filename/dirname pair as a zero-separated string in a stringmap, instead of using a highly inefficient std::map of a pair of std::strings.
llvm-svn: 152541
2012-03-11 14:56:26 +00:00
Stepan Dyatkovskiy
72fdcabd4d llvm::SwitchInst
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.

llvm-svn: 152532
2012-03-11 06:09:17 +00:00
Benjamin Kramer
534acfa94f Microoptimize getVRegDef. def_begin isn't free, don't compute it twice.
llvm-svn: 152492
2012-03-10 12:50:44 +00:00
Bill Wendling
1e68fbcdae Implement a more intelligent way of spilling uses across an invoke boundary.
The old way of determine when and where to spill a value that was used inside of
a landing pad resulted in spilling that value everywhere and not just at the
invoke edge.

This algorithm determines which values are used within a landing pad. It then
spills those values before the invoke and reloads them before the uses. This
should prevent excessive spilling in many cases, e.g. inside of loops.
<rdar://problem/10609139>

llvm-svn: 152486
2012-03-10 07:11:55 +00:00
Jakob Stoklund Olesen
ee9a75c67f Report the defining instruction.
llvm-svn: 152460
2012-03-10 00:44:11 +00:00
Jakob Stoklund Olesen
5c3128acf6 Add SSA verification to MachineVerifier.
Somehow we never verified SSA dominance before.

llvm-svn: 152458
2012-03-10 00:36:06 +00:00
Jakob Stoklund Olesen
5c58e991c5 Use SmallPtrSet instead of DenseSet.
llvm-svn: 152457
2012-03-10 00:36:04 +00:00
Benjamin Kramer
d2881e4edc Give dagcombiner's worklist some inline capacity.
llvm-svn: 152454
2012-03-10 00:23:58 +00:00
Jakob Stoklund Olesen
b89fca5c5a Assert on SSA errors in LiveVariables.
All uses of a virtual register must be dominated by its def.

llvm-svn: 152449
2012-03-09 23:41:44 +00:00
Andrew Trick
d1d69201aa misched: handle scheduler that insert instructions at empty region boundaries.
And add comments, since this is obviously confusing.

llvm-svn: 152445
2012-03-09 22:34:56 +00:00
Andrew Trick
3e325de8e9 misched: handle scheduling region boundaries nicely.
llvm-svn: 152393
2012-03-09 08:02:51 +00:00
Andrew Trick
96816e59a6 misched interface: rename Begin/End to RegionBegin/RegionEnd since they are not private.
llvm-svn: 152382
2012-03-09 04:29:02 +00:00
Andrew Trick
ddb78e11ee misched comments
llvm-svn: 152374
2012-03-09 03:46:42 +00:00
Andrew Trick
f53b511937 revert 152356: verify misched changes using -misched=shuffle.
llvm-svn: 152373
2012-03-09 03:46:39 +00:00
Andrew Trick
71ba4d00f2 misched: allow the default scheduler to be one chosen by the target.
llvm-svn: 152360
2012-03-09 00:52:20 +00:00
Evan Cheng
6e3b9b3d5c Cache MBB->begin. It's possible the scheduler / bundler may change MBB->begin().
llvm-svn: 152356
2012-03-09 00:24:29 +00:00
Craig Topper
79f1e75059 Use uint16_t to store instruction implicit uses and defs. Reduces static data.
llvm-svn: 152301
2012-03-08 08:22:45 +00:00
Stepan Dyatkovskiy
79f3dd93b7 Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
  BasicBlock *BB = i.getCaseSuccessor();
  ConstantInt *V = i.getCaseValue();
  // Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.

llvm-svn: 152297
2012-03-08 07:06:20 +00:00
Andrew Trick
65153639f8 misched interface: Expose the MachineScheduler pass.
Allow targets to provide their own schedulers (subclass of
ScheduleDAGInstrs) to the misched pass. Select schedulers using
-misched=...

llvm-svn: 152278
2012-03-08 01:41:12 +00:00
Andrew Trick
cbd96ef2f2 Cleanup VLIWPacketizer to use the updated ScheduleDAGInstrs interface.
llvm-svn: 152262
2012-03-07 23:01:09 +00:00
Andrew Trick
d16430c664 misched prep: Expose the ScheduleDAGInstrs interface so targets may
implement their own MachineScheduler.

llvm-svn: 152261
2012-03-07 23:01:06 +00:00
Andrew Trick
80aaf38e4e misched prep: Remove LLVM_LIBRARY_VISIBILITY from ScheduleDAGInstrs.
llvm-svn: 152260
2012-03-07 23:01:02 +00:00
Andrew Trick
5ab2b8a031 misched prep: Comment the ScheduleDAGInstrs interface.
llvm-svn: 152259
2012-03-07 23:00:59 +00:00
Andrew Trick
df0a76e646 misched prep: Cleanup ScheduleDAGInstrs interface.
ScheduleDAGInstrs will be the main interface for MI-level
schedulers. Make sure it's readable: one page of protected fields, one
page of public methids.

llvm-svn: 152258
2012-03-07 23:00:57 +00:00
Andrew Trick
8608f03241 misched prep: remove extra "protected"
llvm-svn: 152257
2012-03-07 23:00:54 +00:00
Andrew Trick
40eae1a830 misched prep: rename InsertPos to End.
ScheduleDAGInstrs knows nothing about how instructions will be moved or inserted.

llvm-svn: 152256
2012-03-07 23:00:52 +00:00
Andrew Trick
2b0038db94 misched preparation: rename core scheduler methods for consistency.
We had half the API with one convention, half with another. Now was a
good time to clean it up.

llvm-svn: 152255
2012-03-07 23:00:49 +00:00
Chandler Carruth
5cfce10358 Try to clarify this comment some.
llvm-svn: 152221
2012-03-07 10:13:40 +00:00
Chandler Carruth
2ac287af28 Remove another outbreak of customized (and completely broken) hashing.
This one is particularly annoying because the hashing algorithm is
highly specialized, with a strange "equivalence" definition that subsets
the fields involved.

Still, this looks at the exact same set of data as the old code, but
without bitwise or-ing over parts of it and other mixing badness. No
functionality changed here. I've left a substantial fixme about the fact
that there is a cleaner and more principled way to do this, but it
requires making the equality definition actual stable for particular
types...

llvm-svn: 152218
2012-03-07 09:39:46 +00:00
Bill Wendling
828a0d7638 Where the BranchFolding pass removes a branch then adds another better branch,
the DebugLoc information can be maintained throughout by grabbing the DebugLoc
before the RemoveBranch and then passing the result to the InsertBranch.
Patch by Andrew Stanford-Jason!

llvm-svn: 152212
2012-03-07 08:49:42 +00:00
Andrew Trick
47489a0a3d Fix cmake
llvm-svn: 152210
2012-03-07 05:46:04 +00:00
Andrew Trick
d7a7509ea0 comment
llvm-svn: 152209
2012-03-07 05:21:54 +00:00
Andrew Trick
b76bc2eacb misched preparation: clarify ScheduleDAG and ScheduleDAGInstrs roles.
ScheduleDAG is responsible for the DAG: SUnits and SDeps. It provides target hooks for latency computation.

ScheduleDAGInstrs extends ScheduleDAG and defines the current scheduling region in terms of MachineInstr iterators. It has access to the target's scheduling itinerary data. ScheduleDAGInstrs provides the logic for building the ScheduleDAG for the sequence of MachineInstrs in the current region. Target's can implement highly custom schedulers by extending this class.

ScheduleDAGPostRATDList provides the driver and diagnostics for current postRA scheduling. It maintains a current Sequence of scheduled machine instructions and logic for splicing them into the block. During scheduling, it uses the ScheduleHazardRecognizer provided by the target.

Specific changes:
- Removed driver code from ScheduleDAG. clearDAG is the only interface needed.

- Added enterRegion/exitRegion hooks to ScheduleDAGInstrs to delimit the scope of each scheduling region and associated DAG. They should be used to setup and cleanup any region-specific state in addition to the DAG itself. This is necessary because we reuse the same ScheduleDAG object for the entire function. The target may extend these hooks to do things at regions boundaries, like bundle terminators. The hooks are called even if we decide not to schedule the region. So all instructions in a block are "covered" by these calls.

- Added ScheduleDAGInstrs::begin()/end() public API.

- Moved Sequence into the driver layer, which is specific to the scheduling algorithm.

llvm-svn: 152208
2012-03-07 05:21:52 +00:00
Andrew Trick
0df67ea935 ScheduleDAGInstrs comments
llvm-svn: 152207
2012-03-07 05:21:47 +00:00
Andrew Trick
9dcbf0e144 misched preparation: modularize schedule emission.
ScheduleDAG has nothing to do with how the instructions are scheduled.

llvm-svn: 152206
2012-03-07 05:21:44 +00:00
Andrew Trick
794bad1f46 misched preparation: modularize schedule printing.
ScheduleDAG will not refer to the scheduled instruction sequence.

llvm-svn: 152205
2012-03-07 05:21:40 +00:00
Andrew Trick
c3b53855a2 misched preparation: modularize schedule verification.
ScheduleDAG will not refer to the scheduled instruction sequence.

llvm-svn: 152204
2012-03-07 05:21:36 +00:00
Andrew Trick
074325d509 whitespace
llvm-svn: 152203
2012-03-07 05:21:32 +00:00
Andrew Trick
b400cf42a4 Added -view-misched=dags options.
llvm-svn: 152178
2012-03-07 00:18:25 +00:00
Andrew Trick
8474910b42 Cleanup in preparation for misched: Move DAG visualization logic.
Soon, ScheduleDAG will not refer to the BB.

llvm-svn: 152177
2012-03-07 00:18:22 +00:00
Andrew Trick
d35b75a36c Added MachineBasicBlock::getFullName() to standardize/factor codegen diagnostics.
llvm-svn: 152176
2012-03-07 00:18:18 +00:00
Andrew Trick
e06a3f8642 whitespace
llvm-svn: 152175
2012-03-07 00:18:15 +00:00
Andrew Trick
1fb15f4f48 Cleanup: DAG building is specific to either SD or MI scheduling. Not part of the target interface.
llvm-svn: 152174
2012-03-07 00:18:12 +00:00
Andrew Trick
80ff2f2d36 misched comments
llvm-svn: 152173
2012-03-07 00:18:08 +00:00