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

111677 Commits

Author SHA1 Message Date
Mehdi Amini
a70abc64ab Fold a loop for array processing in ComputeLinearIndex
When processing an array, every Elt has the same layout, it is
useless to recursively call each ComputeLinearIndex on each element.
Just do it once and multiply by the number of elements.
    
Differential Revision: http://reviews.llvm.org/D6832

llvm-svn: 225949
2015-01-14 05:33:01 +00:00
JF Bastien
6c7aa853bb Revert "Insert random noops to increase security against ROP attacks (llvm)"
This reverts commit:
http://reviews.llvm.org/D3392

llvm-svn: 225948
2015-01-14 05:24:33 +00:00
Duncan P. N. Exon Smith
52c27eeccb NVPTX: Use MapMetadata() instead of custom/stale/untested logic
Copy the `GVMap` over to a standard `ValueToValueMapTy` so that we can
reuse the `MapMetadata()` logic.  Unfortunately the `GVMap` can't just
be replaced, since `MapMetadata()` likes to modify the map, but at least
this will prevent NVPTX from bitrotting.

llvm-svn: 225944
2015-01-14 05:14:30 +00:00
Duncan P. N. Exon Smith
f10473b136 NVPTX: Remove bogus remap logic for global variable address spaces
The comment is incorrect, and the code mangles debug info.  Remove the
bad logic, which wasn't tested anyway.

llvm-svn: 225943
2015-01-14 05:13:18 +00:00
Saleem Abdulrasool
85b2a0e385 X86: validate 'int' instruction
The int instruction takes as an operand an 8-bit immediate value.  Validate that
the input is valid rather than silently truncating the value.

llvm-svn: 225941
2015-01-14 05:10:21 +00:00
NAKAMURA Takumi
dbaf514823 Disable a couple of tests, CodeGen/X86/noop-insert.ll and CodeGen/X86/noop-insert-percentage.ll, in r225908, to unbreak tests.
llvm-svn: 225940
2015-01-14 04:21:33 +00:00
Chandler Carruth
c21a455538 [dom] Remove extraneous inline keywords. Template functions and inline
class members are implicitly "inline", no key word needed.

Naturally, this could change how LLVM inlines these functions because
<GRR>, but that's not an excuse to use the keyword. ;]

llvm-svn: 225939
2015-01-14 03:58:50 +00:00
Chandler Carruth
14be93b14e [dom] The formatting of the generic domtree has bitrotted over the years
significantly. Clean it up with the help of clang-format.

I've touched this up by hand in a couple of places that weren't quite
right (IMO). I think most of these actually have bugs open about
already.

llvm-svn: 225938
2015-01-14 03:56:00 +00:00
Chandler Carruth
626389b2ad [dom] Clean up some comments in this header that were confusingly
formatted or placed incorrectly.

llvm-svn: 225937
2015-01-14 03:55:58 +00:00
Chandler Carruth
801414c054 [dom] Add a basic dominator tree test.
Correct, we have *zero* basic testing of the dominator tree in the
regression test suite. There is a single test that even prints it out,
and that test only checks a single line of the output. There are
a handful of tests that check post dominators, but all of those are
looking for bugs rather than just exercising the basic machinery.

This test is super boring and unexciting. But hey, it's something.
I needed there to be something so I could switch the basic test to run
with both the old and new pass manager.

llvm-svn: 225936
2015-01-14 03:34:55 +00:00
Hao Liu
b1d2970451 Fix a wrong comment in LoopVectorize.
I.E. more than two -> exactly two
Fix a typo function name in LoopVectorize.
  I.E. collectStrideAcccess() -> collectStrideAccess()

llvm-svn: 225935
2015-01-14 03:02:16 +00:00
NAKAMURA Takumi
c59d7fac24 TargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]
llvm-svn: 225933
2015-01-14 02:24:10 +00:00
Richard Trieu
d6743940e6 Disable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
complain that the flag doesn't exist.

llvm-svn: 225931
2015-01-14 01:50:12 +00:00
Tim Northover
dd963c2722 ARM: add test for crc32 instructions in CodeGen.
Somehow we seem to have ended up without any actual tests of the
CodeGen side. Easy enough to fix.

