Commit Graph

215636 Commits

Author SHA1 Message Date
Zachary Turner 02bf92d226 Fix non-Windows build after r252906.
llvm-svn: 252909
2015-11-12 17:01:48 +00:00
Michael Zuckerman fd3fe9e45a [x86] translating "fp" (floating point) instructions from {fadd,fdiv,fmul,fsub,fsubr,fdivr} to {faddp,fdivp,fmulp,fsubp,fsubrp,fdivrp}
LLVM Missing the following instructions: fadd\fdiv\fmul\fsub\fsubr\fdivr.
GAS and MS supporting this instruction and lowering them in to a faddp\fdivp\fmulp\fsubp\fsubrp\fdivrp instructions.

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

llvm-svn: 252908
2015-11-12 16:58:51 +00:00
Dmitry Vyukov 8455cf0142 tsan: fix windows Go build
CompareModulesBase is an unused function.

llvm-svn: 252907
2015-11-12 16:29:24 +00:00
Zachary Turner b58fb2f47a Begin converting uses of PyCallable to PythonCallable.
PyCallable is a class that exists solely within the swig wrapper
code.  PythonCallable is a more generic implementation of the same
idea that can be used by any Python-related interop code, and lives
in PythonDataObjects.h

The CL is mostly mechanical, and it doesn't cover every possible
user of PyCallable, because I want to minimize the impact of this
change (as well as making it easier to figure out what went wrong
in case this causes a failure).  I plan to finish up the rest of
the changes in a subsequent patch, culminating in the removal of
PyCallable entirely.

llvm-svn: 252906
2015-11-12 16:23:16 +00:00
Marshall Clow 183c010c9a Implement P0074: Making owner_less more flexible
llvm-svn: 252905
2015-11-12 15:56:44 +00:00
Artyom Skrobov ab2fab926f Cull non-standard variants of ARM architectures (NFC)
Summary: Clang-side update, corresponding to D14577

Reviewers: rengolin

Subscribers: aemerson, cfe-commits, rengolin

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

llvm-svn: 252904
2015-11-12 15:52:02 +00:00
Artyom Skrobov 2c2f378f8a Cull non-standard variants of ARM architectures (NFC)
Summary:
This patch changes ARMV5, ARMV5E, ARMV6SM, ARMV6HL, ARMV7, ARMV7L,
ARMV7HL, ARMV7EM to be treated as aliases for the corresponding
standard architectures, instead of as actual architectures.

Reviewers: rengolin

Subscribers: aemerson, llvm-commits, rengolin

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

llvm-svn: 252903
2015-11-12 15:51:41 +00:00
James Molloy c16a60b63e [C++] Add the "norecurse" attribute to main() if in C++ mode
The C++ spec (3.6.1.3) says "The function `main` shall not be used within a program". This implies that it cannot recurse, so add the norecurse attribute to help the midend out a bit.

llvm-svn: 252902
2015-11-12 15:36:04 +00:00
Vasileios Kalintiris c744e120f6 Re-recommit: Add support for the new mips-mti-linux toolchain.
Last time, this caused two Windows buildbots and a single ARM buildbot to fail.
I XFAIL'd the failing test on win32,win64 machines in order to see if the ARM
buildbot complains again.

llvm-svn: 252901
2015-11-12 15:26:54 +00:00
Aaron Ballman a85d3f85df Silencing an MSVC warning about linkage specifications and C-incompatible UDTs by moving a function definition out of an extern "C" block.
llvm-svn: 252900
2015-11-12 15:25:06 +00:00
Kuba Brecka af9525dfff [tsan] Add global symbolication support into DlAddrSymbolizer
`DlAddrSymbolizer` is used on OS X when we're running inside a sandbox that prevents us from spawning an external symbolizer. This patch adds support for symbolication of globals (implements `SymbolizeData`) for `DlAddrSymbolizer`.

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

llvm-svn: 252899
2015-11-12 15:19:40 +00:00
Ramkumar Ramachandra 314b752513 Use uniqueness of C++ fully-qualified names to resolve conflicts
A very expected layout: source tree is in ~/src/llvm, the build directory is in
~/src/llvm-build, and the install location is in /usr/local/{lib,include}.

