1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
Commit Graph

104077 Commits

Author SHA1 Message Date
Andrew Trick
2cfbbba814 Add a subtarget hook: enablePostMachineScheduler.
As requested by AArch64 subtargets.

Note that this will have no effect until the
AArch64 target actually enables the pass like this:
substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);

As soon as armv7 switches over, PostMachineScheduler will become the
default postRA scheduler, so this won't be necessary any more.
Targets using the old postRA schedule would then do:
substitutePass(&PostMachineSchedulerID, &PostRASchedulerID);

llvm-svn: 210167
2014-06-04 07:06:27 +00:00
Andrew Trick
ba65eed5cb Move GenericScheduler and PostGenericScheduler into a header.
These were not exposed previously because I didn't want out-of-tree
targets to be too dependent on their internals. They can be reused for
a very wide variety of processors with casual scheduling needs without
exposing the classes by instead using hooks defined in
MachineSchedPolicy (we can add more if needed). When targets are more
aggressively tuned or want to provide custom heuristics, they can
define their own MachineSchedStrategy. I tend to think this is better
once you start customizing heuristics because you can copy over only
what you need. I don't think that layering heuristics generally works
well.

However, Arch64 targets now want to reuse the Generic scheduling logic
but also provide extensions. I don't see much harm in exposing the
Generic scheduling classes with a major caveat: these scheduling
strategies may change in the future without validating performance on
less mainstream processors. If you want to be immune from changes,
just define your own MachineSchedStrategy.

llvm-svn: 210166
2014-06-04 07:06:18 +00:00
Justin Bogner
9d92be7b3d docs: Remove documentation for legacy PGO options
Late last year r191835 removed a largely unmaintained legacy PGO
infrastructure, but some of the docs were missed. Since these docs are
for things that don't actually exist anymore, they should be removed.

llvm-svn: 210165
2014-06-04 06:29:38 +00:00
Simon Atanasyan
bc05e277f9 [Object][ELF] Range-based loop simplification.
No functional changes.

llvm-svn: 210164
2014-06-04 05:51:44 +00:00
Alp Toker
1f616b12e7 GraphWriter: try gv before xdg-open
Avoid changing behaviour for everyone who's used to the traditional ghostview
UI, especially since it knows how to stay in the foreground unlike xdg-open.

Amendment to r210147.

llvm-svn: 210148
2014-06-04 04:11:12 +00:00
Alp Toker
99172da33d GraphWriter: support the XDG open utility
This runs a suitable viewer on Unix desktop environments specified by
Freedesktop.org (GNOME, KDE, Linux distributions etc.)

llvm-svn: 210147
2014-06-04 03:57:44 +00:00
Alp Toker
de4db1f96a config.h: fix layering and don't duplicate definitions
Also correct the llvm-config.h header guard so it doesn't depend on 'CONFIG_H'
which is commonly defined in external projects and caused trouble for
embedders.

In future llvm/Config/llvm-config.h will be installed, but not
the private llvm/Config/config.h header.

llvm-svn: 210144
2014-06-04 03:21:38 +00:00
David Blaikie
5a54fcae12 DebugInfo: Partial revert r209984 due to more cases where abstract DbgVariables do not have associated DIEs.
Along with a test case to demonstrate that due to inlining order there
are cases where abstract variable DIEs are not constructed since the
abstract subprogram was built due to a previous inlining that optimized
away those variables. This produces incorrect debug info (the 'missing'
abstract variable causes the inlined instance of that variable to be
emitted with a full description (name, line, file) rather than
referencing the abstract origin), but this commit at least ensures that
it doesn't crash...

llvm-svn: 210143
2014-06-04 01:30:59 +00:00
Matt Arsenault
ad098591b8 Fix typos
llvm-svn: 210135
2014-06-03 23:06:13 +00:00
Pete Cooper
4164797aa0 Calculate dead instructions when a live interval is created.
This gets us closer to being able to remove LiveVariables entirely which is where dead instructions are currently tagged as such.

Reviewed by Jakob Olesen

llvm-svn: 210132
2014-06-03 22:42:10 +00:00
Eric Christopher
f3e627ce2e Revert r209381 as it isn't a local variable. Add a testcase so that
we know next time this happens.

llvm-svn: 210127
2014-06-03 21:01:39 +00:00
Eric Christopher
2010fabe89 Fixup formatting in the pass.
llvm-svn: 210126
2014-06-03 21:01:35 +00:00
Rafael Espindola
048d890988 Update comments to match reality.
llvm-svn: 210125
2014-06-03 20:25:26 +00:00
Rafael Espindola
c2b41dcccf Fix a small bug in the parsing of anonymous globals.
It was able to parse

hidden dllexport global i32 42

but not

dllexport global i32 42

