Commit Graph

98333 Commits

Author SHA1 Message Date
Andrew Trick
6606ef0e98 MI-Sched: Model "reserved" processor resources.
This allows a target to use MI-Sched as an in-order scheduler that
will model strict resource conflicts without defining a processor
itinerary. Instead, the target can now use the new per-operand machine
model and define in-order resources with BufferSize=0. For example,
this would allow restricting the type of operations that can be formed
into a dispatch group. (Normally NumMicroOps is sufficient to enforce
dispatch groups).

If the intent is to model latency in in-order pipeline, as opposed to
resource conflicts, then a resource with BufferSize=1 should be
defined instead.

This feature is only casually tested as there are no in-tree targets
using it yet. However, Hal will be experimenting with POWER7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 17:56:02 +00:00
Andrew Trick
573931394f MI-Sched: handle latency of in-order operations with the new machine model.
The per-operand machine model allows the target to define "unbuffered"
processor resources. This change is a quick, cheap way to model stalls
caused by the latency of operations that use such resources. This only
applies when the processor's micro-op buffer size is non-zero
(Out-of-Order). We can't precisely model in-order stalls during
out-of-order execution, but this is an easy and effective
heuristic. It benefits cortex-a9 scheduling when using the new
machine model, which is not yet on by default.

MI-Sched for armv7 was evaluated on Swift (and only not enabled because
of a performance bug related to predication). However, we never
evaluated Cortex-A9 performance on MI-Sched in its current form. This
change adds MI-Sched functionality to reach performance goals on
A9. The only remaining change is to allow MI-Sched to run as a PostRA
pass.

I evaluated performance using a set of options to estimate the performance impact once MI sched is default on armv7:
-mcpu=cortex-a9 -disable-post-ra -misched-bench -scheditins=false

For a simple saxpy loop I see a 1.7x speedup. Here are the llvm-testsuite results:
(min run time over 2 runs, filtering tiny changes)

Speedups:
| Benchmarks/BenchmarkGame/recursive         |  52.39% |
| Benchmarks/VersaBench/beamformer           |  20.80% |
| Benchmarks/Misc/pi                         |  19.97% |
| Benchmarks/Misc/mandel-2                   |  19.95% |
| SPEC/CFP2000/188.ammp                      |  18.72% |
| Benchmarks/McCat/08-main/main              |  18.58% |
| Benchmarks/Misc-C++/Large/sphereflake      |  18.46% |
| Benchmarks/Olden/power                     |  17.11% |
| Benchmarks/Misc-C++/mandel-text            |  16.47% |
| Benchmarks/Misc/oourafft                   |  15.94% |
| Benchmarks/Misc/flops-7                    |  14.99% |
| Benchmarks/FreeBench/distray               |  14.26% |
| SPEC/CFP2006/470.lbm                       |  14.00% |
| mediabench/mpeg2/mpeg2dec/mpeg2decode      |  12.28% |
| Benchmarks/SmallPT/smallpt                 |  10.36% |
| Benchmarks/Misc-C++/Large/ray              |   8.97% |
| Benchmarks/Misc/fp-convert                 |   8.75% |
| Benchmarks/Olden/perimeter                 |   7.10% |
| Benchmarks/Bullet/bullet                   |   7.03% |
| Benchmarks/Misc/mandel                     |   6.75% |
| Benchmarks/Olden/voronoi                   |   6.26% |
| Benchmarks/Misc/flops-8                    |   5.77% |
| Benchmarks/Misc/matmul_f64_4x4             |   5.19% |
| Benchmarks/MiBench/security-rijndael       |   5.15% |
| Benchmarks/Misc/flops-6                    |   5.10% |
| Benchmarks/Olden/tsp                       |   4.46% |
| Benchmarks/MiBench/consumer-lame           |   4.28% |
| Benchmarks/Misc/flops-5                    |   4.27% |
| Benchmarks/mafft/pairlocalalign            |   4.19% |
| Benchmarks/Misc/himenobmtxpa               |   4.07% |
| Benchmarks/Misc/lowercase                  |   4.06% |
| SPEC/CFP2006/433.milc                      |   3.99% |
| Benchmarks/tramp3d-v4                      |   3.79% |
| Benchmarks/FreeBench/pifft                 |   3.66% |
| Benchmarks/Ptrdist/ks                      |   3.21% |
| Benchmarks/Adobe-C++/loop_unroll           |   3.12% |
| SPEC/CINT2000/175.vpr                      |   3.12% |
| Benchmarks/nbench                          |   2.98% |
| SPEC/CFP2000/183.equake                    |   2.91% |
| Benchmarks/Misc/perlin                     |   2.85% |
| Benchmarks/Misc/flops-1                    |   2.82% |
| Benchmarks/Misc-C++-EH/spirit              |   2.80% |
| Benchmarks/Misc/flops-2                    |   2.77% |
| Benchmarks/NPB-serial/is                   |   2.42% |
| Benchmarks/ASC_Sequoia/CrystalMk           |   2.33% |
| Benchmarks/BenchmarkGame/n-body            |   2.28% |
| Benchmarks/SciMark2-C/scimark2             |   2.27% |
| Benchmarks/Olden/bh                        |   2.03% |
| skidmarks10/skidmarks                      |   1.81% |
| Benchmarks/Misc/flops                      |   1.72% |

