Commit Graph

220106 Commits

Author SHA1 Message Date
Matthias Braun 4cc3421a24 AsmPrinter: Fix wrong OS X versions being emitted for darwin triples
The version numbers of the darwin kernel are different from the version
numbers of OS X, so we need adjustments if we had "*-*-darwin" triples.
Use the existing utility functions in TargetTriple for this.

Fixes rdar://22056966

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

llvm-svn: 257555
2016-01-13 01:18:13 +00:00
Justin Lebar 3eaaf86397 [CUDA] Report an error if code tries to mix incompatible CUDA attributes.
Summary: Thanks to jhen for helping me figure this out.

Reviewers: tra, echristo

Subscribers: jhen

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

llvm-svn: 257554
2016-01-13 01:07:35 +00:00
David Majnemer c3340db77d [CodeView] Mark our lines as statements, not expressions
The line tables for CodeView make a distinction between expressions and
statements.  As it turns out, MSVC always emits them as statements and
we always emit them as expressions.  Let's switch to statements to match
the CodeView that they emit.

llvm-svn: 257553
2016-01-13 01:05:23 +00:00
David Majnemer 0494836acd [CodeView] Improve the line table dumper
This change has us print out fields we didn't previously understand.  To
improve readability, we now group column information with it's
respective line.

llvm-svn: 257552
2016-01-13 01:05:16 +00:00
Xinliang David Li b92bc6dff2 [Coverage] Refactor coverage mapping reader code /NFC
(Resubmit after fixing build bot failures)

In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code. 
(When coveremap format version changes, backward compatibtility
should be preserved).

llvm-svn: 257551
2016-01-13 00:53:46 +00:00
Keno Fischer 25916079ff Reapply r257105 "[Verifier] Check that debug values have proper size"
The follow extra changes were made to test cases:

Manually making the variable be the actual type instead of a pointer
to avoid pointer-size differences in generic code:

    LLVM :: DebugInfo/Generic/2010-03-24-MemberFn.ll
    LLVM :: DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll
    LLVM :: DebugInfo/Generic/2010-05-03-DisableFramePtr.ll
    LLVM :: DebugInfo/Generic/varargs.ll

Delete sizing information from debug info for the same reason
(but the presence of the pointer was important to the test case):

    LLVM :: DebugInfo/Generic/restrict.ll
    LLVM :: DebugInfo/Generic/tu-composite.ll
    LLVM :: Linker/type-unique-type-array-a.ll
    LLVM :: Linker/type-unique-simple2.ll

Fixing an incorrect DW_OP_deref

    LLVM :: DebugInfo/Generic/2010-05-03-OriginDIE.ll

Fixing a missing DW_OP_deref

    LLVM :: DebugInfo/Generic/incorrect-variable-debugloc.ll

Additionally, clang should no longer complain during bootstrap should no
longer happen after r257534.

The original commit message was:
```
Summary:
Teach the Verifier to make sure that the storage size given to llvm.dbg.declare
or the value size given to llvm.dbg.value agree with what is declared in
DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA).
Additionally this catches a number of common mistakes, such as passing a
pointer when a value was intended or vice versa.

One complication comes from stack coloring which modifies the original IR when
it merges allocas in order to make sure that if AA falls back to the IR it gets
the correct result. However, given this new invariant, indiscriminately
replacing one alloca by a different (differently sized one) is no longer valid.
Fix this by just undefing out any use of the alloca in a dbg.declare in this
case.

Additionally, I had to fix a number of test cases. Of particular note:
- I regenerated dbg-changes-codegen-branch-folding.ll from the given source as
  it was affected by the bug fixed in r256077
- two-cus-from-same-file.ll was changed to avoid having a variable-typed debug
  variable as that would depend on the target, even though this test is
  supposed to be generic
- I had to manually declared size/align for reference type. See also the
  discussion for D14275/r253186.
- fpstack-debuginstr-kill.ll required changing `double` to `long double`
- most others were just a question of adding OP_deref
```

llvm-svn: 257550
2016-01-13 00:31:44 +00:00
Xinliang David Li 8c65278179 Rollback r257547 -- buildbot failure TBI
llvm-svn: 257549
2016-01-13 00:27:24 +00:00
Kevin Enderby 0ae163f9ea For llvm-objdump, add the option -private-header (without the trailing ’s’)
to only print the first private header.

