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

14033 Commits

Author SHA1 Message Date
Andrew Trick
ffec33601b Reorganize MachineScheduler interfaces and publish them in the header.
The Hexagon target decided to use a lot of functionality from the
target-independent scheduler. That's fine, and other targets should be
able to do the same. This reorg and API update makes that easy.

For the record, ScheduleDAGMI was not meant to be subclassed. Instead,
new scheduling algorithms should be able to implement
MachineSchedStrategy and be done. But if need be, it's nice to be
able to extend ScheduleDAGMI, so I also made that easier. The target
scheduler is somewhat more apt to break that way though.

llvm-svn: 163580
2012-09-11 00:39:15 +00:00
Eric Christopher
5fe521ef3a Revert r160148 it seems to cause more problems than it should
right now. We'll fix PR13303 a different way.

llvm-svn: 163570
2012-09-10 23:34:06 +00:00
Eric Christopher
a327d985db 80-col fixup.
llvm-svn: 163569
2012-09-10 23:34:03 +00:00
Eric Christopher
91aebc4188 80-col fixup.
llvm-svn: 163568
2012-09-10 23:34:00 +00:00
Eric Christopher
c774770535 No reason to construct this twice.
llvm-svn: 163567
2012-09-10 23:33:57 +00:00
Chad Rosier
1b83624c78 [ms-inline asm] Properly emit the asm directives when the AsmPrinterVariant
and InlineAsmVariant don't match.

llvm-svn: 163550
2012-09-10 21:36:05 +00:00
Dmitri Gribenko
1d75adbbb2 Remove redundant semicolons which are null statements.
llvm-svn: 163547
2012-09-10 21:26:47 +00:00
Nadav Rotem
3fc7763c99 Disable stack coloring because it makes dragonegg fail bootstrapping.
llvm-svn: 163545
2012-09-10 21:17:58 +00:00
Chad Rosier
054e489dd3 [ms-inline asm] Pass the correct AsmVariant to the PrintAsmOperand() function
and update the printOperand() function accordingly.

llvm-svn: 163544
2012-09-10 21:10:49 +00:00
Nadav Rotem
bc8f2b49c9 Enable stack coloring.
llvm-svn: 163539
2012-09-10 20:15:49 +00:00
Nadav Rotem
cab746695d Stack Coloring: Handle the case where END markers come before BEGIN markers properly.
llvm-svn: 163530
2012-09-10 18:51:09 +00:00
Michael Ilseman
d331ea92fa Fold multiply by 0 or 1 when in UnsafeFPMath mode in SelectionDAG::getNode().
This folding happens as early as possible for performance reasons, and to make sure it isn't foiled by other transforms (e.g. forming FMAs).

llvm-svn: 163519
2012-09-10 17:00:37 +00:00
Michael Ilseman
eb6c004862 whitespace
llvm-svn: 163518
2012-09-10 16:56:31 +00:00
James Molloy
fe38f1d2b0 Fix an assertion failure when optimising a shufflevector incorrectly into concat_vectors, and a followup bug with SelectionDAG::getNode() creating nodes with invalid types.
llvm-svn: 163511
2012-09-10 14:01:21 +00:00
Nadav Rotem
a271aaded5 Minor cleanup. No functional change.
llvm-svn: 163510
2012-09-10 13:20:00 +00:00
Nadav Rotem
cb9794b1c7 Stack Coloring: Debug prints to print the slot number and not the array index.
llvm-svn: 163509
2012-09-10 13:17:58 +00:00
Nadav Rotem
42f7a4f93a Stack Coloring: When searching for disjoint regions, do not compare intervals twice or to theirself.
llvm-svn: 163508
2012-09-10 12:47:38 +00:00
Nadav Rotem
d5b75d5eec Stack Coloring: Add support for multiple regions of the same slot, within a single basic block.
llvm-svn: 163507
2012-09-10 12:39:35 +00:00
Nadav Rotem
edd576d454 Fix a typo in the comment.
llvm-svn: 163496
2012-09-10 08:51:46 +00:00
Nadav Rotem
917505e474 Add an assertion that the frame index is indeed inside the declared lifetime region.
llvm-svn: 163495
2012-09-10 08:44:15 +00:00
Nadav Rotem
8442a2ec90 Teach the DAGBuilder about lifetime markers which are generated from PHINodes.
llvm-svn: 163494
2012-09-10 08:43:23 +00:00
Craig Topper
fb97f05d3c Teach DAG combiner to constant fold fneg of a BUILD_VECTOR of constants.
llvm-svn: 163483
2012-09-09 22:58:45 +00:00
Benjamin Kramer
957f1f617e LiveVariables: Compute a set of defs and kills to speed up updating LV during critical edge splitting.
Previously we checked if the register is def'd in a block via the def/use list a
nd walked the list of kills to check if the register is killed in a block. Both
of these checks can be made much cheaper by walking the block first and
recording all defs and kills.