llvm-svn: 225930
2015-01-14 01:43:33 +00:00
Duncan P. N. Exon Smith
08b4a2b922 Remove trailing slash from r225924
llvm-svn: 225929
2015-01-14 01:42:43 +00:00
Hal Finkel
794dabb4dc [PowerPC] Fix the noop-insert test
The form of nops used is CPU-specific (some CPUs, such as the POWER7, have
special group-terminating nops). We probably want a different callback for this
kind of nop insertion (something more like MCAsmBackend::writeNopData), or for
PPC to use a different mechanism for scheduling nops, but this will stop the
test from failing for now.

llvm-svn: 225928
2015-01-14 01:37:21 +00:00
Matt Arsenault
d3aa8b3a41 R600/SI: Remove some redudant load testcases.
This reduces coverage for Evergreen, since the more
complete tests have those run lines disabled.

llvm-svn: 225927
2015-01-14 01:35:26 +00:00
Matt Arsenault
424a0025ca R600/SI: Fix bad code with unaligned byte vector loads
Don't do the v4i8 -> v4f32 combine if the load will need to
be expanded due to alignment. This stops adding instructions
to repack into a single register that the v_cvt_ubyteN_f32
instructions read.

llvm-svn: 225926
2015-01-14 01:35:22 +00:00
Matt Arsenault
22a9f67443 Implement new way of expanding extloads.
Now that the source and destination types can be specified,
allow doing an expansion that doesn't use an EXTLOAD of the
result type. Try to do a legal extload to an intermediate type
and extend that if possible.

This generalizes the special case custom lowering of extloads
R600 has been using to work around this problem.

This also happens to fix a bug that would incorrectly use more
aligned loads than should be used.

llvm-svn: 225925
2015-01-14 01:35:17 +00:00
Duncan P. N. Exon Smith
8a232da25f Utils: Remove unreachable break, NFC
llvm-svn: 225924
2015-01-14 01:31:34 +00:00
Duncan P. N. Exon Smith
2bfbe34846 Utils: Handle remapping distinct MDLocations
Part of PR21433.

llvm-svn: 225921
2015-01-14 01:29:32 +00:00
Duncan P. N. Exon Smith
bf65b41afe Utils: Thread distinct-ness through the cloneMD*() functions, NFC
The new logic isn't actually reachable yet, so no functionality change.

llvm-svn: 225918
2015-01-14 01:24:38 +00:00
Duncan P. N. Exon Smith
a37b732e50 Utils: Extract cloneMDNode(), NFC
llvm-svn: 225917
2015-01-14 01:22:47 +00:00
Duncan P. N. Exon Smith
02dd0e93d7 Utils: Move cloneMD*() up, NFC
llvm-svn: 225915
2015-01-14 01:21:24 +00:00
Duncan P. N. Exon Smith
e0ad6d2442 Utils: Add mapping for uniqued MDLocations
Still doesn't handle distinct ones.  Part of PR21433.

llvm-svn: 225914
2015-01-14 01:20:27 +00:00
Tom Stellard
577d33b096 R600/SI: Define a schedule model
The machine scheduler is still disabled by default.

The schedule model is not complete yet, and could be improved.

llvm-svn: 225913
2015-01-14 01:13:19 +00:00
Duncan P. N. Exon Smith
c3dc6a8739 Utils: Extract cloneMDTuple(), NFC
llvm-svn: 225912
2015-01-14 01:12:14 +00:00
Duncan P. N. Exon Smith
0661bb712f Utils: Extract shouldRemapUniquedNode(), NFC
llvm-svn: 225911
2015-01-14 01:08:47 +00:00
Hal Finkel
a11b7ea471 Revert "r225811 - Revert "r225808 - [PowerPC] Add StackMap/PatchPoint support""
This re-applies r225808, fixed to avoid problems with SDAG dependencies along
with the preceding fix to ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs.
These problems caused the original regression tests to assert/segfault on many
(but not all) systems.

Original commit message:

This commit does two things:

 1. Refactors PPCFastISel to use more of the common infrastructure for call
    lowering (this lets us take advantage of this common code for lowering some
    common intrinsics, stackmap/patchpoint among them).

 2. Adds support for stackmap/patchpoint lowering. For the most part, this is
    very similar to the support in the AArch64 target, with the obvious differences
    (different registers, NOP instructions, etc.). The test cases are adapted
    from the AArch64 test cases.

One difference of note is that the patchpoint call sequence takes 24 bytes, so
you can't use less than that (on AArch64 you can go down to 16). Also, as noted
in the docs, we take the patchpoint address to be the actual code address
(assuming the call is local in the TOC-sharing sense), which should yield
higher performance than generating the full cross-DSO indirect-call sequence
and is likely just as useful for JITed code (if not, we'll change it).

StackMaps and Patchpoints are still marked as experimental, and so this support
is doubly experimental. So go ahead and experiment!

llvm-svn: 225909
2015-01-14 01:07:51 +00:00
JF Bastien
c2f3b58bb0 Insert random noops to increase security against ROP attacks (llvm)
A pass that adds random noops to X86 binaries to introduce diversity with the goal of increasing security against most return-oriented programming attacks.

Command line options:
  -noop-insertion // Enable noop insertion.
  -noop-insertion-percentage=X // X% of assembly instructions will have a noop prepended (default: 50%, requires -noop-insertion)
  -max-noops-per-instruction=X // Randomly generate X noops per instruction. ie. roll the dice X times with probability set above (default: 1). This doesn't guarantee X noop instructions.

In addition, the following 'quick switch' in clang enables basic diversity using default settings (currently: noop insertion and schedule randomization; it is intended to be extended in the future).
  -fdiversify

This is the llvm part of the patch.
clang part: D3393

http://reviews.llvm.org/D3392
Patch by Stephen Crane (@rinon)

llvm-svn: 225908
2015-01-14 01:07:26 +00:00
Hal Finkel
add252ca22 Adjust ScheduleDAGSDNodes::RegDefIter for patchpoints
PATCHPOINT is a strange pseudo-instruction. Depending on how it is used, and
whether or not the AnyReg calling convention is being used, it might or might
not define a value. However, its TableGen definition says that it defines one
value, and so when it doesn't, the code in ScheduleDAGSDNodes::RegDefIter
becomes confused and the code that uses the RegDefIter will try to get the
register class of the MVT::Other type associated with the PATCHPOINT's chain
result (under certain circumstances).

This will be covered by the PPC64 PatchPoint test cases once that support is
re-committed.

llvm-svn: 225907
2015-01-14 01:07:03 +00:00
Duncan P. N. Exon Smith
5d629db1e8 Utils: Simplify code, NFC
llvm-svn: 225906
2015-01-14 01:07:03 +00:00
Duncan P. N. Exon Smith
197480b94e Utils: Extract mapUniquedNode(), NFC
llvm-svn: 225905
2015-01-14 01:06:21 +00:00
Reid Kleckner
b190c8f871 CodeGen support for x86_64 SEH catch handlers in LLVM
This adds handling for ExceptionHandling::MSVC, used by the
x86_64-pc-windows-msvc triple. It assumes that filter functions have
already been outlined in either the frontend or the backend. Filter
functions are used in place of the landingpad catch clause type info
operands. In catch clause order, the first filter to return true will
catch the exception.

The C specific handler table expects the landing pad to be split into
one block per handler, but LLVM IR uses a single landing pad for all
possible unwind actions. This patch papers over the mismatch by
synthesizing single instruction BBs for every catch clause to fill in
the EH selector that the landing pad block expects.

Missing functionality:
- Accessing data in the parent frame from outlined filters
- Cleanups (from __finally) are unsupported, as they will require
  outlining and parent frame access
- Filter clauses are unsupported, as there's no clear analogue in SEH

In other words, this is the minimal set of changes needed to write IR to
catch arbitrary exceptions and resume normal execution.

Reviewers: majnemer

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

llvm-svn: 225904
2015-01-14 01:05:27 +00:00
Duncan P. N. Exon Smith
bc788669d1 Utils: MDNode => UniquableMDNode, NFC
Although this makes the `cast<>` assert more often, the
`assert(Node->isResolved())` on the following line would assert in all
those cases.  So, no functionality change here.

llvm-svn: 225903
2015-01-14 01:05:17 +00:00
Duncan P. N. Exon Smith
924cd172c7 Utils: Separate out mapDistinctNode(), NFC
llvm-svn: 225902
2015-01-14 01:03:05 +00:00
Duncan P. N. Exon Smith
5d66b7c7b2 Utils: Use helper function directly, NFC
llvm-svn: 225901
2015-01-14 01:02:17 +00:00
Adrian Prantl
d840af406b Debug Info: Implement DwarfCompileUnit::addComplexAddress() using
DIEDwarfExpression (and get rid of a bunch of redundant code).

NFC

llvm-svn: 225900
2015-01-14 01:01:30 +00:00
Adrian Prantl
2f399a17ac Debug Info: Emitting a register in DwarfExpression may fail. Report the
status in a bool and let the users deal with the error.

NFC.

llvm-svn: 225899
2015-01-14 01:01:28 +00:00
Adrian Prantl
6a254c104a Debug Info: Move DIEDwarfExpression into DwarfExpression.h because it
needs to be accessed from both DwarfCompileUnit.cpp and DwarfUnit.cpp.

NFC.

llvm-svn: 225898
2015-01-14 01:01:22 +00:00
Duncan P. N. Exon Smith
24534392bd Utils: Extract helper function, NFC
llvm-svn: 225897
2015-01-14 01:01:19 +00:00
Duncan P. N. Exon Smith
1e6c2d1fe3 Utils: Use MDTuple::get() directly, NFC
Working towards supporting `MDLocation` in `MapMetadata()`.

llvm-svn: 225896
2015-01-14 00:59:57 +00:00
Ahmed Bougacha
284d7745d1 [SimplifyLibCalls] Don't try to simplify indirect calls.
It turns out, all callsites of the simplifier are guarded by a check for
CallInst::getCalledFunction (i.e., to make sure the callee is direct).

This check wasn't done when trying to further optimize a simplified fortified
libcall, introduced by a refactoring in r225640.

Fix that, add a testcase, and document the requirement.

llvm-svn: 225895
2015-01-14 00:55:05 +00:00
Eric Christopher
e6ed680cb2 Remove unused predicate.
llvm-svn: 225893
2015-01-14 00:50:33 +00:00
Eric Christopher
c817e964d4 Migrate ABIName to MCTargetOptions so that it can be shared between
the TargetMachine level and the MC level.

llvm-svn: 225891
2015-01-14 00:50:31 +00:00
Rafael Espindola
0241b53c72 Don't set LD_PRELOAD to ''. It doesn't work on OpenBSD.
Patch by Brad Smith.

llvm-svn: 225890
2015-01-14 00:39:56 +00:00
Chandler Carruth
64e6092133 Revert r225854: [PM] Move the LazyCallGraph printing functionality to
a print method.

This was formulated on a bad idea, but sadly I didn't uncover how bad
this was until I got further down the path. I had hoped that we could
provide a low boilerplate way of printing analyses, but it just doesn't
seem like this really fits the needs of the analyses. Not all analyses
really want to do printing, and those that do don't all use the same
interface. Instead, with the new pass manager let's just take advantage
of the fact that creating an explicit printer pass like the LCG has is
pretty low boilerplate already and rely on that for testing.

llvm-svn: 225861
2015-01-14 00:27:45 +00:00
Adrian Prantl
a87d0533ca Debug Info: Don't bother emitting DW_AT_frame_base if the function has
no frame register. "Tested" via an assertion triggered by DwarfExpression.

llvm-svn: 225858
2015-01-14 00:15:16 +00:00
Adrian Prantl
28e45a7364 Revert "Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a"
This reverts commit r225852, it was a bad idea.

MachineReg should always be a physical register. If it isn't this DebugLoc
shouldn't have been created in the first place.

llvm-svn: 225857
2015-01-14 00:15:12 +00:00
Chandler Carruth
3506a144d0 [PM] Move the LazyCallGraph printing functionality to a print method.
I'm adding generic analysis printing utility pass support which will
require such a method (or a specialization) so this will let the
existing printing logic satisfy that.

llvm-svn: 225854
2015-01-13 23:53:50 +00:00