Which for Mach-O files only prints the Mach header and not the subsequent load
commands.  Which is used by scripts to match what the darwin otool(1) with the
-h flag does without the -l flag.

For non-Mach-O files it has the same functionality as -private-headers (with
the trailing ’s’).

rdar://24158331

llvm-svn: 257548
2016-01-13 00:25:36 +00:00
Xinliang David Li c3498b07db [Coverage] Refactor coverage mapping reader code /NFC
In this refactoring, member functions are introduced to access
CovMap header/func record members and hide layout details. This
will enable further code restructuring to support reading multiple
versions of coverage mapping data with shared/templatized code. 
(When coveremap format version changes, backward compatibtility
should be preserved).

llvm-svn: 257547
2016-01-13 00:16:43 +00:00
Ana Pazos 359cab3bb3 Guard fabs to bfc convert with V6T2 flag
Summary:
BFC instructions are available in ARMv6T2 and above.


Reviewers: t.p.northover

Subscribers: aemerson

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

llvm-svn: 257546
2016-01-13 00:03:35 +00:00
Quentin Colombet f8e3030794 [ARM] Mark VMOV with immediate: isAsCheapAsMove.
VMOVs are not strictly speaking cheap, but they are as expensive as a vector
copy (VORR), so we should prefer rematerialization over splitting when it
applies.

rdar://problem/23754176

llvm-svn: 257545
2016-01-13 00:02:40 +00:00
Chris Bieneman 1a4ae60f5a [CMake] Adding experimental support for tvOS and watchOS
Summary:
* Refactored the iOS config-ix.cmake code to be a more compact loop over supported embedded platforms.
* Added watchOS and tvOS as experimental platforms, they don't currently build so they are disabled by default

Reviewers: zaks.anna, kubabrecka, samsonov

Subscribers: llvm-commits

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

llvm-svn: 257544
2016-01-12 23:51:03 +00:00
Frederic Riss 3ad83bd384 [Darwin] Fix deployment target detection
There was a thinko in the deployment target detection code that
made the -isysroot parsing have precedence over the environment
variable for tvOS. This patch makes this logic symetric for all
platforms (the env variable must have precedence).

llvm-svn: 257543
2016-01-12 23:47:59 +00:00
Fiona Glaser db7824f0c1 CannotBeOrderedLessThanZero: add some missing cases
llvm-svn: 257542
2016-01-12 23:37:30 +00:00
Hans Wennborg 94d6a71363 Follow-up to r257537: add test that majnemer asked about
llvm-svn: 257541
2016-01-12 23:31:58 +00:00
Rui Ueyama 4b00e7310f COFF: Update test for recent llvm-objdump change (r257539).
This test now correctly checks if the specified forwarding-to
symbol exists in the export table.

llvm-svn: 257540
2016-01-12 23:29:42 +00:00
Rui Ueyama 6161b38dbc COFF: Teach llvm-objdump how to dump DLL forwarder symbols.
llvm-svn: 257539
2016-01-12 23:28:42 +00:00
Hans Wennborg 21d73d2e0a clang-cl: Support /Dfoo#bar (PR25984)
Such flags will now be translated to -Dfoo=bar.

llvm-svn: 257537
2016-01-12 23:17:03 +00:00
Derek Schuff 4377e2d713 [WebAssembly] Fix disassembler shared-libs build
llvm-svn: 257536
2016-01-12 23:03:40 +00:00
Matthias Braun b505c76c9a RegisterPressure: Expose RegisterOperands API
Previously the RegisterOperands have only been used internally in
RegisterPressure.cpp. However this datastructure can be useful for other
tasks as well and allows refactoring of PDiff initialisation out of
RPTracker::recede().

This patch:
- Exposes RegisterOperands as public API
- Splits RPTracker::recede() into a part that skips DebugValues and
  maintains the region borders, and the core that changes register
  pressure when given a set of RegisterOperands.
- This allows to move the PDiff initialisation out recede() into a
  method of the PressureDiffs class.
- The upcoming subregister scheduling code will also use
  RegisterOperands to avoid pushing more unrelated functionality into
  recede()/advance().

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

