Chandler Carruth [Wed, 14 Jan 2015 10:07:19 +0000 (10:07 +0000)]
[PM] Make DominatorTrees (corectly) movable so that we can move them
into the new pass manager's analysis cache which stores results
by-value.
Technically speaking, the dom trees were originally not movable but
copyable! This, unsurprisingly, didn't work at all -- the copy was
shallow and just resulted in rampant memory corruption. This change
explicitly forbids copying (as it would need to be a deep copy) and
makes them explicitly movable with the unsurprising boiler plate to
member-wise move them because we can't rely on MSVC to generate this
code for us. =/
llvm-svn: 225966
Daniel Jasper [Wed, 14 Jan 2015 10:02:49 +0000 (10:02 +0000)]
clang-format: [Java] Understand "import static".
llvm-svn: 225965
Daniel Jasper [Wed, 14 Jan 2015 10:00:20 +0000 (10:00 +0000)]
clang-format: [Java] Don't let annotations confuse return type analysis.
Before:
@Test
ReturnType
doSomething(String
aaaaaaaaaaaaa, String
bbbbbbbbbbbbbbb) {}
After:
@Test
ReturnType doSomething(
String
aaaaaaaaaaaaa, String
bbbbbbbbbbbbbbb) {}
llvm-svn: 225964
Daniel Jasper [Wed, 14 Jan 2015 09:51:32 +0000 (09:51 +0000)]
clang-format: [Java] Don't line-wrap before annotations' l_parens.
Before:
@SomeAnnotation
(
aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaa)
int i;
After:
@SomeAnnotation(
aaaaaaaaaaaaaaaaa,
aaaaaaaaaaaaaaaaaaaa)
int i;
llvm-svn: 225963
Daniel Jasper [Wed, 14 Jan 2015 09:47:57 +0000 (09:47 +0000)]
clang-format: [Java] Don't get confused by leading annotations.
Before:
@Test(a)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa);
After:
@Test(a)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa =
aaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaa);
llvm-svn: 225962
Brad Smith [Wed, 14 Jan 2015 08:23:49 +0000 (08:23 +0000)]
The assembler is now enabled by default.
llvm-svn: 225961
David Majnemer [Wed, 14 Jan 2015 08:08:52 +0000 (08:08 +0000)]
Sema: It's cheaper to ask LookupResult::empty than to calculate linkage
llvm-svn: 225960
David Blaikie [Wed, 14 Jan 2015 07:59:48 +0000 (07:59 +0000)]
Reapply debug info changes now that more precise column information is available.
llvm-svn: 225959
Brad Smith [Wed, 14 Jan 2015 07:55:36 +0000 (07:55 +0000)]
Use the integrated assembler by default on 32-bit PowerPC and SPARC.
llvm-svn: 225958
Brad Smith [Wed, 14 Jan 2015 07:53:39 +0000 (07:53 +0000)]
Use the integrated assembler by default on SPARC.
llvm-svn: 225957
David Blaikie [Wed, 14 Jan 2015 07:38:27 +0000 (07:38 +0000)]
Reapply r225000 (reverted in r225555): DebugInfo: Generalize debug info location handling (and follow-up commits).
Several pieces of code were relying on implicit debug location setting
which usually lead to incorrect line information anyway. So I've fixed
those (in r225955 and r225845) separately which should pave the way for
this commit to be cleanly reapplied.
The reason these implicit dependencies resulted in crashes with this
patch is that the debug location would no longer implicitly leak from
one place to another, but be set back to invalid. Once a call with
no/invalid location was emitted, if that call was ever inlined it could
produce invalid debugloc chains and assert during LLVM's codegen.
There may be further cases of such bugs in this patch - they're hard to
flush out with regression testing, so I'll keep an eye out for reports
and investigate/fix them ASAP if they come up.
Original commit message:
Reapply "DebugInfo: Generalize debug info location handling"
Originally committed in r224385 and reverted in r224441 due to concerns
this change might've introduced a crash. Turns out this change fixes the
crash introduced by one of my earlier more specific location handling
changes (those specific fixes are reverted by this patch, in favor of
the more general solution).
Recommitted in r224941 and reverted in r224970 after it caused a crash
when building compiler-rt. Looks to be due to this change zeroing out
the debug location when emitting default arguments (which were meant to
inherit their outer expression's location) thus creating call
instructions without locations - these create problems for inlining and
must not be created. That is fixed and tested in this version of the
change.
Original commit message:
This is a more scalable (fixed in mostly one place, rather than many
places that will need constant improvement/maintenance) solution to
several commits I've made recently to increase source fidelity for
subexpressions.
This resetting had to be done at the DebugLoc level (not the
SourceLocation level) to preserve scoping information (if the resetting
was done with CGDebugInfo::EmitLocation, it would've caused the tail end
of an expression's codegen to end up in a potentially different scope
than the start, even though it was at the same source location). The
drawback to this is that it might leave CGDebugInfo out of sync. Ideally
CGDebugInfo shouldn't have a duplicate sense of the current
SourceLocation, but for now it seems it does... - I don't think I'm
going to tackle removing that just now.
I expect this'll probably cause some more buildbot fallout & I'll
investigate that as it comes up.
Also these sort of improvements might be starting to show a weakness/bug
in LLVM's line table handling: we don't correctly emit is_stmt for
statements, we just put it on every line table entry. This means one
statement split over multiple lines appears as multiple 'statements' and
two statements on one line (without column info) are treated as one
statement.
I don't think we have any IR representation of statements that would
help us distinguish these cases and identify the beginning of each
statement - so that might be something we need to add (possibly to the
lexical scope chain - a scope for each statement). This does cause some
problems for GDB and possibly other DWARF consumers.
llvm-svn: 225956
David Blaikie [Wed, 14 Jan 2015 07:10:46 +0000 (07:10 +0000)]
DebugInof: Correct the location of exception cleanups in global ctors/dtors and ObjC methods
Without setting the CurEHLocation these cleanups would be attributed to
whatever the last active debug line location was (the 'fn' call in the
included test cases). By setting CurEHLocation correctly the line
information is improved/corrected.
This quality bug turned into a crasher with r225000 when, instead of
allowing the last location to persist, it would be zero'd out. This
could lead to a function call (such as the dtor) being made without a
debug location - if that call was subsequently inlined (and the caller
and callee had debug info, just not the call instruction) the inliner
would violate important constraints about the debug location chains by
not updating the inlined instructions to chain up to the callee
locations.
So, by fixing this bug, I am addressing the assertion failures
introduced by r225000 and should be able to recommit that patch with
impunity...
llvm-svn: 225955
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.
llvm-svn: 225954
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
llvm-svn: 225953
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
llvm-svn: 225952
Mehdi Amini [Wed, 14 Jan 2015 05:38:48 +0000 (05:38 +0000)]
Add assertions for out of bound index in ComputeLinearIndex
llvm-svn: 225951
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.
llvm-svn: 225950
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
llvm-svn: 225949
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
llvm-svn: 225948
JF Bastien [Wed, 14 Jan 2015 05:24:11 +0000 (05:24 +0000)]
Revert "Insert random noops to increase security against ROP attacks (clang)"
This reverts commit:
http://reviews.llvm.org/D3393
llvm-svn: 225947
Peter Collingbourne [Wed, 14 Jan 2015 05:18:16 +0000 (05:18 +0000)]
irgen: expose DisableUnusedImportCheck flag
Differential Revision: http://reviews.llvm.org/D6956
llvm-svn: 225946
Peter Collingbourne [Wed, 14 Jan 2015 05:17:41 +0000 (05:17 +0000)]
irgen: expose PackageCreated hook
Differential Revision: http://reviews.llvm.org/D6955
llvm-svn: 225945
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.
llvm-svn: 225944
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.
llvm-svn: 225943
David Majnemer [Wed, 14 Jan 2015 05:11:09 +0000 (05:11 +0000)]
Sema: Relax parsing of '#' in constraints
llvm-svn: 225942
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.
llvm-svn: 225941
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.
llvm-svn: 225940
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. ;]
llvm-svn: 225939
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.
llvm-svn: 225938
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.
llvm-svn: 225937
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.
llvm-svn: 225936
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()
llvm-svn: 225935
David Majnemer [Wed, 14 Jan 2015 02:27:38 +0000 (02:27 +0000)]
Sema: Check type compatibility with the most recent decl when merging
We would check the type information from the declaration found by lookup
but we would neglect checking compatibility with the most recent
declaration. This would make it possible for us to not correctly
diagnose inconsistencies with declarations which were made in a
different scope.
llvm-svn: 225934
NAKAMURA Takumi [Wed, 14 Jan 2015 02:24:10 +0000 (02:24 +0000)]
TargetInstrInfo.h: Fix \param in r225772. [-Wdocumentation]
llvm-svn: 225933
Rafael Espindola [Wed, 14 Jan 2015 02:23:27 +0000 (02:23 +0000)]
Another try at handling LD_LIBRARY_PATH not being defined.
llvm-svn: 225932
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.
llvm-svn: 225931
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.
llvm-svn: 225930
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:42:43 +0000 (01:42 +0000)]
Remove trailing slash from r225924
llvm-svn: 225929
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.
llvm-svn: 225928
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.
llvm-svn: 225927
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.
llvm-svn: 225926
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.
llvm-svn: 225925
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:31:34 +0000 (01:31 +0000)]
Utils: Remove unreachable break, NFC
llvm-svn: 225924
Oleksiy Vyalov [Wed, 14 Jan 2015 01:31:27 +0000 (01:31 +0000)]
Extend PipePosix with support for named pipes/timeout-based IO and integrate it with GDBRemoteCommunication / lldb-gdbserver - include reviews fixes.
http://reviews.llvm.org/D6954
llvm-svn: 225923
Adam Nemet [Wed, 14 Jan 2015 01:31:17 +0000 (01:31 +0000)]
[AVX512] Add FP unpack intrinsics
These are implemented with __builtin_shufflevector just like AVX.
We have some tests on the LLVM side to assert that these shufflevectors do
indeed generate the corresponding unpck instruction.
Part of <rdar://problem/
17688758>
llvm-svn: 225922
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:29:32 +0000 (01:29 +0000)]
Utils: Handle remapping distinct MDLocations
Part of PR21433.
llvm-svn: 225921
Jonathan Roelofs [Wed, 14 Jan 2015 01:29:04 +0000 (01:29 +0000)]
Refactor the lit config's linker flag discovery code. NFC
llvm-svn: 225920
Rafael Espindola [Wed, 14 Jan 2015 01:28:08 +0000 (01:28 +0000)]
Handle LD_LIBRARY_PATH not being defined.
Should fix the bots after r225890.
llvm-svn: 225919
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.
llvm-svn: 225918
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:22:47 +0000 (01:22 +0000)]
Utils: Extract cloneMDNode(), NFC
llvm-svn: 225917
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:21:24 +0000 (01:21 +0000)]
Utils: Move cloneMD*() up, NFC
llvm-svn: 225915
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.
llvm-svn: 225914
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.
llvm-svn: 225913
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:12:14 +0000 (01:12 +0000)]
Utils: Extract cloneMDTuple(), NFC
llvm-svn: 225912
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:08:47 +0000 (01:08 +0000)]
Utils: Extract shouldRemapUniquedNode(), NFC
llvm-svn: 225911
JF Bastien [Wed, 14 Jan 2015 01:07:51 +0000 (01:07 +0000)]
Insert random noops to increase security against ROP attacks (clang)
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 clang part of the patch.
llvm part: D3392
http://reviews.llvm.org/D3393
Patch by Stephen Crane (@rinon)
llvm-svn: 225910
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!
llvm-svn: 225909
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)
llvm-svn: 225908
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.
llvm-svn: 225907
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:07:03 +0000 (01:07 +0000)]
Utils: Simplify code, NFC
llvm-svn: 225906
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:06:21 +0000 (01:06 +0000)]
Utils: Extract mapUniquedNode(), NFC
llvm-svn: 225905
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
llvm-svn: 225904
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.
llvm-svn: 225903
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:03:05 +0000 (01:03 +0000)]
Utils: Separate out mapDistinctNode(), NFC
llvm-svn: 225902
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:02:17 +0000 (01:02 +0000)]
Utils: Use helper function directly, NFC
llvm-svn: 225901
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
llvm-svn: 225900
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.
llvm-svn: 225899
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.
llvm-svn: 225898
Duncan P. N. Exon Smith [Wed, 14 Jan 2015 01:01:19 +0000 (01:01 +0000)]
Utils: Extract helper function, NFC
llvm-svn: 225897
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()`.
llvm-svn: 225896
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.
llvm-svn: 225895
Alexey Samsonov [Wed, 14 Jan 2015 00:51:17 +0000 (00:51 +0000)]
Update HelpText for -fsanitize= option.
There are too many available sanitizers now - redirect to
user manual instead of listing them all.
llvm-svn: 225894
Eric Christopher [Wed, 14 Jan 2015 00:50:33 +0000 (00:50 +0000)]
Remove unused predicate.
llvm-svn: 225893
Eric Christopher [Wed, 14 Jan 2015 00:50:32 +0000 (00:50 +0000)]
Update for move in llvm.
llvm-svn: 225892
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.
llvm-svn: 225891
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.
llvm-svn: 225890
Richard Smith [Wed, 14 Jan 2015 00:33:10 +0000 (00:33 +0000)]
Look through sugar when determining whether a type is a scoped enumeration
type. Patch by Stephan Bergmann!
llvm-svn: 225889
David Majnemer [Wed, 14 Jan 2015 00:31:13 +0000 (00:31 +0000)]
Sema: An extern declaration can't be a redeclaration of a parameter
In the following:
void f(int x) { extern int x; }
The second declaration of 'x' shouldn't be considered a redeclaration of
the parameter.
This is a different approach to r225780.
llvm-svn: 225875
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.
llvm-svn: 225861
Rui Ueyama [Wed, 14 Jan 2015 00:21:34 +0000 (00:21 +0000)]
Revert "Convert other drivers to use WrapperNode" and subsequent commits.
r225764 broke a basic functionality on Mac OS. This change reverts
r225764, r225766, r225767, r225769, r225814, r225816, r225829, and r225832.
llvm-svn: 225859
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.
llvm-svn: 225858
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.
llvm-svn: 225857
David Blaikie [Wed, 14 Jan 2015 00:04:42 +0000 (00:04 +0000)]
Sink a parameter into the callee since it's always the same expression in terms of another parameter
llvm-svn: 225856
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.
llvm-svn: 225854
Jason Molenda [Tue, 13 Jan 2015 23:48:53 +0000 (23:48 +0000)]
Save & restore the array of which registers have already been
saved/restored across a mid-function epilogue. We ignore
repeated push/pops of a register so once we saw one 'pop %rbp',
we'd ignore it the second time we saw it.
<rdar://problem/
19417410>
llvm-svn: 225853
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.
llvm-svn: 225852
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.
llvm-svn: 225851
Adam Nemet [Tue, 13 Jan 2015 23:27:55 +0000 (23:27 +0000)]
[AVX512] Add 16x32 unpck tests as well
Forgot this from r225838.
llvm-svn: 225850
Oleksiy Vyalov [Tue, 13 Jan 2015 23:19:40 +0000 (23:19 +0000)]
Extend PipePosix with support for named pipes/timeout-based IO and integrate it with GDBRemoteCommunication / lldb-gdbserver.
http://reviews.llvm.org/D6954
llvm-svn: 225849
Adrian Prantl [Tue, 13 Jan 2015 23:11:51 +0000 (23:11 +0000)]
cleanup.
llvm-svn: 225848
Adrian Prantl [Tue, 13 Jan 2015 23:11:07 +0000 (23:11 +0000)]
Document, cleanup, and clang-format DwarfExpression.h
llvm-svn: 225847
Adrian Prantl [Tue, 13 Jan 2015 23:10:43 +0000 (23:10 +0000)]
Debug Info: Turn DIExpression::getFrameRegister() into an isFrameRegister()
function.
NFC.
llvm-svn: 225846
David Blaikie [Tue, 13 Jan 2015 23:06:27 +0000 (23:06 +0000)]
DebugInfo: Correct the location of EH cleanup for blocks
This was previously piggybacking on whatever happened to be the last
location set on CGDebugInfo/DIBuilder, which was wrong (it was often the
current location, such as the 'fn()' call site, not the end of the
block). With my improvements to set/unset the location in a scoped
manner (r225000) this went from a bad quality situation, to a crash.
Fixing this goes part-way to unblocking the recommit of r225000.
It's likely that any call to CodeGenFunction::StartFunction without the
CurEHLocation set represents a similar bug or risk of a bug. Perhaps
there are some callers that know they won't generate EH cleanups, but
I'm not sure.
I considered a generic catch-fix in StartFunction (just fallback to the
GlobalDecl's location) but that seemed like it'd mask bugs where the EH
location shouldn't be the same as the decl's location (& indeed by not
using that stop-gap I found this bug). We'll see how long I can hold out
on the generic catch-all. I might eventually be able to add an assertion
in.
llvm-svn: 225845
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.
llvm-svn: 225844
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.
llvm-svn: 225842
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.
llvm-svn: 225841
Adam Nemet [Tue, 13 Jan 2015 22:40:15 +0000 (22:40 +0000)]
Fix function names in tests from r225838.
llvm-svn: 225840
Nico Weber [Tue, 13 Jan 2015 22:32:50 +0000 (22:32 +0000)]
clang-format: [Java] Detect `native` keyword.
Before:
public native<X> Foo foo();
After:
public native <X> Foo foo();
llvm-svn: 225839
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>
llvm-svn: 225838
Adam Nemet [Tue, 13 Jan 2015 22:20:14 +0000 (22:20 +0000)]
[AVX512] Add pretty-printing of shuffle mask for unpacks
llvm-svn: 225837