Slowdowns:
| Benchmarks/llubenchmark/llu                | -14.14% |
| Benchmarks/Polybench/stencils/seidel-2d    |  -5.67% |
| Benchmarks/Adobe-C++/functionobjects       |  -5.25% |
| Benchmarks/Misc-C++/oopack_v1p8            |  -5.00% |
| Benchmarks/Shootout/hash                   |  -2.35% |
| Benchmarks/Prolangs-C++/ocean              |  -2.01% |
| Benchmarks/Polybench/medley/floyd-warshall |  -1.98% |
| Polybench/linear-algebra/kernels/3mm       |  -1.95% |
| Benchmarks/McCat/09-vor/vor                |  -1.68% |

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196516 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 17:55:58 +00:00
Andrew Trick
bdbcb4dfbc Machine model comments. Explain a ProcessorUnit's BufferSize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196515 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 17:55:53 +00:00
Andrew Trick
c9fc1e7de9 Fix the A9 machine model. VTRN writes two registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196514 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 17:55:49 +00:00
Andrew Trick
0591e2a415 comment typo and reformat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 17:55:47 +00:00
Rafael Espindola
6b11950e39 Add a default constructor to get deterministic behavior.
Should fix the msan and valgrind bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196509 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 16:21:17 +00:00
Arnold Schwaighofer
9e0807cb61 SLPVectorizer: An in-tree vectorized entry cannot also be a scalar external use
We were creating external uses for scalar values in MustGather entries that also
had a ScalarToTreeEntry (they also are present in a vectorized tuple). This
meant we would keep a value 'alive' as a scalar and vectorized causing havoc.
This is not necessary because when we create a MustGather vector we explicitly
create external uses entries for the insertelement instructions of the
MustGather vector elements.

Fixes PR18129.

radar://15582184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 15:14:40 +00:00
Kostya Serebryany
64abf5b441 [tsan] fix PR18146: sometimes a variable written into vptr could have an integer type (after other optimizations)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196507 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 15:03:02 +00:00
Justin Holewinski
7add5421a6 [NVPTX] Fix off-by-one error when creating the VT list for an SDNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196503 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 12:58:00 +00:00
Alexey Samsonov
4012c30ef7 Add forgotten header guards
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196500 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 12:52:32 +00:00
Matheus Almeida
bc7114feab [mips] Small code generation improvement for conditional operator (select)
in case the operands are constants and its difference is |1|.
It should be possible in those cases to rematerialize the result using
MIPS's slt and similar instructions.

The small update to some of the tests in cmov.ll, sel1c.ll and sel2c.ll was needed
otherwise the optimization implemented in this patch would have been triggered
(difference between the operands was 1) and that would have changed the semantic
of the tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 12:07:05 +00:00
Matheus Almeida
00877e733f [mips] Add some comments related to the optimization performed in performSELECTCombine.
The structure of the code was slightly modified so that the next patch is easier to read/review.