llvm-svn: 257535
2016-01-12 22:57:35 +00:00
Keno Fischer 9aae445e09 [Utils] Insert DW_OP_bit_piece when only describing part of the variable
Summary: The dbg.declare -> dbg.value conversion looks through any zext/sext
to find a value to describe the variable (in the expectation that those
zext/sext instruction will go away later). However, those values do not
cover the entire variable and thus need a DW_OP_bit_piece.

Reviewers: aprantl
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16061

llvm-svn: 257534
2016-01-12 22:46:09 +00:00
Laszlo Nagy bc68758dd5 D9600: Add scan-build python implementation
llvm-svn: 257533
2016-01-12 22:38:41 +00:00
Nathan Slingerland 7bee316890 [Support] Add saturating multiply-add support function
Summary: Add SaturatingMultiplyAdd convenience function template since A + (X * Y) comes up frequently when doing weighted arithmetic.

Reviewers: davidxl, silvas

Subscribers: llvm-commits

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

llvm-svn: 257532
2016-01-12 22:34:00 +00:00
Siva Chandra b4f94aaf9b [TestThreadJump] Adjust match sub-string after recent change.
Reviewers: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 257531
2016-01-12 22:33:19 +00:00
Justin Lebar 29bfa893cc [CUDA] Add explicit mapping from sm_XX to compute_YY.
Summary: This is used by D16082 when it invokes fatbinary.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo

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

llvm-svn: 257530
2016-01-12 22:23:04 +00:00
Richard Smith ba3a4f917f Improve AST dumping:
1) When dumping a declaration that declares a name for a type, also dump the named type.
 2) Add a #pragma clang __debug dump X, that dumps the lookup results for X in
    the current context.

llvm-svn: 257529
2016-01-12 21:59:26 +00:00
David Majnemer c81c8c66d5 [CodeView] Initialize column-end to zero
CodeView, unlike DWARF, can associate code with a range of columns.
However, LLVM can only represent a single column position internally.

We used to claim that the end column and start column were the same
which yielded less than satisfactory results: we would stop printing at
the _beginning_ of the source expression!  Instead, mark the column-end
as 'zero' to indicate that we don't have one (as per the documentation
for IDiaLineNumber::get_lineNumberEnd).

llvm-svn: 257528
2016-01-12 21:58:20 +00:00
Rui Ueyama ab12361c4e Merge two consecutive if's. NFC.
llvm-svn: 257527
2016-01-12 21:57:44 +00:00
Dan Gohman 0656f5f845 [WebAsssembly] Register the MC register info.
llvm-svn: 257525
2016-01-12 21:27:55 +00:00
Michael Zuckerman 2ddcbcf464 [AVX512] adding PROLQ and PROLD Intrinsics
Differential Revision: http://reviews.llvm.org/D16048

llvm-svn: 257523
2016-01-12 21:19:17 +00:00
Aaron Ballman 1b47f38fd5 Add extra tests for handling throw() and noexcept() specifiers.
Patch by Adrian Zgorzałek

llvm-svn: 257522
2016-01-12 21:08:27 +00:00
Aaron Ballman 580ccaf827 Properly track the end location of an exception specification.
Patch by Adrian Zgorzałek

llvm-svn: 257521
2016-01-12 21:04:22 +00:00
Adrian Prantl 793038d31b Module debugging: Make the module format part of the module hash instead
of the file name. This is consistent with how other HeaderSearchOptions
are handled.

Due to the other inputs of the module hash (revision number) this is not
really testable in a meaningful way.

llvm-svn: 257520
2016-01-12 21:01:56 +00:00
Dan Gohman 0c6e316e89 [WebAssembly] Fix a test to work even when the integrated assembler is enabled.
Add -no-integrated-as to this test, since it's testing inline asm strings
that aren't actually valid assembly syntax.

llvm-svn: 257519
2016-01-12 21:01:30 +00:00
Kyle Butt cec40806f1 Codegen: [PPC] Handle weighted comparisons when inserting selects.
Only non-weighted predicates were handled in PPCInstrInfo::insertSelect. Handle
the weighted predicates as well.

This latent bug was triggered by r255398, because it added use of the
branch-weighted predicates.

While here, switch over an enum instead of an int to get the compiler to enforce
totality in the future.

