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

114156 Commits

Author SHA1 Message Date
Zachary Turner
2d0c903eb8 [llvm-pdbdump] Better error handling.
Previously it was impossible to distinguish between "There is
no PDB implementation for this platform" and "I tried to load
the PDB, but couldn't find the file", making it hard to figure
out if you built llvm-pdbdump incorrectly or if you just mistyped
a file name.

This patch adds proper error handling so that we can know exactly
what went wrong.

llvm-svn: 230868
2015-02-28 20:23:18 +00:00
Benjamin Kramer
d3d693cbae IndexedMap: Default to SmallVector<T, 0>
This looks ridiculous but SmallVector's realloc tricks really help with
large vectors of PODs, such as our virtreg IndexedMap.

llvm-svn: 230866
2015-02-28 20:15:07 +00:00
Benjamin Kramer
c1b31521c7 DwarfAccelTable: We know how many hashes we have in the output, just reserve the precise number
llvm-svn: 230865
2015-02-28 20:15:00 +00:00
Benjamin Kramer
9cb5a80c17 StackColoring: Move set instead of copying. NFC.
llvm-svn: 230864
2015-02-28 20:14:38 +00:00
Benjamin Kramer
9d5f68f7ad LiveRange: Replace a creative vector erase loop with std::remove_if.
I didn't see this so far because it scans backwards, but that doesn't
make it any less quadratic. NFC.

llvm-svn: 230863
2015-02-28 20:14:27 +00:00
Nick Lewycky
d89d4c9132 Revert r230812. Do not break builds for no reason.
llvm-svn: 230862
2015-02-28 19:43:20 +00:00
Mehdi Amini
22544426f3 Fixup for recent -fast-isel-abort change: code didn't match description
Level 1 should abort for all instructions but call/terminators/args.
Instead it was aborting only if the level was > 2

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 230861
2015-02-28 19:34:54 +00:00
Craig Topper
c3d656cc84 [X86] Remove the blendpd/blendps/pblendw/pblendd intrinsics. They can represented by shuffle_vector instructions.
llvm-svn: 230860
2015-02-28 19:33:17 +00:00
Zachary Turner
6c08d87f0f [raw_ostream] When printing color on Windows, use correct bg color.
When using SetConsoleTextAttribute() to set the foreground or
background color, if you don't explicitly set both colors, then
a default value of black will be chosen for whichever you don't
specify a value for.

This is annoying when you have a non default console background
color, for example, and you try to set the foreground color.

This patch gets the existing fg/bg color and when you set one
attribute, sets the opposite attribute to its existing color
prior to comitting the update.

Reviewed by: Aaron Ballman
Differential Revision: http://reviews.llvm.org/D7967

llvm-svn: 230859
2015-02-28 19:08:27 +00:00
Alexei Starovoitov
9d738a50b5 bpf: fix build
complete the plumbing of passing TargetRegisterInfo through
computeRegisterProperties started by r230583

llvm-svn: 230858
2015-02-28 18:03:04 +00:00
Benjamin Kramer
1a8767d1c0 TRE: Just erase dead BBs and tweak the iteration loop not to increment the deleted BB iterator.
Leaving empty blocks around just opens up a can of bugs like PR22704. Deleting
them early also slightly simplifies code.

Thanks to Sanjay for the IR test case.

llvm-svn: 230856
2015-02-28 16:47:27 +00:00
Yaron Keren
4d39ffa2aa Silence variable set but not used warning in CodeGenRegisters.cpp, NFC.
llvm-svn: 230854
2015-02-28 15:54:04 +00:00
Yaron Keren
1d193961f0 Silence three more variable set but not used warnings, NFC.
llvm-svn: 230853
2015-02-28 15:29:17 +00:00
Peter Zotov
813b6bbde6 [OCaml] Generate documentation again with autoconf buildsystem.
Patch by Evangelos Foutras:

r220899 started using ocamlfind to build the OCaml bindings but
docs/Makefile still contains references to the OCAMLDOC macro which
is no longer being defined. The result is that OCaml documentation
isn't generated/installed.