No functional changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196496 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 11:56:56 +00:00
Matheus Almeida
4faa2b38fb [mips][msa] Fix issue with immediate fields of LD/ST instructions
not being correctly encoded/decoded.
In more detail, immediate fields of LD/ST instructions should be
divided/multiplied by the size of the data format before encoding and
after decoding, respectively.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196494 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 11:06:22 +00:00
Tim Northover
52123d1842 ARM: fix yet another stack-folding bug
We were trying to fold the stack adjustment into the wrong instruction in the
situation where the entire basic-block was epilogue code. Really, it can only
ever be valid to do the folding precisely where the "add sp, ..." would be
placed so there's no need for a separate iterator to track that.

Should fix PR18136.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196493 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 11:02:02 +00:00
David Blaikie
0d668218e7 DwarfDebug/DwarfUnit: Push abbreviation structures down into DwarfUnits to reduce duplication
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196479 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 07:43:55 +00:00
Matt Arsenault
714ce8ae3e Use isIntrinsic() instead of checking for "llvm."
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196473 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 06:05:43 +00:00
Rafael Espindola
fac7a9e644 Remove the isImplicitlyPrivate argument of getNameWithPrefix.
getSymbolWithGlobalValueBase use is to create a name of a new symbol based
on the name of an existing GV. Assert that and then remove the last call
to pass true to isImplicitlyPrivate.

This gives the mangler API a 1:1 mapping from GV to names, which is what we
need to drop the mangler dependency on the target (and use an extended
datalayout instead).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:53:12 +00:00
Alp Toker
087ab613f4 Correct word hyphenations
This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities and contractions in nearby lines.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196471 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:44:44 +00:00
Rafael Espindola
9155b17815 Hide the stub created for MO_ExternalSymbol too.
given

declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1)
declare void @foo()
define void @bar() {
  call void @foo()
  call void @llvm.memset.p0i8.i32(i8* null, i8 0, i32 188, i32 1, i1 false)
  ret void
}

We used to produce

L_foo$stub:
        .indirect_symbol        _foo
        .ascii  "\364\364\364\364\364"

_memset$stub:
        .indirect_symbol        _memset
        .ascii  "\364\364\364\364\364"

We not produce a private stub for memset too.

Stubs are not needed with recent linkers, but we still produce them for darwin8.

Thanks to David Fang for confirming that gcc used to do this too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:19:12 +00:00
Matt Arsenault
87234703e8 R600/SI: Add comments for number of used registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196467 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 05:15:35 +00:00
Rafael Espindola
ba2a226fab Try harder to get a consistent floating point results.
This just extends the existing hack. It should be enough to get a reproducible bootstrap
on 32 bits.

I will open a bug to track getting a real fix for this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196462 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 04:14:33 +00:00
NAKAMURA Takumi
688aa71e35 Move llvm/test/MC/ELF/thumb-st_other.s to test/MC/ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 02:21:44 +00:00
Jiangning Liu
4fd58529ab For AArch64, add missing register cost calculation for big value types like v4i64 and v8i64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196456 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 02:12:01 +00:00
Cameron McInally
f6770bcee8 Add FileCheck statements for r196435.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:20:36 +00:00
Reid Kleckner
e5218051d4 Compiler.h: Disable initializer list usage with clang-cl
Most people are using MSVC 2012, which lacks the <initializer_list>
header.  MSVC 2013 shipped with that header, but it has not yet been
tested.  If clang works with the 2013 header, then we can enable this by
checking the value of _MSC_VER.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:03:23 +00:00
Will Dietz
7437feefbb Export symbols in tools that support loading plugins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:01:58 +00:00
David Blaikie
7afb463a65 DwarfDebug: Avoid unnecessary abbreviation lookup when emitting DIEs
DIEs already contain references directly to their DIEAbbrev, use that
instead of looking it up based on index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196446 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:01:41 +00:00
David Blaikie
acf6571d80 DwarfDebug: Remove trivial function wrapper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196445 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:01:37 +00:00
Eric Christopher
98f52fa8d0 Make these two tests resilient in the face of compile unit size
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 01:00:12 +00:00
Eric Christopher
9e568665ac 80-column.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196442 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:36:21 +00:00
Eric Christopher
7eca7002f2 Remove special handling for DW_AT_ranges support by constructing the
values with the correct behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:36:17 +00:00
Logan Chien
175fe68393 [mc] Fix ELF st_other flag.
ELF_Other_Weakref and ELF_Other_ThumbFunc seems to be LLVM
internal ELF symbol flags.  These should not be emitted to
object file.