llvm-svn: 210121
2014-06-03 20:07:32 +00:00
Rafael Espindola
48a1992b7f Simplify the parsing of unnamed globals. No functionality changed.
llvm-svn: 210120
2014-06-03 20:00:20 +00:00
Rafael Espindola
3ae2a07518 Update comment. This should have been part of r210062.
llvm-svn: 210119
2014-06-03 19:38:37 +00:00
Alp Toker
44c817e9c1 Remove some redundant doc comments
llvm-svn: 210118
2014-06-03 19:06:49 +00:00
Tilmann Scheller
a373112959 [AArch64] Fix typo in load/store optimizer.
llvm-svn: 210114
2014-06-03 16:33:13 +00:00
Tilmann Scheller
b619db1a71 [AArch64] Add regression tests for the load/store optimizer which cover post-index update folding with sub rather than add.
The tests check that the following transform happens:

  (ldr|str) X, [x20]
   ...
  sub x20, x20, #16
   ->
  (ldr|str) X, [x20], #-16

with X being either w0, x0, s0, d0 or q0.

llvm-svn: 210113
2014-06-03 16:03:00 +00:00
Rafael Espindola
051278b46c Implement one operator== with another.
Thanks for David Blaikie for the suggestion.

llvm-svn: 210107
2014-06-03 15:06:22 +00:00
Evgeniy Stepanov
09fc9f9f08 [asan] Fix coverage instrumentation with -asan-globals=0.
llvm-svn: 210103
2014-06-03 14:16:00 +00:00
Tim Northover
d56609ce6c AArch64: mark small types (i1, i8, i16) as promoted
This means the output of LowerFormalArguments returns a lowered
SDValue with the correct type (expected in SelectionDAGBuilder).
Without this, an assertion under a DEBUG macro triggers when those
types are passed on the stack.

llvm-svn: 210102
2014-06-03 13:54:53 +00:00
Rafael Espindola
863c5719fd Add operator== and operator!= to compare with nullptr.
llvm-svn: 210100
2014-06-03 13:26:18 +00:00
Rafael Espindola
99907878d9 Use an enum class.
llvm-svn: 210078
2014-06-03 05:26:12 +00:00
Rafael Espindola
a65e0b524d Use an enum class.
Might also fix the windows build.

llvm-svn: 210077
2014-06-03 05:12:33 +00:00
Rafael Espindola
47aa1edc02 Remove the last unspecified_bool_type from llvm.
llvm-svn: 210076
2014-06-03 05:05:15 +00:00
Rafael Espindola
063807ad90 Make this operator bool() explicit to match the standard library.
llvm-svn: 210073
2014-06-03 04:54:15 +00:00
Rafael Espindola
26d387b4fc Make this operator bool() explicit to match the standard library.
llvm-svn: 210072
2014-06-03 04:42:24 +00:00
Nick Lewycky
6c356b865d Ignore line numbers on debug intrinsics. Add an assert to ensure that we aren't emitting line number zero, the .gcno format uses this to indicate that the next field is a filename.
llvm-svn: 210068
2014-06-03 04:25:36 +00:00
Jiangning Liu
531302fb19 [AArch64] Correctly deal with VPR stack parameter passing.
llvm-svn: 210067
2014-06-03 03:25:09 +00:00
Alp Toker
7425836c09 Process::GetRandomNumber(): fix insecure RNG
This could have generated non-random output under error conditions in release
builds.

llvm-svn: 210065
2014-06-03 03:01:03 +00:00
Rafael Espindola
87cd774844 Allow alias to point to an arbitrary ConstantExpr.
This  patch changes GlobalAlias to point to an arbitrary ConstantExpr and it is
up to MC (or the system assembler) to decide if that expression is valid or not.

This reduces our ability to diagnose invalid uses and how early we can spot
them, but it also lets us do things like

@test5 = alias inttoptr(i32 sub (i32 ptrtoint (i32* @test2 to i32),
                                 i32 ptrtoint (i32* @bar to i32)) to i32*)

An important implication of this patch is that the notion of aliased global
doesn't exist any more. The alias has to encode the information needed to
access it in its metadata (linkage, visibility, type, etc).

Another consequence to notice is that getSection has to return a "const char *".
It could return a NullTerminatedStringRef if there was such a thing, but when
that was proposed the decision was to just uses "const char*" for that.

llvm-svn: 210062
2014-06-03 02:41:57 +00:00
Rafael Espindola
ca50d60283 Add back commit r210029.
The code was actually correct. Sorry for the confusion. I have expanded the
comment saying why the analysis is valid to avoid me misunderstaning it
again in the future.

llvm-svn: 210052
2014-06-02 22:01:04 +00:00
Rafael Espindola
74ec8fabec Convert test to FileCheck.
llvm-svn: 210049
2014-06-02 21:23:54 +00:00
Rafael Espindola
68e7702970 Revert "Add the nsw flag when we detect that an add will not signed overflow."
This reverts commit r210029.