llvm-svn: 230850
2015-02-28 13:48:23 +00:00
Benjamin Kramer
4718069d87 Convert push_back loops into append calls.
No functionality change intended.

llvm-svn: 230849
2015-02-28 13:20:15 +00:00
Yaron Keren
e4fac1eb58 Silence variable set but not used warning, NFC.
llvm-svn: 230848
2015-02-28 13:11:24 +00:00
Benjamin Kramer
411a71a68d ArrayRefize memory operand folding. NFC.
llvm-svn: 230846
2015-02-28 12:04:00 +00:00
Benjamin Kramer
0f0bd365d8 Replace std::copy with a back inserter with vector append where feasible
All of the cases were just appending from random access iterators to a
vector. Using insert/append can grow the vector to the perfect size
directly and moves the growing out of the loop. No intended functionalty
change.

llvm-svn: 230845
2015-02-28 10:11:12 +00:00
Eric Christopher
94da83b416 Remove option.ll as part of the Forward Control Flow Integrity
removal.

llvm-svn: 230844
2015-02-28 10:04:18 +00:00
Philip Reames
c309763721 [RewriteStatepointsForGC] Reduce indentation via early continue [NFC]
llvm-svn: 230836
2015-02-28 01:57:44 +00:00
Philip Reames
7a2e8f33b1 [RewriteStatepointsForGC] Fix another order of iteration bug
It turns out the naming of inserted phis and selects is sensative to the order in which two sets are iterated.  We need to nail this down to avoid non-deterministic output and possible test failures.  

The modified test is the one I first noticed something odd in.  The change is making it more strict to report the error.  With the test change, but without the code change, the test fails roughly 1 in 5.  With the code change, I've run ~30 runs without error.

Long term, the right fix here is to adjust the naming scheme.  I'm checking in this hack to avoid any possible non-determinism in the tests over the weekend.  HJust because I only noticed one case doesn't mean it's actually the only case.  I hope to get to the right change Monday.

std->llvm data structure changes bugfix change #3

llvm-svn: 230835
2015-02-28 01:52:09 +00:00
Philip Reames
5658248d0a [RewriteStatepointsForGC] Reduce indentation via early continue [NFC]
llvm-svn: 230829
2015-02-28 00:54:41 +00:00
Philip Reames
c0081494c4 [RewriteStatepointsForGC] Fix iterator invalidation bug
Inserting into a DenseMap you're iterating over is not well defined.  This is unfortunate since this is well defined on a std::map.

"cleanup per llvm code style standards" bug #2

llvm-svn: 230827
2015-02-28 00:47:50 +00:00
Frederic Riss
d62849fee5 [dsymutil] Fully qualify llvm::make_unique<>.
llvm-svn: 230826
2015-02-28 00:42:37 +00:00
Frederic Riss
d1f0af8d30 [dsymutil] Add the DwarfStreamer class.
This class is responsible for getting the linked data to the
disk in the appropriate form. Today it it an empty shell that
just instantiates an MC layer.

As we do not put anything in the resulting file yet, we just
check it has the right architecture (and check that -o does
the right thing).

To be able to create all the components, this commit adds a
few dependencies to llvm-dsymutil, namely all-targets, MC and
AsmPrinter.

Also add a -no-output option, so that tests that do not need
the binary result can continue to run even if they do not have
the required target linked in.

llvm-svn: 230824
2015-02-28 00:29:11 +00:00
Frederic Riss
72f231ec9f [dsymutil] Add a LinkOptions struct to pass to the DwarfLinker. NFC.
The only option we have to pass down currently is verbosity, but there
are more to come.

llvm-svn: 230823
2015-02-28 00:29:07 +00:00
Frederic Riss
fb85ddddd5 [dsymutil] clang-format a file
llvm-svn: 230822
2015-02-28 00:29:05 +00:00
Frederic Riss
6a4cc5a841 [dsymutil] Add -o option to select ouptut filename
We do not create the output file yet, so no means to test.