This commit defines ELF_STO_Shift for the target-defined
flags for st_other, and increase the value of
ELF_Other_Shift to 16.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196440 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:34:11 +00:00
Michael Ilseman
faf4d59137 Use present fast-math flags when applicable in CreateBinOp
We were previously not adding fast-math flags through CreateBinOp()
when it happened to be making a floating point binary operator. This
patch updates it to do so similarly to directly calling CreateF*().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:32:09 +00:00
Eric Christopher
e4b236cf59 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:13:15 +00:00
Cameron McInally
6c8faddaf5 Add AVX512 patterns for v16i32 broadcast and v2i64 zero extend load.
Patch by Aleksey Bader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-05 00:11:25 +00:00
Eric Christopher
1cf9e7ff96 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:55:09 +00:00
David Blaikie
81a14a80f3 DwarfUnit: Correct comment by generalizing over all units, not just compilation units.
Code review feedback on r196394 by Paul Robinson.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196433 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:39:02 +00:00
Kevin Enderby
f50f3a3bb9 Fix a bug in darwin's 32-bit X86 handling of evaluating fixups.
Where it would use a scattered relocation entry but falls back to a
normal relocation entry because the FixupOffset is more than 24-bits.

The bug is in the X86MachObjectWriter::RecordScatteredRelocation() where
it changes reference parameter FixedValue but then returns false to indicate
it did not create a scattered relocation entry.  The fix is simply to save the
original value of the parameter FixedValue at the start of the method and
restore it if we are returning false in that case.

rdar://15526046


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:36:24 +00:00
Eric Christopher
3f8689f8af Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196431 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:24:38 +00:00
Eric Christopher
e28204ea0a Update comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:24:28 +00:00
Eric Christopher
881c0bb5a3 Remove incorrect comment and pointless cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 23:05:21 +00:00
Eric Christopher
dda6f1fb00 const on its own line is confusing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196426 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:54:45 +00:00
David Peixotto
0fc8c68b11 Add support for parsing ARM symbol variants on ELF targets
ARM symbol variants are written with parens instead of @ like this:

  .word __GLOBAL_I_a(target1)

This commit adds support for parsing these symbol variants in
expressions. We introduce a new flag to MCAsmInfo that indicates the
parser should use parens to parse the symbol variant. The expression
parser is modified to look for symbol variants using parens instead
of @ when the corresponding MCAsmInfo flag is true.

The MCAsmInfo parens flag is enabled only for ARM on ELF.

By adding this flag to MCAsmInfo, we are able to get rid of
redundant ARM-specific symbol variants and use the generic variants
instead (e.g. VK_GOT instead of VK_ARM_GOT). We use the new
UseParensForSymbolVariant attribute in MCAsmInfo to correctly print
the symbol variants for arm.

To achive this we need to keep a handle to the MCAsmInfo in the
MCSymbolRefExpr class that we can check when printing the symbol
variant.

Updated Tests:
  Changed case of symbol variant to match the generic kind.
  test/CodeGen/ARM/tls-models.ll
  test/CodeGen/ARM/tls1.ll
  test/CodeGen/ARM/tls2.ll
  test/CodeGen/Thumb2/tls1.ll
  test/CodeGen/Thumb2/tls2.ll

PR18080


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196424 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:43:20 +00:00
Eric Christopher
6b2011a4a3 Simplify check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196422 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:29:02 +00:00
Eric Christopher
690a455b0a Reformat slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:26:43 +00:00
Eric Christopher
856d2fc052 Make RangeSpanList take a symbol for the beginning of the range
rather than magically making the names match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196419 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:04:50 +00:00
Eric Christopher
c8c1893f8b Add a FIXME for making the symbol emission functions const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 22:04:46 +00:00
David Blaikie
ec112cfc45 DwarfDebug: Unconditionalize trivial asm comments
While we still have a few (~4) non-trivial comments with string
concatenation, etc that should remain conditionalized, these trivial
literal comments can be simplified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196416 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 21:51:05 +00:00
David Blaikie
a18dcd4cce DwarfDebug: Reduce code duplication for sec offset emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 21:31:26 +00:00
Eric Christopher
ae49c38733 Couple of small logical cleanups to use !empty rather than other
checks. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196412 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04 21:20:15 +00:00