llvm-svn: 257518
2016-01-12 21:00:43 +00:00
Dan Gohman 4635017176 [WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
A request has been made to the official registry, but an official value is
not yet available. This patch uses a temporary value in order to support
development. When an official value is recieved, the value of EM_WEBASSEMBLY
will be updated.

llvm-svn: 257517
2016-01-12 20:56:01 +00:00
Hans Wennborg 45c7439d11 Don't store CGOpenMPRegionInfo::CodeGen as a reference (PR26078)
The referenced llvm::function_ref<void(CodeGenFunction &)> object can go
away before CodeGen is used, resulting in a crash.

llvm-svn: 257516
2016-01-12 20:54:36 +00:00
Dan Gohman 73ca3ab1b4 [WebAssembly] Add ELFRelocs/WebAssembly.def as a "textual header" to the module map.
llvm-svn: 257515
2016-01-12 20:51:40 +00:00
Roman Gareev b0c4e49a37 Fix of r257495.
Remove redundant "FPM->add(createDemoteRegisterToMemoryPass());"

llvm-svn: 257514
2016-01-12 20:47:48 +00:00
Zachary Turner 9d59306528 Fix TestThreadJump on Windows.
The system can create threads for a system threadpool, so there is
no guarantee that the thread that is stopped is thread 1.  So use
a more robust check.

llvm-svn: 257513
2016-01-12 20:45:29 +00:00
Richard Smith 2de44e658d [modules] Don't diagnose a conflict between two using-declarations that name equivalent internal linkage entities.
llvm-svn: 257512
2016-01-12 20:34:32 +00:00
Dan Gohman 3469ee120c [WebAssembly] Introduce a WebAssemblyTargetStreamer class.
Refactor .param, .result, .local, and .endfunc, as directives, using the
proper MCTargetStreamer mechanism, rather than fake instructions.

llvm-svn: 257511
2016-01-12 20:30:51 +00:00
Stephane Sezer 1307d4c7df Fix build breakage of r257502.
llvm-svn: 257510
2016-01-12 20:22:58 +00:00
Dimitry Andric e18d46205c Add a clang test for r257376 (Ensure -mcpu=xscale works for arm targets).
llvm-svn: 257509
2016-01-12 19:40:55 +00:00
Krzysztof Parzyszek f62d44be28 Replace inherited constructor with an explicit one
Some bots failed when the inherited constructor was used.

llvm-svn: 257508
2016-01-12 19:27:59 +00:00
Rui Ueyama 09eb0b3b3f Rename IgnoredUndef -> Ignored since it is not an undefined symbol.
Also rename Ignored -> IgnoredWeak and IgnoredStrong -> Ignored,
since strong symbol is a norm.

llvm-svn: 257507
2016-01-12 19:24:55 +00:00
Marshall Clow df5ddf2c7a One more missing std:: qualification from Jonathan
llvm-svn: 257506
2016-01-12 19:15:10 +00:00
Dan Gohman 1d68e80f26 [WebAssembly] Make CFG stackification independent of basic-block labels.
This patch changes the way labels are referenced. Instead of referencing the
basic-block label name (eg. .LBB0_0), instructions now just have an immediate
which indicates the depth in the control-flow stack to find a label to jump to.
This makes them much closer to what we expect to have in the binary encoding,
and avoids the problem of basic-block label names not being explicit in the
binary encoding.

Also, it terminates blocks and loops with end_block and end_loop instructions,
rather than basic-block label names, for similar reasons.

This will also fix problems where two constructs appear to have the same label,
because we no longer explicitly use labels, so consumers that need labels will
presumably create their own labels, and presumably they won't reuse labels
when they do.

This patch does make the code a little more awkward to read; as a partial
mitigation, this patch also introduces comments showing where the labels are,
and comments on each branch showing where it's branching to.

llvm-svn: 257505
2016-01-12 19:14:46 +00:00
Krzysztof Parzyszek 1279881315 [Hexagon] Implement RDF-based post-RA optimizations
- Handle simple cases of register copies (what current RDF CP allows).
- Hexagon-specific dead code elimination: handles dead address updates
  in post-increment instructions.

llvm-svn: 257504
2016-01-12 19:09:01 +00:00
Sanjay Patel 53ba88dbb0 [LibCallSimplifier] use instruction-level fast-math-flags to transform pow(x, 0.5) calls
Also, propagate the FMF to the newly created sqrt() call.

llvm-svn: 257503
2016-01-12 19:06:35 +00:00