It was not correctly handling cases where LHS and RHS had multiple but different
sign bits.

llvm-svn: 210048
2014-06-02 21:12:19 +00:00
Eric Christopher
51ec137e6b InitLibcallNames can take a Triple instead of a TargetMachine.
llvm-svn: 210045
2014-06-02 20:51:49 +00:00
Rafael Espindola
affcd78e1b Added support to optimize comparisons with "lshr exact" of a constant.
Patch by Rahul Jain.

llvm-svn: 210040
2014-06-02 19:19:04 +00:00
Alexey Samsonov
2ce8c2f26f Remove sanitizer blacklist from ASan/TSan/MSan function passes.
Instrumentation passes now use attributes
address_safety/thread_safety/memory_safety which are added by Clang frontend.
Clang parses the blacklist file and adds the attributes accordingly.

Currently blacklist is still used in ASan module pass to disable instrumentation
for certain global variables. We should fix this as well by collecting the
set of globals we're going to instrument in Clang and passing it to ASan
in metadata (as we already do for dynamically-initialized globals and init-order
checking).

This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline
flags in favor of -fsanitize-blacklist= Clang flag.

llvm-svn: 210038
2014-06-02 18:08:27 +00:00
Eric Christopher
44a7e98ce5 Omit else branch after return.
llvm-svn: 210034
2014-06-02 17:29:07 +00:00
Andrea Di Biagio
3455d1a524 [X86] Fix checked arithmetic for i8 on X86.
When lowering a ISD::BRCOND into a test+branch, make sure that we
always use the correct condition code to emit the test operation.

This fixes PR19858: "i8 checked mul is wrong on x86".

Patch by Keno Fisher!

llvm-svn: 210032
2014-06-02 16:00:27 +00:00
Rafael Espindola
6457c5ef17 Add the nsw flag when we detect that an add will not signed overflow.
We already had a function for checking this, we were just using it only in
specialized cases.

llvm-svn: 210029
2014-06-02 14:32:58 +00:00
Evgeniy Stepanov
f8c69caa5e [msan] Remove an out-of-date comment.
MSan is no longer an "early prototype".

llvm-svn: 210023
2014-06-02 12:58:08 +00:00
Rafael Espindola
a286c0385a Remove path_tclsh.m4.
Looks like it was only used by dejagnu and is now dead.

llvm-svn: 210022
2014-06-02 12:54:32 +00:00
Tilmann Scheller
7206d94ee3 [AArch64] Add some more regression tests for store pre-index update folding in the load/store optimizer.
Add tests for the following transform:

 add x8, x8, #16
  ...
 str X, [x8]
  ->
 str X, [x8, #16]!

with X being either w0, x0, s0, d0 or q0.

llvm-svn: 210021
2014-06-02 12:33:33 +00:00
Evgeniy Stepanov
d9731c7abd [msan] Handle x86 vector pack intrinsics.
llvm-svn: 210020
2014-06-02 12:31:44 +00:00
Tilmann Scheller
d9a7937b47 [AArch64] Add some more regression tests for load pre-index update folding in the load/store optimizer.
Add tests for the following transform:

 add x8, x8, #16
  ...
 ldr X, [x8]
  ->
 ldr X, [x8, #16]!

with X being either w0, x0, s0, d0 or q0.

llvm-svn: 210018
2014-06-02 11:57:09 +00:00
Dinesh Dwivedi
e95c2e918a Added inst combine tarnsform for (1 << X) & C pattrens where C is (some PowerOf2 - 1)
This patch can handles following cases from http://nondot.org/sabre/LLVMNotes/InstCombine.txt
  "((1 << X) & 7) == 0" ==> "X > 2"
  "((1 << X) & 7) != 0" ==> "X < 3".

Differential Revision: http://reviews.llvm.org/D3678

llvm-svn: 210007
2014-06-02 07:57:24 +00:00
Dinesh Dwivedi
11044281aa Added inst combine transforms for single bit tests from Chris's note
if ((x & C) == 0) x |= C becomes x |= C
if ((x & C) != 0) x ^= C becomes x &= ~C
if ((x & C) == 0) x ^= C becomes x |= C
if ((x & C) != 0) x &= ~C becomes x &= ~C
if ((x & C) == 0) x &= ~C becomes nothing

Differential Revision: http://reviews.llvm.org/D3777

llvm-svn: 210006
2014-06-02 07:24:36 +00:00
Alp Toker
844b48e479 Silence -Wreturn-type warning
llvm-svn: 210005
2014-06-02 04:34:10 +00:00
Alp Toker
eb71f96959 GraphWriter: tweak the program fallback order
Amend r210001 to use the classic fallback order behaviour if the requested
graphing program isn't found.

llvm-svn: 210003
2014-06-02 04:14:23 +00:00