The DWARF information in /usr/local/lib/libLLVM.a for ilist.h points to
~/src/llvm-build/include/llvm/ADT/ilist.h. Now, when someone includes
"llvm/ADT/ilist.h" and links against /usr/local/lib/libLLVM.a. Disaster.

The DWARF information in libUser.so for ilist.h points to two locations: the one
in /usr/include, and the one in ~/src/llvm-build/include. LLDB gets confused.

Let's uniquify fully-qualified names and never trip on such a thing.

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

llvm-svn: 252898
2015-11-12 14:44:24 +00:00
Hans Wennborg 7384a2de02 Revert r252858: "[WebAssembly] Switch to MC for instruction printing."
It broke the CMake build:

"Cannot find source file: WebAssemblyRegNumbering.cpp"

llvm-svn: 252897
2015-11-12 14:37:56 +00:00
Kuba Brecka 3ecce92a52 [tsan] Allow symbolizers that don't obtain global symbol sizes
The default symbolizer, `llvm-symbolizer` provides sizes for global symbols. On OS X, we want to also allow using `atos` (because it's available everywhere and users don't need to copy/install it) and `dladdr` (it's the only available option when running in a sandbox). However, these symbolizers do not supply the symbol sizes, only names and starting addresses. This patch changes the reporting functions to hide the size of the symbol when this value is unavailable, and modifies tests to make this part of the report "optional".

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

llvm-svn: 252896
2015-11-12 14:34:17 +00:00
Vasileios Kalintiris 48e0256ed6 Re-apply "[mips] Use correct frame register for DWARF info when dynamically realigning the stack.""
r252219 reversed the direction of subprogram -> function edge. Fixed the
IR to account for this.

llvm-svn: 252895
2015-11-12 14:11:43 +00:00
Tobias Grosser 2ac2338a03 ScopInfo: Add function to retrieve all memory accesses in a scop
llvm-svn: 252894
2015-11-12 14:07:13 +00:00
Tobias Grosser e5a3514e4a ScopInfo: Use lambda functions to reduce code duplication.
llvm-svn: 252893
2015-11-12 14:07:09 +00:00
Dmitry Vyukov bab2216dbb tsan: disable abort_on_error for Go
It does not work as expected.
Go runtime handles SIGABRT and crashes with a loud message.

llvm-svn: 252892
2015-11-12 14:03:20 +00:00
James Molloy 8e99e97f2a [ARM] CMOV->BFI combining: handle both senses of CMPZ
I completely misunderstood what ARMISD::CMPZ means. It's not "compare equal to zero", it's "compare, only setting the zero/Z flag". It can either be equal-to-zero or not-equal-to-zero, and we weren't checking what sense it was.

If it's equal-to-zero, we can swap the operands around and pretend like it is not-equal-to-zero, which is both a bug fix and lets us handle more cases.

llvm-svn: 252891
2015-11-12 13:49:17 +00:00
Ismail Donmez 19a17c3a16 Fix c-index-test install path
llvm-svn: 252890
2015-11-12 13:47:35 +00:00
Renato Golin 93064025bd Revert "[ARM] Enable shrink-wrapping by default."
This reverts commit r252825, as it broke ASAN on ARM. Investigating...

llvm-svn: 252889
2015-11-12 13:34:50 +00:00
Daniel Sanders 9f6ad49740 Implement .reloc (constant offset only) with support for R_MIPS_NONE and R_MIPS_32.
Summary:
Support for R_MIPS_NONE allows us to parse MIPS16's usage of .reloc.
R_MIPS_32 was included to be able to better test the directive.

Targets can add their relocations by overriding MCAsmBackend::getFixupKind().

Subscribers: grosbach, rafael, majnemer, dsanders, llvm-commits

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

llvm-svn: 252888
2015-11-12 13:33:00 +00:00
Kuba Brecka e342469c0a [tsan] Add a Darwin-specific lit test directory
Differential Revision: http://reviews.llvm.org/D14610

llvm-svn: 252887
2015-11-12 13:27:55 +00:00
Zlatko Buljan 797c2aec6b [mips][microMIPS] Implement LWM16, SB16, SH16, SW16, SWSP and SWM16 instructions
Differential Revision: http://reviews.llvm.org/D11406

llvm-svn: 252885
2015-11-12 13:21:33 +00:00
Vasileios Kalintiris d38860610d Revert "[mips] Use correct frame register for DWARF info when dynamically realigning the stack."
This reverts commit r252882. LLParser complains for invalid field 'function'
in DISubprogram.

llvm-svn: 252884
2015-11-12 13:19:11 +00:00
Hans Wennborg e7b5fac652 Remove mention of {ADD,SUB}_PARTS. They were removed in r26255.
llvm-svn: 252883
2015-11-12 13:18:20 +00:00
Vasileios Kalintiris 352eb55baf [mips] Use correct frame register for DWARF info when dynamically realigning the stack.
Summary:
This patch overrides TargetFrameLowering::getFrameIndexReference() in order to
specify the correct register when the function needs dynamic stack realignment.
The values returned from this function are used in order to create DW_AT_locations
for DWARF info. These locations would use the wrong registers as it's been
reported in PR25028.

Reviewers: dsanders

Subscribers: dean, llvm-commits

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

llvm-svn: 252882
2015-11-12 13:04:16 +00:00
James Molloy 2d09c00b91 [InstCombine] Add trivial folding (bitreverse (bitreverse x)) -> x
There are plenty more instcombines we could probably do with bitreverse, but this seems like a very obvious and trivial starting point and was brought up by Hal in his review.

llvm-svn: 252879
2015-11-12 12:39:41 +00:00
James Molloy 90111f79f9 [SDAG] Introduce a new BITREVERSE node along with a corresponding LLVM intrinsic
Several backends have instructions to reverse the order of bits in an integer. Conceptually matching such patterns is similar to @llvm.bswap, and it was mentioned in http://reviews.llvm.org/D14234 that it would be best if these patterns were matched in InstCombine instead of reimplemented in every different target.

This patch introduces an intrinsic @llvm.bitreverse.i* that operates similarly to @llvm.bswap. For plumbing purposes there is also a new ISD node ISD::BITREVERSE, with simple expansion and promotion support.

The intention is that InstCombine's BSWAP detection logic will be extended to support BITREVERSE too, and @llvm.bitreverse intrinsics emitted (if the backend supports lowering it efficiently).

llvm-svn: 252878
2015-11-12 12:29:09 +00:00
Dmitry Vyukov 110094017c tsan: fix Go build on linux
librt is not linked in in Go build.

llvm-svn: 252877
2015-11-12 11:54:25 +00:00
Kuba Brecka ba85da8482 [asan] Remove system_malloc_zone
This seems to be dead code – `system_malloc_zone` is initialized as null and we never assign to it. This code is apparently currently never executed (in ASan), but is causes trouble for the TSan OS X port. Let's replace the checks with `COMMON_MALLOC_ENTER` (`ENSURE_ASAN_INITED()`).

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

llvm-svn: 252876
2015-11-12 11:29:21 +00:00
Dmitry Vyukov 317e98b1a2 tsan: fix unused function warning in Go build
llvm-svn: 252875
2015-11-12 11:14:35 +00:00
Dmitry Vyukov 1421ed42a6 tsan: fix mac Go build
cur_thread does not exist in Go.

llvm-svn: 252874
2015-11-12 11:12:18 +00:00
Kuba Brecka 14fb164a8e [tsan] Filter OS X architectures for unit testing
The TSan unit test build currently fails if we're also building the iOS parts of compiler-rt, because `TSAN_SUPPORTED_ARCH` contains ARM64. For unit tests, we need to filter this only to host architecture(s).

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

llvm-svn: 252873
2015-11-12 11:00:38 +00:00
James Molloy 57207ce922 Update clang regression tests for 'norecurse'
FunctionAttrs has just been taught how to infer 'norecurse'. Update clang tests for LLVM r252871.

llvm-svn: 252872
2015-11-12 10:56:51 +00:00
James Molloy 7e9bdd5d01 Revert "Revert "[FunctionAttrs] Identify norecurse functions""
This reapplies this patch, with test fixes.

llvm-svn: 252871
2015-11-12 10:55:20 +00:00
Asiri Rathnayake ea4282d336 [libcxx] Fixup a few fumbles in the initial no-exceptions XFAILs list.
The initial buildbot run found a few missing bits in the initial XFAIL list
for the no-exceptions libc++ variant. These discrepancies are as follows:

[1] Following two tests need XFAILs on the no-exceptions library variant.
My local runs had these two disabled for other reasons (unsupported):

  - localization/locales/locale/locale.cons/char_pointer.pass.cpp
  - numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp

[2] These three does not need XFAILs, they were failing on my local runs for
other reasons:

  - depr/depr.c.headers/uchar_h.pass.cpp
  - input.output/iostreams.base/ios/basic.ios.members/copyfmt.pass.cpp
  - .../category.collate/locale.collate.byname/transform.pass.cpp

(these are failing on my box for the default build as well)

The current patch fixes both the cases above. Additionally, I've run the
following scan to make sure I've covered all the cases:

> grep ' catch \| try \| throw ' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \
  uniq > 1.txt
> grep 'libcpp-no-exceptions' -R . | perl -pe 's|(.*?):.*|\1|' | sort | \
  uniq > 2.txt
> diff 1.txt 2.txt

This showed up a few extra interesting cases:

[3] These two tests do not use try/catch/throw statements, but they fail at
runtime. Need to be investigated, I've left the XFAILs in.

  - std/thread/futures/futures.shared_future/dtor.pass.cpp
  - std/thread/futures/futures.unique_future/dtor.pass.cpp

[4] These tests use a macro named TEST_HAS_NO_EXCEPTIONS to conditionally
exclude try/catch/throw statements when running without exceptions. I'm not
entirely sure why this was needed (AFAIK, we didn't have a no-exceptions
library build before). The macro's defintion is quite similar to that of
_LIBCPP_NO_EXCEPTIONS. I will investigate if this can be reused for my test
fixes or if it should be replaced with _LIBCPP_NO_EXCEPTIONS.

  - std/experimental/any/*

Change-Id: I9ad1e0edd78f305406eaa0ab148b1ab693f7e26a
llvm-svn: 252870
2015-11-12 10:41:57 +00:00
Dmitry Vyukov 1041aabbb0 tsan: fix flakiness of sleep_sync2 test
llvm-svn: 252869
2015-11-12 10:24:22 +00:00
Denis Protivensky 8e3b38aba1 [ELF2] SECTIONS command basic support
* determine output section by input section name
* discard input sections
* order output sections accordingly

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

llvm-svn: 252868
2015-11-12 09:52:08 +00:00
Kuba Brecka de8332257b [Object, MachO] Mark symbols from DATA and BSS sections as ST_Data
In `MachOObjectFile::getSymbolType` we currently always return `SymbolRef::ST_Function` for symbols from any section. In order for llvm-symbolizer to correctly symbolize Mach-O globals, symbols from data and BSS sections should return `SymbolRef::ST_Data`.

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

llvm-svn: 252867
2015-11-12 09:40:29 +00:00
Amjad Aboud e59cc3e540 dwarfdump: Added macro support to llvm-dwarfdump tool.
Added "macro" option to "-debug-dump" flag, which trigger parsing and dumping of the ".debug_macinfo" section.

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

llvm-svn: 252866
2015-11-12 09:38:54 +00:00
Dylan McKay c498ba3a3e Add AVR backend skeleton
This adds part of the target info code, and adds modifications to
the build scripts so that AVR is recognized a supported, experimental
backend.

It does not include any AVR-specific code, just the bare sources required
for a backend to exist.

From D14039.

llvm-svn: 252865
2015-11-12 09:26:44 +00:00
Denis Protivensky 1b1b34ef95 [ELF2] Fix gcc warning in section kind switch
llvm-svn: 252864
2015-11-12 09:11:20 +00:00
James Molloy 9a32da74f7 Revert "[FunctionAttrs] Identify norecurse functions"
This reverts commit r252862. This introduced test failures and I'm reverting while I investigate how this happened.

llvm-svn: 252863
2015-11-12 09:05:43 +00:00
James Molloy b14994e752 [FunctionAttrs] Identify norecurse functions
A function can be marked as norecurse if:
  * The SCC to which it belongs has cardinality 1; and either
    a) It does not call any non-norecurse function. This includes self-recursion; or
    b) It only has one callsite and the function that callsite is within is marked norecurse.

a) is best propagated bottom-up and b) is best propagated top-down.

We build up the norecurse attributes bottom-up using the existing SCC pass, and mark functions with no obvious recursion (but not provably norecurse) to sweep later, top-down.

llvm-svn: 252862
2015-11-12 08:53:04 +00:00
Craig Topper 71a51ff10e Use %select to merge two diagnostics that only differ in one word and are emitted in the same place. NFC
llvm-svn: 252861
2015-11-12 07:36:50 +00:00
Tobias Grosser bc29e0b27c RegionGenerator: Only introduce subregion.ivs for loops fully within a subregion
IVs of loops for which the loop header is in the subregion, but not the entire
loop may be incremented outside of the subregion and can consequently not be
kept private to the subregion. Instead, they need to and are modeled as virtual
loops in the iteration domains. As this is the case, generating new subregion
induction variables for such loops is not needed and indeed wrong as they would
hide the virtual induction variables modeled in the scop.

This fixes a miscompile in MultiSource/Benchmarks/Ptrdist/bc and
MultiSource/Benchmarks/nbench/. Thanks Michael and Johannes for their
investiagations and helpful observations regarding this bug.

llvm-svn: 252860
2015-11-12 07:34:09 +00:00
David Blaikie 6400fc146e Mostly revert 252842 due to failures on some buildbots.
I imagine there's some UB in here somewhere, though Valgrind doesn't
seem to have picked it up (not sure if I have a working asan build right
now to test there).

GDB bot seems to be crashing:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/26267/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test

Hexagon ELF bot is, presumably, just getting different output:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/32927/steps/check-all/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dwp.test

llvm-svn: 252859
2015-11-12 06:33:14 +00:00
Dan Gohman 9dd55a8065 [WebAssembly] Switch to MC for instruction printing.
This encompasses several changes which are all interconnected:
 - Use the MC framework for printing almost all instructions.
 - AsmStrings are now live.
 - This introduces an indirection between LLVM vregs and WebAssembly registers,
   and a new pass, WebAssemblyRegNumbering, for computing a basic the mapping.
   This addresses some basic issues with argument registers and unused registers.
 - The way ARGUMENT instructions are handled no longer generates redundant
   get_local+set_local for every argument.

This also changes the assembly syntax somewhat; most notably, MC's printing
use sigils on label names, so those are no longer present, and push/pop now
have a sigil to keep them unambiguous.

The usage of set_local/get_local/$push/$pop will continue to evolve
significantly. This patch is just one step of a larger change.

llvm-svn: 252858
2015-11-12 06:10:03 +00:00
Igor Kudrin 304860ab67 [ELF2] Add mandatory .dynamic section entries on MIPS.
The MIPS target requires specific dynamic section entries to be defined.

 * DT_MIPS_RLD_VERSION and DT_MIPS_FLAGS store predefined values.
 * DT_MIPS_BASE_ADDRESS holds base VA.
 * DT_MIPS_LOCAL_GOTNO holds the number of local GOT entries.
 * DT_MIPS_SYMTABNO holds the number of .dynsym entries.
 * DT_MIPS_GOTSYM holds the index of the .dynsym entry
   which corresponds to the first entry of the global part of GOT.
 * DT_MIPS_RLD_MAP holds the address of the reserved space in the data segment.
 * DT_MIPS_PLTGOT points to the .got.plt section if it exists.
 * DT_PLTGOT holds the address of the GOT section.

See "Dynamic Section" in Chapter 5 in the following document for detailed
description: ftp://www.linux-mips.org/pub/linux/mips/doc/ABI/mipsabi.pdf

Differential revision: http://reviews.llvm.org/D14450

llvm-svn: 252857
2015-11-12 04:39:49 +00:00