Commit Graph

213342 Commits

Author SHA1 Message Date
Lang Hames 98c2ac13d3 [Orc] Add support for emitting indirect stubs directly into the JIT target's
memory, rather than representing the stubs in IR. Update the CompileOnDemand
layer to use this functionality.

Directly emitting stubs is much cheaper than building them in IR and codegen'ing
them (see below). It also plays well with remote JITing - stubs can be emitted
directly in the target process, rather than having to send them over the wire.

The downsides are:

(1) Care must be taken when resolving symbols, as stub symbols are held in a
    separate symbol table. This is only a problem for layer writers and other
    people using this API directly. The CompileOnDemand layer hides this detail.

(2) Aliases of function stubs can't be symbolic any more (since there's no
    symbol definition in IR), but must be converted into a constant pointer
    expression. This means that modules containing aliases of stubs cannot be
    cached. In practice this is unlikely to be a problem: There's no benefit to
    caching such a module anyway.

On balance I think the extra performance is more than worth the trade-offs: In a
simple stress test with 10000 dummy functions requiring stubs and a single
executed "hello world" main function, directly emitting stubs reduced user time
for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct
emission).

llvm-svn: 250712
2015-10-19 17:43:51 +00:00
George Rimar 83f406cff5 [ELF2] - Linker script EXTERN command implemented.
The reason of collecting all undefines in vector is that during reading files we already need to have Symtab created. Or like was done in that patch - to put undefines from scripts somewhere to delay Symtab.addUndefinedOpt() call.

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

llvm-svn: 250711
2015-10-19 17:35:12 +00:00
Zachary Turner 2adc80107a Py3'ify some of the examples that get run at startup.
Even though these are under examples/, they actually get loaded
when LLDB starts up during initialization of ScriptInterpreterPython.
There's obviously some kind of layering issue here (and comments
in the code even point to that as well), but for now just make them
py3 compatible.

llvm-svn: 250710
2015-10-19 17:35:02 +00:00
Zachary Turner e24ad03ae6 Disable libxml2 on Windows for now.
Newer versions of CMake include a "smarter" FindLibxml2 package.
In theory this is a good thing, but on Windows it's now smart
enough to find the version that comes with Gnuwin32, which doesn't
appear to be a valid libxml2 distribution.  Or at the very least,
LLDB currently uses some header files from libxml2 that are not
part of this distribution.

Nobody on Windows is using any of this functionality right now
anyway, so just disable it.

llvm-svn: 250709
2015-10-19 17:34:51 +00:00
Dimitry Andric 9b8c353c90 On FreeBSD, PTHREADS_THREADS_MAX does not fit into an int, leading to
warnings similar to the following:

    runtime/src/kmp_global.c:117:35: warning: implicit conversion from
    'unsigned long' to 'int' changes value from 18446744073709551615 to -1
    [-Wconstant-conversion]
    int           __kmp_sys_max_nth = KMP_MAX_NTH;
                  ~~~~~~~~~~~~~~~~~   ^~~~~~~~~~~
    runtime/src/kmp.h:849:34: note: expanded from macro 'KMP_MAX_NTH'
    #    define KMP_MAX_NTH          PTHREAD_THREADS_MAX
                                     ^~~~~~~~~~~~~~~~~~~

Clamp KMP_MAX_NTH to INT_MAX to avoid these warnings.  Also use INT_MAX
whenever PTHREAD_THREADS_MAX is not defined at all.

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

llvm-svn: 250708
2015-10-19 17:32:04 +00:00
Nico Weber 3cb667edaa clang-format: Use pipes instead of temporary files for most lit tests.
This makes the format tests look more like most other FileCheck tests in clang.

The multiple-inputs tests still use temp files, to make sure that the file
input code in clang-format stays tested.

Stop stripping out the comment lines in style-on-command-line.cpp as they don't
get in the way and it makes the test simpler. Also remove 2>&1s on the tests in
that file that don't need it.