llvm-svn: 230821
2015-02-28 00:29:03 +00:00
Frederic Riss
9f2d537c29 [dsymutil] Create warn() global helper...
...and reimplement DwarfLinker::reportWarning in terms of it. Other
compenents than the DwarfLinker will need to report warnings, and I'm
about to add a similar "error()" helper at the same global level so
make that consistent.

llvm-svn: 230820
2015-02-28 00:29:01 +00:00
Frederic Riss
cdc2500b6d [dsymutil] Make trivial accessor const.
llvm-svn: 230819
2015-02-28 00:28:56 +00:00
Philip Reames
937676755d [RewriteStatepointsForGC] Add tests for the base pointer identification algorithm
These tests cover the 'base object' identification and rewritting portion of RewriteStatepointsForGC.  These aren't completely exhaustive, but they've proven to be reasonable effective over time at finding regressions.

In the process of porting these tests over, I found my first "cleanup per llvm code style standards" bug.  We were relying on the order of iteration when testing the base pointers found for a derived pointer.  When we switched from std::set to DenseSet, this stopped being a safe assumption.  I'm suspecting I'm going to find more of those.  In particular, I'm now really wondering about the main iteration loop for this algorithm.  I need to go take a closer look at the assumptions there.

I'm not really happy with the fact these are testing what is essentially debug output (i.e. enabled via command line flags).  Suggestions for how to structure this better are very welcome.  

llvm-svn: 230818
2015-02-28 00:20:48 +00:00
Jonathan Roelofs
2a4b2c9a81 Discourage in-source autoconf builds (as we already do for the cmake build)
http://reviews.llvm.org/D7961

llvm-svn: 230812
2015-02-27 23:35:47 +00:00
Bill Schmidt
06671b00a3 Regenerated test case from pr 230801 for change in LLVM IR syntax
llvm-svn: 230811
2015-02-27 23:29:57 +00:00
David Blaikie
a412edd409 Update SystemZ/Large test generators to handle new gep IR syntax
llvm-svn: 230810
2015-02-27 23:29:39 +00:00
David Blaikie
74e5055c90 Update SystemZ/Large test generators to handle new load IR syntax
llvm-svn: 230809
2015-02-27 23:29:33 +00:00
Philip Reames
b5c64a23b3 [new docs] Performance Tips for Frontend Authors
As mentioned on llvm-dev, this is a new documentation page intended to collect tips for frontend authors on how to generate IR that LLVM is able to optimize well. These types of things come up repeated in review threads and it would be good to have a place to save them.

I added a small handful to start us off, but I mostly want to get the framework in place. Once the docs are here, we can add to them incrementally.  If you know of something appropriate for this page, please add it!

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

llvm-svn: 230807
2015-02-27 23:14:50 +00:00
Benjamin Kramer
3baef96802 MachineDominators: Move applySplitCriticalEdges into the cpp file.
It's too big for inlining anyways. Also clean it up slightly. No functionality
change intended.

llvm-svn: 230806
2015-02-27 23:13:13 +00:00
David Majnemer
0e8fa1d721 llvm-vtabledump: Update field with a better name
llvm-svn: 230804
2015-02-27 22:35:25 +00:00
Bill Schmidt
57e433433f Revert test case until it can be fixed
llvm-svn: 230803
2015-02-27 22:31:14 +00:00
Bill Schmidt
1d4d434e1c [PowerPC] Fix PR22711 - Misaligned .toc section
Straightforward patch to emit an alignment directive when emitting a
TOC entry.  The test case was generated from the test in PR22711 that
demonstrated a misaligned .toc section.  The object code is run
through llvm-readobj to verify that the correct alignment has been
applied to the .toc section.

Thanks to Ulrich Weigand for running down where the fix was needed.

