OSDN Git Service
David Majnemer [Wed, 14 Jan 2015 06:14:36 +0000 (06:14 +0000)]
Use the operand vector instead so inline assembly can be validated too
The buildbots got upset after r225941, this should hopefully fix things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225954
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 06:03:18 +0000 (06:03 +0000)]
SelectionDAG: add a -filter-view-dags option to llc
This option takes the name of the basic block you want to visualize
with -view-*-dags
Differential Revision: http://reviews.llvm.org/D6948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225953
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:45:24 +0000 (05:45 +0000)]
DAG Combiner: Fold SelectCC When Cond is UNDEF
In case folding a node end up with a NaN as operand for the select,
the folding of the condition of the selectcc node returns "UNDEF".
Differential Revision: http://reviews.llvm.org/D6889
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225952
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:38:48 +0000 (05:38 +0000)]
Add assertions for out of bound index in ComputeLinearIndex
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225951
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 14 Jan 2015 05:37:10 +0000 (05:37 +0000)]
X86: only access operands if they are present
If there is no associated immediate (MS style inline asm), do not try to access
the operand, assume that it is valid. This should fix the buildbots after SVN
r225941.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225950
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Wed, 14 Jan 2015 05:33:01 +0000 (05:33 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225949
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 14 Jan 2015 05:24:33 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (llvm)"
This reverts commit:
http://reviews.llvm.org/D3392
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225948
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:14:30 +0000 (05:14 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225944
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 05:13:18 +0000 (05:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225943
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 14 Jan 2015 05:10:21 +0000 (05:10 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225941
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 14 Jan 2015 04:21:33 +0000 (04:21 +0000)]
Disable a couple of tests, CodeGen/X86/noop-insert.ll and CodeGen/X86/noop-insert-percentage.ll, in r225908, to unbreak tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225940
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:58:50 +0000 (03:58 +0000)]
[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. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225939
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:56:00 +0000 (03:56 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225938
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:55:58 +0000 (03:55 +0000)]
[dom] Clean up some comments in this header that were confusingly
formatted or placed incorrectly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225937
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 03:34:55 +0000 (03:34 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225936
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Wed, 14 Jan 2015 03:02:16 +0000 (03:02 +0000)]
Fix a wrong comment in LoopVectorize.
I.E. more than two -> exactly two
Fix a typo function name in LoopVectorize.
I.E. collectStrideAcccess() -> collectStrideAccess()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225935
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 14 Jan 2015 02:24:10 +0000 (02:24 +0000)]
TargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225933
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Wed, 14 Jan 2015 01:50:12 +0000 (01:50 +0000)]
Disable -Wunknown-pragmas in a test so that Clang without -Wself-move will not
complain that the flag doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225931
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 14 Jan 2015 01:43:33 +0000 (01:43 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225930
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:42:43 +0000 (01:42 +0000)]
Remove trailing slash from r225924
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225929
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:37:21 +0000 (01:37 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225928
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:26 +0000 (01:35 +0000)]
R600/SI: Remove some redudant load testcases.
This reduces coverage for Evergreen, since the more
complete tests have those run lines disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225927
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:22 +0000 (01:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225926
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 14 Jan 2015 01:35:17 +0000 (01:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225925
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:31:34 +0000 (01:31 +0000)]
Utils: Remove unreachable break, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225924
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:29:32 +0000 (01:29 +0000)]
Utils: Handle remapping distinct MDLocations
Part of PR21433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225921
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:24:38 +0000 (01:24 +0000)]
Utils: Thread distinct-ness through the cloneMD*() functions, NFC
The new logic isn't actually reachable yet, so no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225918
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:22:47 +0000 (01:22 +0000)]
Utils: Extract cloneMDNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225917
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:21:24 +0000 (01:21 +0000)]
Utils: Move cloneMD*() up, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225915
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:20:27 +0000 (01:20 +0000)]
Utils: Add mapping for uniqued MDLocations
Still doesn't handle distinct ones. Part of PR21433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225914
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Wed, 14 Jan 2015 01:13:19 +0000 (01:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225913
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:12:14 +0000 (01:12 +0000)]
Utils: Extract cloneMDTuple(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225912
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:08:47 +0000 (01:08 +0000)]
Utils: Extract shouldRemapUniquedNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225911
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:07:51 +0000 (01:07 +0000)]
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225909
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 14 Jan 2015 01:07:26 +0000 (01:07 +0000)]
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225908
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 14 Jan 2015 01:07:03 +0000 (01:07 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225907
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:07:03 +0000 (01:07 +0000)]
Utils: Simplify code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225906
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:06:21 +0000 (01:06 +0000)]
Utils: Extract mapUniquedNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225905
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 14 Jan 2015 01:05:27 +0000 (01:05 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225904
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:05:17 +0000 (01:05 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225903
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:03:05 +0000 (01:03 +0000)]
Utils: Separate out mapDistinctNode(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225902
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:02:17 +0000 (01:02 +0000)]
Utils: Use helper function directly, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225901
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:30 +0000 (01:01 +0000)]
Debug Info: Implement DwarfCompileUnit::addComplexAddress() using
DIEDwarfExpression (and get rid of a bunch of redundant code).
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225900
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:28 +0000 (01:01 +0000)]
Debug Info: Emitting a register in DwarfExpression may fail. Report the
status in a bool and let the users deal with the error.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225899
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 01:01:22 +0000 (01:01 +0000)]
Debug Info: Move DIEDwarfExpression into DwarfExpression.h because it
needs to be accessed from both DwarfCompileUnit.cpp and DwarfUnit.cpp.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225898
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:01:19 +0000 (01:01 +0000)]
Utils: Extract helper function, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225897
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 00:59:57 +0000 (00:59 +0000)]
Utils: Use MDTuple::get() directly, NFC
Working towards supporting `MDLocation` in `MapMetadata()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225896
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Wed, 14 Jan 2015 00:55:05 +0000 (00:55 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225895
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 14 Jan 2015 00:50:33 +0000 (00:50 +0000)]
Remove unused predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225893
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 14 Jan 2015 00:50:31 +0000 (00:50 +0000)]
Migrate ABIName to MCTargetOptions so that it can be shared between
the TargetMachine level and the MC level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225891
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 14 Jan 2015 00:39:56 +0000 (00:39 +0000)]
Don't set LD_PRELOAD to ''. It doesn't work on OpenBSD.
Patch by Brad Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225890
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 14 Jan 2015 00:27:45 +0000 (00:27 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225861
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 00:15:16 +0000 (00:15 +0000)]
Debug Info: Don't bother emitting DW_AT_frame_base if the function has
no frame register. "Tested" via an assertion triggered by DwarfExpression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225858
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 14 Jan 2015 00:15:12 +0000 (00:15 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225857
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 23:53:50 +0000 (23:53 +0000)]
[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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225854
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:39:15 +0000 (23:39 +0000)]
Debug Info: Bail out of AddMachineRegPiece() if MachineReg is not a
physical register. The call to getMinimalPhysRegClass() later on asserts
on this condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225852
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:39:11 +0000 (23:39 +0000)]
Debug Info: Move the complex expression handling (=the remainder) of
emitDebugLocValue() into DwarfExpression.
Ought to be NFC, but it actually uncovered a bug in the debug-loc-asan.ll
testcase. The testcase checks that the address of variable "y" is stored
at [RSP+16], which also lines up with the comment.
It also check(ed) that the *value* of "y" is stored in RDI before that,
but that is actually incorrect, since RDI is the very value that is
stored in [RSP+16]. Here's the assembler output:
movb
2147450880(%rcx), %r8b
#DEBUG_VALUE: bar:y <- RDI
cmpb $0, %r8b
movq %rax, 32(%rsp) # 8-byte Spill
movq %rsi, 24(%rsp) # 8-byte Spill
movq %rdi, 16(%rsp) # 8-byte Spill
.Ltmp3:
#DEBUG_VALUE: bar:y <- [RSP+16]
Fixed the comment to spell out the correct register and the check to
expect an address rather than a value.
Note that the range that is emitted for the RDI location was and is still
wrong, it claims to begin at the function prologue, but really it should
start where RDI is first assigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225851
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 13 Jan 2015 23:27:55 +0000 (23:27 +0000)]
[AVX512] Add 16x32 unpck tests as well
Forgot this from r225838.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225850
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:11:51 +0000 (23:11 +0000)]
cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225848
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:11:07 +0000 (23:11 +0000)]
Document, cleanup, and clang-format DwarfExpression.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225847
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Tue, 13 Jan 2015 23:10:43 +0000 (23:10 +0000)]
Debug Info: Turn DIExpression::getFrameRegister() into an isFrameRegister()
function.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225846
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Tue, 13 Jan 2015 22:59:41 +0000 (22:59 +0000)]
R600/SI: Add pattern for bitcasting fp immediates to integers
The backend now assumes that all immediates are integers. This allows
us to simplify immediate handling code, becasue we no longer need to
handle fp and integer immediates differently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225844
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 22:45:13 +0000 (22:45 +0000)]
[PM] Remove the defunt CGSCC-specific debug flag.
Even before I sunk the debug flag into the opt tool this had been made
obsolete by factoring the pass and analysis managers into a single set
of templates that all used the core flag. No functionality changed here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225842
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 22:42:38 +0000 (22:42 +0000)]
[PM] Push the debug option for the new pass manager into the opt tool
and expose the necessary hooks in the API directly.
This makes it much cleaner for example to log the usage of a pass
manager from a library. It also makes it more obvious that this
functionality isn't "optional" or "asserts-only" for the pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225841
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 13 Jan 2015 22:40:15 +0000 (22:40 +0000)]
Fix function names in tests from r225838.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225840
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 13 Jan 2015 22:20:18 +0000 (22:20 +0000)]
[AVX512] Unpack support in new shuffle lowering
This now handles both 32 and 64-bit element sizes.
In this version, the test are in vector-shuffle-512-v8.ll, canonicalized by
Chandler's update_llc_test_checks.py.
Part of <rdar://problem/
17688758>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225838
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 13 Jan 2015 22:20:14 +0000 (22:20 +0000)]
[AVX512] Add pretty-printing of shuffle mask for unpacks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225837
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Tue, 13 Jan 2015 22:17:46 +0000 (22:17 +0000)]
DAGCombiner: simplify by using condition variables; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225836
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 21:30:27 +0000 (21:30 +0000)]
[PM] Sink the convenience typedefs after the class template they are
referring to and give them nice comments.
Previously, these were used, but now things use the generic form of the
AnalysisManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225833
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 13 Jan 2015 21:10:44 +0000 (21:10 +0000)]
AsmParser/Bitcode: Add support for MDLocation
This adds assembly and bitcode support for `MDLocation`. The assembly
side is rather big, since this is the first `MDNode` subclass (that
isn't `MDTuple`). Part of PR21433.
(If you're wondering where the mountains of testcase updates are, we
don't need them until I update `DILocation` and `DebugLoc` to actually
use this class.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225830
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Jan 2015 20:53:23 +0000 (20:53 +0000)]
R600: Implement getRecipEstimate
This requires a new hook to prevent expanding sqrt in terms
of rsqrt and reciprocal. v_rcp_f32, v_rsq_f32, and v_sqrt_f32 are
all the same rate, so this expansion would just double the number
of instructions and cycles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225828
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Jan 2015 20:53:18 +0000 (20:53 +0000)]
R600: Implement getRsqrtEstimate
Only do for f32 since I'm unclear on both what this is expecting
for the refinement steps in terms of accuracy, and what
f64 instruction actually provides.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225827
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 13 Jan 2015 20:50:21 +0000 (20:50 +0000)]
IR: Fix GCC error from MDLocation::getInlinedAt()
Apparently GCC didn't like my ternary operator from r225824. Use an
`if`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225826
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 13 Jan 2015 20:44:56 +0000 (20:44 +0000)]
IR: Add MDLocation class
Add a new subclass of `UniquableMDNode`, `MDLocation`. This will be the
IR version of `DebugLoc` and `DILocation`. The goal is to rename this
to `DILocation` once the IR classes supersede the `DI`-prefixed
wrappers.
This isn't used anywhere yet. Part of PR21433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225824
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 13 Jan 2015 19:46:48 +0000 (19:46 +0000)]
R600: Make cttz / ctlz cheap to speculate
Speculating things is generally good. SI+ has instructions for these
for 32-bit values. This is still probably better even with the expansion
for 64-bit values, although it is odd that this callback doesn't have
the size as a parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225822
91177308-0d34-0410-b5e6-
96231b3b80d8
Julien Lerouge [Tue, 13 Jan 2015 19:45:52 +0000 (19:45 +0000)]
Fix non-determinism issue in SLP
The issue was introduced in r214638:
+ for (auto &BSIter : BlocksSchedules) {
+ scheduleBlock(BSIter.second.get());
+ }
Because BlocksSchedules is a DenseMap with BasicBlock* keys, blocks are
scheduled in non-deterministic order, resulting in unpredictable IR.
Patch by Daniel Reynaud!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225821
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 13 Jan 2015 19:45:16 +0000 (19:45 +0000)]
Use the integrated assembler as default on SystemZ
This was already done in clang, this commit now uses the integrated
assembler as default when using LLVM tools directly.
A number of test cases deliberately using an invalid instruction in
inline asm now have to use -no-integrated-as.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225820
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 13 Jan 2015 19:43:45 +0000 (19:43 +0000)]
Use the integrated assembler as default on PowerPC
This was already done in clang, this commit now uses the integrated
assembler as default when using LLVM tools directly.
A number of test cases using inline asm had to be adapted, either by
updating the expected output, or by using -no-integrated-as (for such
tests that deliberately use an invalid instruction in inline asm).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225819
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Tue, 13 Jan 2015 19:14:20 +0000 (19:14 +0000)]
Running clang-format on CommandLine.h and CommandLine.cpp.
No functional changes, I'm just going to be doing a lot of work in these files and it would be helpful if they had more current LLVM style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225817
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Tue, 13 Jan 2015 18:49:42 +0000 (18:49 +0000)]
Add link to Go bindings documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225815
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 18:25:05 +0000 (18:25 +0000)]
Revert "r225808 - [PowerPC] Add StackMap/PatchPoint support"
Reverting this while I investiage buildbot failures (segfaulting in
GetCostForDef at ScheduleDAGRRList.cpp:314).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225811
91177308-0d34-0410-b5e6-
96231b3b80d8
Will Schmidt [Tue, 13 Jan 2015 18:17:08 +0000 (18:17 +0000)]
Update multiline.ll testcase to handle (ppc64le) .localentry directive
The ppc64le platform will emit a .localentry directive. This is triggering
a false-positive against a CHECK-NOT: .loc in multiline.ll.
Add a space "{{ }}" to the check-not line to allow for arguments, and
prevent .localentry from matching.
Differential Revision: http://reviews.llvm.org/D6935
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225810
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 18:02:22 +0000 (18:02 +0000)]
[PowerPC] Add missing override keyword
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225809
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:48:12 +0000 (17:48 +0000)]
[PowerPC] Add StackMap/PatchPoint support
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!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225808
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:48:07 +0000 (17:48 +0000)]
[StackMaps] Use CurrentFnSymForSize
When computing the call-site offset, use AP.CurrentFnSymForSize instead of
AP.CurrentFnSym. There should be no change for other targets, but this is
necessary for generating valid expressions for PPC64/ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225807
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:48:04 +0000 (17:48 +0000)]
[StackMaps] Mark in CallLoweringInfo when lowering a patchpoint
While, generally speaking, the process of lowering arguments for a patchpoint
is the same as lowering a regular indirect call, on some targets it may not be
exactly the same. Targets may not, for example, want to add additional register
dependencies that apply only to making cross-DSO calls through linker stubs,
may not want to load additional registers out of function descriptors, and may
not want to add additional side-effect-causing instructions that cannot be
removed later with the call itself being generated.
The PowerPC target will use this in a future commit (for all of the reasons
stated above).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225806
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:47:59 +0000 (17:47 +0000)]
[StackMaps] Allow the target to pre-process the live-out mask
Some targets, PowerPC for example, have pseudo-registers (such as that used to
represent the rounding mode), that don't have DWARF register numbers or a
register class. These are used only for internal dependency tracking, and
should not appear in the recorded live-outs. This adds a callback allowing the
target to pre-process the live-out mask in order to remove these kinds of
registers so that the StackMaps code does not complain about them and/or
attempt to include them in the output.
This will be used by the PowerPC target in a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225805
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:47:54 +0000 (17:47 +0000)]
[PowerPC] Split the blr definition into BLR and BLR8
We really need a separate 64-bit version of this instruction so that it can be
marked as clobbering LR8 (instead of just LR). No change in functionality
(although the verifier might be slightly happier), however, it is required for
stackmap/patchpoint support. Thus, this will be covered by stackmap test cases
once those are added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225804
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Tue, 13 Jan 2015 17:45:11 +0000 (17:45 +0000)]
[PowerPC] Add DWARF numbers for CA (XER), etc.
For registers that have DWARF numbers (like CA, which is really part of XER),
add them. Also, RM is not an SPR, and the declaration hack (where it is
declared as an SPR with an arbitrary number) is not needed, so just declare it
as a register.
NFC; although CA's register number will be needed when stackmap/patchpoint
support is added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225800
91177308-0d34-0410-b5e6-
96231b3b80d8
Jozef Kolek [Tue, 13 Jan 2015 15:59:17 +0000 (15:59 +0000)]
[mips][microMIPS] Fix issue with 16b instructions in jr instruction delay slot
16 bit instructions are not allowed in jr delay slot. Same stands for
PseudoIndirectBranch and PseudoReturn.
Differential Revision: http://reviews.llvm.org/D6815
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225798
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 13 Jan 2015 15:17:00 +0000 (15:17 +0000)]
Added a Mips lld milestone to the release notes for the 3.6 release.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225797
91177308-0d34-0410-b5e6-
96231b3b80d8
Olivier Sallenave [Tue, 13 Jan 2015 15:06:36 +0000 (15:06 +0000)]
Added TLI hook for isFPExtFree. Some of the FMA combine heuristics are now guarded with that hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225795
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Tue, 13 Jan 2015 14:36:46 +0000 (14:36 +0000)]
Revert "SLPVectorizer: Cache results from memory alias checking."
The alias cache has a problem of incorrect collisions in case a new instruction is allocated at the same address as a previously deleted instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225790
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Tue, 13 Jan 2015 14:30:07 +0000 (14:30 +0000)]
Silence warnings about unknown pragmas for compilers that are not Clang. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225788
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 13 Jan 2015 12:17:56 +0000 (12:17 +0000)]
[OCaml] Allow out-of-tree builds of LLVM bindings.
In order to use this feature, configure LLVM as usual,
but then build and install it as:
make all install SYSTEM_LLVM_CONFIG=llvm-config
where llvm-config is the llvm-config binary installed on your
system (possibly llvm-config-VERSION on e.g. Debian).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225787
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Eckstein [Tue, 13 Jan 2015 11:37:51 +0000 (11:37 +0000)]
SLPVectorizer: Cache results from memory alias checking.
This speeds up the dependency calculations for blocks with many load/store/call instructions.
Beside the improved runtime, there is no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225786
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 11:36:43 +0000 (11:36 +0000)]
[PM] In the PassManager template, remove a pointless indirection through
a nested class template for the PassModel, and use the T-suffix for the
two typedefs to match the code in the AnalysisManager.
This is the last of the fairly fundamental code cleanups here. Will be
focusing on the printing of analyses next to finish that aspect off.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225785
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 11:31:43 +0000 (11:31 +0000)]
[PM] Remove the 'AnalysisManagerT' type parameter from numerous layers
of templates in the new pass manager.
The analysis manager is now itself just a template predicated on the IR
unit. This makes lots of the templates really trivial and more clear:
they are all parameterized on a single type, the IR unit's type.
Everything else is a function of that. To me, this is a really nice
cleanup of the APIs and removes a layer of 'magic' and 'indirection'
that really wasn't there and just got in the way of understanding what
is going on here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225784
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 13 Jan 2015 11:13:56 +0000 (11:13 +0000)]
[PM] Refactor the new pass manager to use a single template to implement
the generic functionality of the pass managers themselves.
In the new infrastructure, the pass "manager" isn't actually interesting
at all. It just pipelines a single chunk of IR through N passes. We
don't need to know anything about the IR or the passes to do this really
and we can replace the 3 implementations of the exact same functionality
with a single generic PassManager template, complementing the single
generic AnalysisManager template.
I've left typedefs in place to give convenient names to the various
obvious instantiations of the template.
With this, I think I've nuked almost all of the redundant logic in the
managers, and I think the overall design is actually simpler for having
single templates that clearly indicate there is no special logic here.
The logging is made somewhat more annoying by this change, but I don't
think the difference is worth having heavy-weight traits to help log
things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225783
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Zotov [Tue, 13 Jan 2015 09:48:02 +0000 (09:48 +0000)]
Update release notes wrt OCaml bindings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225779
91177308-0d34-0410-b5e6-
96231b3b80d8