http://reviews.llvm.org/D13852

llvm-svn: 250706
2015-10-19 16:21:29 +00:00
Diego Novillo 843dc6ffbf Sample Profiles - Fix location of binary encoding documentation. NFC.
llvm-svn: 250705
2015-10-19 15:53:17 +00:00
Teresa Johnson 8af8d4ed93 Convert gold-plugin unnecessary unique_ptr into local (NFC)
llvm-svn: 250704
2015-10-19 15:23:03 +00:00
Teresa Johnson a80b50820b Fix required library for r250699 to BitWriter instead of BitReader.
This should fix the mingw3 bot failure.

llvm-svn: 250703
2015-10-19 15:21:46 +00:00
Rafael Espindola 334c3e11e6 Delay the relocation scan.
We have to scan the relaxations after every symbol is defined.

This fixes pr25218.

llvm-svn: 250702
2015-10-19 15:21:42 +00:00
Teresa Johnson bd715d4702 Fix windows bot failures from r250699 by removing "/" from expected path
in test output.

llvm-svn: 250701
2015-10-19 15:19:02 +00:00
Omair Javaid 5cf948d299 Fix for random watchpoint testsuite failures on AArch64 targets.
This patch corrects the number of bytes of debug register resources which are written while installing or removing a breakpoint using ptrace interface on arm64 targets.

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

llvm-svn: 250700
2015-10-19 14:54:33 +00:00
Teresa Johnson 91a88bba0e llvm-lto support for generating combined function indexes
Summary:
This patch adds support to llvm-lto that mirrors the support added by
r249270 to the gold plugin. This enables better testing of combined
index generation for ThinLTO.

Added a new test, and this support will be used in the test in D13515.

Reviewers: joker.eph

Subscribers: llvm-commits

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

llvm-svn: 250699
2015-10-19 14:30:44 +00:00
Benjamin Kramer 335332329b Remove CRLF newlines. NFC.
llvm-svn: 250698
2015-10-19 13:05:25 +00:00
Asiri Rathnayake 1040a53be3 Fix mapping of @llvm.arm.ssat/usat intrinsics to ssat/usat instructions
The mapping of these two intrinsics in ARMInstrInfo.td had a small
omission which lead to their operands not being validated/transformed
before being lowered into usat and ssat instructions. This can cause
incorrect instructions to be emitted.

I've also added tests for the remaining two saturating arithmatic
intrinsics @llvm.arm.qadd and @llvm.arm.qsub as they are missing
codegen tests.

llvm-svn: 250697
2015-10-19 11:44:24 +00:00
Sagar Thakur b997792cc6 [LLDB][MIPS] Use the correct ptrace buffer for writing register value for o32 applications
For o32 applications on mips we were getting segmentation fault while launching lldb-server because of overwritting stack when using elf_gregset_t in DoWriteRegisterValue.
We are now using the GPR_mips_linux buffer in DoWriteRegisterValue as done in DoReadRegisterValue also, which solves the above issue.

llvm-svn: 250696
2015-10-19 11:21:20 +00:00
Michael Kruse 48ea8efd59 Correct typo in CHECK line
Thanks Tobias for the hint.