This reduces the compile time of the test case from PR13651 from 40s to 15s at
-O2. The compile time is still dominated by LV updating but now the main culprit
is SparseBitVector's slowness.

llvm-svn: 163478
2012-09-09 11:56:14 +00:00
Benjamin Kramer
f7e00de5d0 Fix alignment of .comm and .lcomm on mingw32.
For some reason .lcomm uses byte alignment and .comm log2 alignment so we can't
use the same setting for both. Fix this by reintroducing the LCOMM enum.
I verified this against mingw's gcc.

llvm-svn: 163420
2012-09-07 21:08:01 +00:00
Chad Rosier
678022a15d Fix indent.
llvm-svn: 163416
2012-09-07 20:23:29 +00:00
Chad Rosier
35af7f9a20 Update function names to conform to guidelines. No functional change intended.
llvm-svn: 163401
2012-09-07 18:16:38 +00:00
Benjamin Kramer
f7fdee3ce3 MC: Overhaul handling of .lcomm
- Darwin lied about not supporting .lcomm and turned it into zerofill in the
  asm parser. Push the zerofill-conversion down into macho-specific code.
- This makes the tri-state LCOMMType enum superfluous, there are no targets
  without .lcomm.
- Do proper error reporting when trying to use .lcomm with alignment on a target
  that doesn't support it.
- .comm and .lcomm alignment was parsed in bytes on COFF, should be power of 2.
- Fixes PR13755 (.lcomm crashes on ELF).

llvm-svn: 163395
2012-09-07 17:25:13 +00:00
Michael Liao
54009dd489 Stop emitting lifetime region info when stack coloring is not enabled in O0
- this should fix PR13780

llvm-svn: 163370
2012-09-07 05:13:00 +00:00
Manman Ren
b9d2a6fa2e Release build: guard dump functions with "ifndef NDEBUG"
No functional change.

llvm-svn: 163339
2012-09-06 19:06:06 +00:00
Jakob Stoklund Olesen
c89c722370 Allow overlaps between virtreg and physreg live ranges.
The RegisterCoalescer understands overlapping live ranges where one
register is defined as a copy of the other. With this change, register
allocators using LiveRegMatrix can do the same, at least for copies
between physical and virtual registers.

When a physreg is defined by a copy from a virtreg, allow those live
ranges to overlap:

  %CL<def> = COPY %vreg11:sub_8bit; GR32_ABCD:%vreg11
  %vreg13<def,tied1> = SAR32rCL %vreg13<tied0>, %CL<imp-use,kill>

We can assign %vreg11 to %ECX, overlapping the live range of %CL.

llvm-svn: 163336
2012-09-06 18:15:23 +00:00
Jakob Stoklund Olesen
ed026d044a Handle overlapping regunit intervals in LiveIntervals::addKillFlags().
We will soon allow virtual register live ranges to overlap regunit live
ranges when the physreg is defined as a copy of the virtreg:

  %EAX = COPY %vreg5
  FOO %vreg5
  BAR %EAX<kill>

There is no real interference since %vreg5 and %EAX have the same value
where they overlap.

This patch prevents addKillFlags from adding virtreg kill flags to FOO
where the assigned physreg is overlapping the virtual register live
range.

llvm-svn: 163335
2012-09-06 18:15:18 +00:00
Jakob Stoklund Olesen
431cbf8e2a Clear kill flags while computing live ranges.
Kill flags are difficult to maintain, and liveness queries are better
handled by live intervals.