llvm-svn: 230801
2015-02-27 22:14:10 +00:00
Benjamin Kramer
a9b2056013 Reduce double set lookups.
llvm-svn: 230798
2015-02-27 21:43:14 +00:00
David Blaikie
ab043ff680 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230794
2015-02-27 21:17:42 +00:00
Charles Davis
5c83517500 Target/X86: Never use the redzone for Win64 ABI functions.
Summary:
Until now, we did this (among other things) based on whether or not the
target was Windows. This is clearly wrong, not just for Win64 ABI functions
on non-Windows, but for System V ABI functions on Windows, too. In this
change, we make this decision based on the ABI the calling convention
specifies instead.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 230793
2015-02-27 21:11:16 +00:00
Hal Finkel
979cca3be8 [PowerPC] Use vector types for memcpy and friends (sometimes)
When using Altivec, we can use vector loads and stores for aligned memcpy and
friends. Starting with the P7 and VXS, we have reasonable unaligned vector
stores. Starting with the P8, we have fast unaligned loads too.

For QPX, we use vector loads are stores, but only for aligned memory accesses.

llvm-svn: 230788
2015-02-27 19:58:28 +00:00
David Blaikie
0d99339102 [opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction
One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.

This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.

* This doesn't modify gep operators, only instructions (operators will be
  handled separately)

* Textual IR changes only. Bitcode (including upgrade) and changing the
  in-memory representation will be in separate changes.

* geps of vectors are transformed as:
    getelementptr <4 x float*> %x, ...
  ->getelementptr float, <4 x float*> %x, ...
  Then, once the opaque pointer type is introduced, this will ultimately look
  like:
    getelementptr float, <4 x ptr> %x
  with the unambiguous interpretation that it is a vector of pointers to float.

* address spaces remain on the pointer, not the type:
    getelementptr float addrspace(1)* %x
  ->getelementptr float, float addrspace(1)* %x
  Then, eventually:
    getelementptr float, ptr addrspace(1) %x

Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.

update.py:
import fileinput
import sys
import re

ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile(       r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")

def conv(match, line):
  if not match:
    return line
  line = match.groups()[0]
  if len(match.groups()[5]) == 0:
    line += match.groups()[2]
  line += match.groups()[3]
  line += ", "
  line += match.groups()[1]
  line += "\n"
  return line

for line in sys.stdin:
  if line.find("getelementptr ") == line.find("getelementptr inbounds"):
    if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
      line = conv(re.match(ibrep, line), line)
  elif line.find("getelementptr ") != line.find("getelementptr ("):
    line = conv(re.match(normrep, line), line)
  sys.stdout.write(line)

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).

The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230786
2015-02-27 19:29:02 +00:00
Benjamin Kramer
6333fd2b12 Refer users looking for the release notes to 3.6.
llvm-svn: 230781
2015-02-27 19:06:26 +00:00
Eric Christopher
7c8f775d46 Remove the Forward Control Flow Integrity pass and its dependencies.
This work is currently being rethought along different lines and
if this work is needed it can be resurrected out of svn. Remove it
for now as no current work in ongoing on it and it's unused. Verified
with the authors before removal.

llvm-svn: 230780
2015-02-27 19:03:38 +00:00
Justin Bogner
dfad511a53 Object: Test for reading kext bundles
In the review for r230567, it was pointed out we should really test
the lib/Object part of that change. This does so using llvm-readobj.

llvm-svn: 230779
2015-02-27 18:58:23 +00:00
Reid Kleckner
27f79d7986 Delete LLVM_DELETED_FUNCTION from coding standards
It didn't seem worth leaving behind a guideline to use '= delete' to
make a class uncopyable. That's a well known C++ design pattern.

Reported on the mailing list and in PR22724.

llvm-svn: 230776
2015-02-27 18:34:16 +00:00
Mehdi Amini
32875af6e3 Change the fast-isel-abort option from bool to int to enable "levels"
Summary:
Currently fast-isel-abort will only abort for regular instructions,
and just warn for function calls, terminators, function arguments.
There is already fast-isel-abort-args but nothing for calls and
terminators.

This change turns the fast-isel-abort options into an integer option,
so that multiple levels of strictness can be defined.
This will help no being surprised when the "abort" option indeed does
not abort, and enables the possibility to write test that verifies
that no intrinsics are forgotten by fast-isel.

Reviewers: resistor, echristo

Subscribers: jfb, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 230775
2015-02-27 18:32:11 +00:00