llvm-svn: 250695
2015-10-19 10:51:20 +00:00
Marek Kurdej e5c485c70b Added new options to ClangFormat VSIX package.
Summary:
Added new options to ClangFormat VSIX package:
* fallback-style
* assume-filename
* sort-includes.
Changed version to 1.1 (otherwise one couldn't update).

Fixed clang-format escaping of XML reserved characters.

Reviewers: hans, aaron.ballman, klimek, rnk, zturner

Subscribers: djasper, cfe-commits

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

llvm-svn: 250694
2015-10-19 10:08:35 +00:00
Michael Kruse dc12222287 Synthesize phi arguments in incoming block
New values were always synthesized in the block of the instruction
that needed them. This is incorrect for PHI node whose' value must be
defined in the respective incoming block. This patch temporarily moves
the builder's insert point to the incoming block while synthesizing phi
node arguments. 

This fixes PR25241 (http://llvm.org/bugs/show_bug.cgi?id=25241)

llvm-svn: 250693
2015-10-19 09:19:25 +00:00
James Molloy 17379c4ea1 [GlobalsAA] Fix a really horrible iterator invalidation bug
We were keeping a reference to an object in a DenseMap then mutating it. At the end of the function we were attempting to clone that reference into other keys in the DenseMap, but DenseMap may well decide to resize its hashtable which would invalidate the reference!

It took an extremely complex testcase to catch this - many thanks to Zhendong Su for catching it in PR25225.

This fixes PR25225.

llvm-svn: 250692
2015-10-19 08:54:59 +00:00
Manuel Klimek ab2e28ebaf Fix 'will be initialized after' warning.
llvm-svn: 250691
2015-10-19 08:43:46 +00:00
Manuel Klimek 74ca428df7 Make test not rely on %T ending on /Output.
llvm-svn: 250690
2015-10-19 08:27:51 +00:00
Michael Kuperstein b1ec50d56a [X86] Enable soft float ABI for x86
The Intel MCU psABI requires floating-point values to be passed in-reg.
This makes the x86-32 ABI code respect "-mfloat-abi soft" and generate float inreg arguments.

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

llvm-svn: 250689
2015-10-19 08:09:43 +00:00
Igor Kudrin ea6a835f4e [ELF2] In/out parameter of writeGlobalSymbols() is changed to in parameter.
There is no outer code which requires the changed value.

llvm-svn: 250688
2015-10-19 08:01:51 +00:00
Michael Kuperstein dc74520432 Use saner variable names. NFC.
llvm-svn: 250687
2015-10-19 07:52:25 +00:00
Elena Demikhovsky 20662e39f1 Removed parameter "Consecutive" from isLegalMaskedLoad() / isLegalMaskedStore().
Originally I planned to use the same interface for masked gather/scatter and set isConsecutive to "false" in this case.

Now I'm implementing masked gather/scatter and see that the interface is inconvenient. I want to add interfaces isLegalMaskedGather() / isLegalMaskedScatter() instead of using the "Consecutive" parameter in the existing interfaces.

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

llvm-svn: 250686
2015-10-19 07:43:38 +00:00
Zlatko Buljan 5292083584 [mips][microMIPS] Implement ADDQ.PH, ADDQ_S.W, ADDQH.PH, ADDQH.W, ADDSC, ADDU.PH, ADDU_S.QB, ADDWC and ADDUH.QB instructions
Differential Revision: http://reviews.llvm.org/D13130

llvm-svn: 250685
2015-10-19 07:16:26 +00:00
Alexey Bataev 1d97d2a3d2 [OPENMP] Fix for http://llvm.org/PR25221: Infinite loop while parsing OpenMP directive
Clang skipped annot_pragma_openmp token, while it should be considered as a stop token while skipping tokens.

llvm-svn: 250684
2015-10-19 06:40:17 +00:00
Zlatko Buljan d0a7d6e4ee [mips][microMIPS] Implement ABSQ.QB, ABSQ_S.PH, ABSQ_S.W, ABSQ_S.QB, INSV, MADD, MADDU, MSUB, MSUBU, MULT and MULTU instructions
Differential Revision: http://reviews.llvm.org/D13721

llvm-svn: 250683
2015-10-19 06:34:44 +00:00
Rafael Espindola 69535df0e9 Mark R_X86_64_PLT32 as relative.
llvm-svn: 250682
2015-10-19 05:20:01 +00:00
Craig Topper 6c03a54444 Make getTargetBuiltins return an ArrayRef instead of having two out parameters of a pointer and length. NFC
llvm-svn: 250681
2015-10-19 04:51:35 +00:00
Xinliang David Li d7134ead18 [PGO] Eliminate prof data register calls on FreeBSD platform
This is a follow up patch of r250199 after verifying the start/stop
section symbols work as spected on FreeBSD.

llvm-svn: 250680
2015-10-19 04:17:19 +00:00
Xinliang David Li aa0592cc70 [PGO] Eliminate prof data register calls on FreeBSD platform
This is a follow up patch of r250199 after verifying the start/stop
section symbols work as spected on FreeBSD.

llvm-svn: 250679
2015-10-19 04:17:10 +00:00
Craig Topper f054e3ad6d Recommit "Return an ArrayRef instead of having two out parameters of a pointer and length. NFC". Hopefully this time the bots will be happy.
llvm-svn: 250678
2015-10-19 03:52:27 +00:00
Craig Topper d255c00acd Revert r250676 "Return an ArrayRef instead of having two out parameters of a pointer and length. NFC"
llvm-svn: 250677
2015-10-19 03:17:00 +00:00
Craig Topper 9c4d9b2316 Return an ArrayRef instead of having two out parameters of a pointer and length. NFC
llvm-svn: 250676
2015-10-19 03:05:12 +00:00
Nico Weber afa62fae1e clang-format: Extend main header include sorting heuristic to Objective-C files.
llvm-svn: 250675
2015-10-19 01:36:09 +00:00
Saleem Abdulrasool 7f66d75832 docs: remote stale refs
Since the attribute documentation is now auto-generated, the previous references
are no longer valid.  This prevented the docs build from completing
successfully.

llvm-svn: 250674
2015-10-19 01:24:08 +00:00
Saleem Abdulrasool a8bf774b96 Python: follow python guidelines for header usage
Python requires that Python.h is included before any std header.  Not doing so
results in conflicts with standards macros such as `_XOPEN_SOURCE`.  NFC.

llvm-svn: 250673
2015-10-19 01:16:17 +00:00
Nico Weber 187fcf1e5d Update `clang-format -help` output in clang-format docs.
-assume-filename, -fallback-style, and -sort-includes are new.  (They're also
longer than the previous options, so all descriptions shift over by some amount,
making this diff look larger than it is.)

It looks like someone renamed "General options" to "Generic Options" too.

llvm-svn: 250672
2015-10-19 01:08:30 +00:00
Nico Weber 373ee96e73 Update list of languages advertised in OVERVIEW: A tool to format C/C++/Java/JavaScript/Objective-C/Protobuf code.
If no arguments are specified, it formats the code from standard input
and writes the result to the standard output.
If <file>s are given, it reformats the files. If -i is specified
together with <file>s, the files are edited in-place. Otherwise, the
result is written to the standard output.

USAGE: clang-format [options] [<file> ...]

OPTIONS:
  -assume-filename=<string> - When reading from stdin, clang-format assumes this
                              filename to look for a style config file (with
                              -style=file) and to determine the language.
  -cursor=<uint>            - The position of the cursor when invoking
                              clang-format from an editor integration
  -dump-config              - Dump configuration options to stdout and exit.
                              Can be used with -style option.
  -fallback-style=<string>  - The name of the predefined style used as a
                              fallback in case clang-format is invoked with
                              -style=file, but can not find the .clang-format
                              file to use.
                              Use -fallback-style=none to skip formatting.
  -help                     - Display available options (-help-hidden for more)
  -i                        - Inplace edit <file>s, if specified.
  -length=<uint>            - Format a range of this length (in bytes).
                              Multiple ranges can be formatted by specifying
                              several -offset and -length pairs.
                              When only a single -offset is specified without
                              -length, clang-format will format up to the end
                              of the file.
                              Can only be used with one input file.
  -lines=<string>           - <start line>:<end line> - format a range of
                              lines (both 1-based).
                              Multiple ranges can be formatted by specifying
                              several -lines arguments.
                              Can't be used with -offset and -length.
                              Can only be used with one input file.
  -offset=<uint>            - Format a range starting at this byte offset.
                              Multiple ranges can be formatted by specifying
                              several -offset and -length pairs.
                              Can only be used with one input file.
  -output-replacements-xml  - Output replacements as XML.
  -sort-includes            - Sort touched include lines
  -style=<string>           - Coding style, currently supports:
                                LLVM, Google, Chromium, Mozilla, WebKit.
                              Use -style=file to load style configuration from
                              .clang-format file located in one of the parent
                              directories of the source file (or current
                              directory for stdin).
                              Use -style="{key: value, ...}" to set specific
                              parameters, e.g.:
                                -style="{BasedOnStyle: llvm, IndentWidth: 8}"
  -version                  - Display the version of this program output.

llvm-svn: 250671
2015-10-19 01:03:19 +00:00
Johannes Doerfert 9c28bfa72c [FIX] Only constant integer branch conditions are always affine
There are several different kinds of constants that could occur in a
  branch condition, however we can only handle the most interesting one
  namely constant integers. To this end we have to treat others as
  non-affine.

  This fixes bug 25244.

llvm-svn: 250669
2015-10-18 22:56:42 +00:00
Johannes Doerfert 30c2265f98 [FIX] Normalize loops outside the SCoP during schedule generation
We build the schedule based on a traversal of the region and accumulate
  information for each loop in it. The total schedule is associated with the
  loop surrounding the SCoP, though it can happen that there are blocks in the
  SCoP which are part of loops that are only partially in the SCoP. Instead of
  associating information with them (they are not part of the SCoP and
  consequently are not modeled) we have to associate the schedule information
  with the surrounding loop if any.

  This fixes bug 25240.

llvm-svn: 250668
2015-10-18 21:17:11 +00:00
Saleem Abdulrasool 43d3a7ae01 Silence -Wreturn-type with gcc 5.2
The switch is fully covered, mark "default" as unreachable.  NFC.

llvm-svn: 250667
2015-10-18 20:51:18 +00:00
Nick Lewycky 4b81fc87ad No functionality change, just fix whitespace, a typo and remove an unnecessary
emacs mode marker. (Changes left behind from another patch that ended up not
working out.)

llvm-svn: 250666
2015-10-18 20:32:12 +00:00
Saleem Abdulrasool b25445cb48 CodeGen: simplify TargetOptions setup
Do direct assignment of boolean values and regroup.  Use StringSwitch instead of
custom cases.  NFC.

llvm-svn: 250665
2015-10-18 20:24:53 +00:00
Johannes Doerfert b864c2c3c9 [FIX] Do not try to hoist "empty" accesses
Accesses that have a relative offset (in bytes) that is not divisible
  by the type size (in bytes) will be represented as empty in the SCoP
  description. This is on its own not good but it also crashed the
  invariant load hoisting. This patch will fix the latter problem while
  the former should be addressed too.

  This fixes bug 25236.

llvm-svn: 250664
2015-10-18 19:50:18 +00:00
Johannes Doerfert bc7cff4c18 [FIX] Do not hoist invariant pointers with non-loaded base ptr in SCoP
If the base pointer of a load is invariant and defined in the SCoP but
  not loaded we cannot hoist the load as we would not hoist the base
  pointer definition.

  This fixes bug 25237.

llvm-svn: 250663
2015-10-18 19:49:25 +00:00
Saleem Abdulrasool ba507b04e1 Silence -Wqual-cast warnings from GCC 5.2
There were a number of const qualifiers being cast away which caused warnings.
This cluttered the output hiding real errors.  Silence them by explicit casting.
NFC.

llvm-svn: 250662
2015-10-18 19:34:38 +00:00
Saleem Abdulrasool 8b8d2a4d99 Silence some -Wunused-but-set-variable with gcc 5.2.0
Cleanup some unused variables.  NFC.

llvm-svn: 250661
2015-10-18 19:34:31 +00:00