Kill flags are reinserted after register allocation by addKillFlags().

llvm-svn: 163334
2012-09-06 18:15:15 +00:00
Roman Divacky
be07a8a840 Dont cast away const needlessly. Found by gcc48 -Wcast-qual.
llvm-svn: 163324
2012-09-06 15:42:13 +00:00
Nadav Rotem
8f64175704 Disable stack coloring by default in order to resolve the i386 failures.
llvm-svn: 163316
2012-09-06 14:27:06 +00:00
Nadav Rotem
196b00bd57 Fix a few old-GCC warnings. No functional change.
llvm-svn: 163309
2012-09-06 11:13:55 +00:00
Nadav Rotem
f25e382cd2 Add a new optimization pass: Stack Coloring, that merges disjoint static allocations (allocas). Allocas are known to be
disjoint if they are marked by disjoint lifetime markers (@llvm.lifetime.XXX intrinsics).

llvm-svn: 163299
2012-09-06 09:17:37 +00:00
Chad Rosier
e37b2608d9 [ms-inline asm] Use the asm dialect from the MI to set the parser dialect.
llvm-svn: 163273
2012-09-05 23:57:37 +00:00
Chad Rosier
53ddf04a70 Cleanup a few magic numbers.
llvm-svn: 163263
2012-09-05 22:40:13 +00:00
Roman Divacky
85348270cd Stop casting away const qualifier needlessly.
llvm-svn: 163258
2012-09-05 22:26:57 +00:00
Chad Rosier
5d0b8f95cc [ms-inline asm] We only need one bit to represent the AsmDialect in the
MachineInstr.

llvm-svn: 163257
2012-09-05 22:17:43 +00:00
Roman Divacky
a6678a5602 Constify this properly. Found by gcc48 -Wcast-qual.
llvm-svn: 163256
2012-09-05 22:15:49 +00:00
Roman Divacky
4906050a4d Constify SDNodeIterator an stop its only non-const user being cast stripped
of its constness. Found by gcc48 -Wcast-qual.

llvm-svn: 163254
2012-09-05 22:03:34 +00:00
Chad Rosier
f7a06e33a3 [ms-inline asm] Propagate the asm dialect into the MachineInstr representation.
llvm-svn: 163243
2012-09-05 21:00:58 +00:00
Roman Divacky
4c161d6fab Remove unused typedefs gcc4.8 warns about.
llvm-svn: 163225
2012-09-05 17:55:46 +00:00
Silviu Baranga
6f46bb1705 Fixed the DAG combiner to better handle the folding of AND nodes for vector types. The previous code was making the assumption that the length of the bitmask returned by isConstantSplat was equal to the size of the vector type. Now we first make sure that the splat value has at least the length of the vector lane type, then we only use as many fields as we have available in the splat value.
llvm-svn: 163203
2012-09-05 08:57:21 +00:00
Logan Chien
d6babb951e Reorder the comments of EmitExceptionTable.
llvm-svn: 163194
2012-09-05 06:28:26 +00:00
Craig Topper
6274d26545 Convert vextracti128/vextractf128 intrinsics to extract_subvector at DAG build time. Similar was previously done for vinserti128/vinsertf128. Add patterns for folding these extract_subvectors with stores.
llvm-svn: 163192
2012-09-05 05:48:09 +00:00
Jakob Stoklund Olesen
2cda807309 Search the whole instruction for tied operands.
Implicit uses can be dynamically tied to defs. This will soon be used
for predicated instructions on ARM.

llvm-svn: 163177
2012-09-04 22:59:30 +00:00
Jakob Stoklund Olesen
50ac7b577c Typo.
llvm-svn: 163154
2012-09-04 18:44:43 +00:00
Jakob Stoklund Olesen
a017c9c48b Actually use the MachineOperand field for isRegTiedToDefOperand().
The MachineOperand::TiedTo field was maintained, but not used.

This patch enables it in isRegTiedToDefOperand() and
isRegTiedToUseOperand() which are the actual functions use by the
register allocator.

llvm-svn: 163153
2012-09-04 18:43:25 +00:00