7 years ago[CodeView] Initialize column-end to zero
David Majnemer [Tue, 12 Jan 2016 21:58:20 +0000 (21:58 +0000)]
[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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257528 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAsssembly] Register the MC register info.
Dan Gohman [Tue, 12 Jan 2016 21:27:55 +0000 (21:27 +0000)]
[WebAsssembly] Register the MC register info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257525 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] adding PROLQ and PROLD Intrinsics
Michael Zuckerman [Tue, 12 Jan 2016 21:19:17 +0000 (21:19 +0000)]
[AVX512] adding PROLQ and PROLD Intrinsics

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257523 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Fix a test to work even when the integrated assembler is enabled.
Dan Gohman [Tue, 12 Jan 2016 21:01:30 +0000 (21:01 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257519 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCodegen: [PPC] Handle weighted comparisons when inserting selects.
Kyle Butt [Tue, 12 Jan 2016 21:00:43 +0000 (21:00 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257518 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
Dan Gohman [Tue, 12 Jan 2016 20:56:01 +0000 (20:56 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257517 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Add ELFRelocs/WebAssembly.def as a "textual header" to the module map.
Dan Gohman [Tue, 12 Jan 2016 20:51:40 +0000 (20:51 +0000)]
[WebAssembly] Add ELFRelocs/WebAssembly.def as a "textual header" to the module map.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257515 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Introduce a WebAssemblyTargetStreamer class.
Dan Gohman [Tue, 12 Jan 2016 20:30:51 +0000 (20:30 +0000)]
[WebAssembly] Introduce a WebAssemblyTargetStreamer class.

Refactor .param, .result, .local, and .endfunc, as directives, using the
proper MCTargetStreamer mechanism, rather than fake instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257511 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReplace inherited constructor with an explicit one
Krzysztof Parzyszek [Tue, 12 Jan 2016 19:27:59 +0000 (19:27 +0000)]
Replace inherited constructor with an explicit one

Some bots failed when the inherited constructor was used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257508 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Make CFG stackification independent of basic-block labels.
Dan Gohman [Tue, 12 Jan 2016 19:14:46 +0000 (19:14 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257505 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Implement RDF-based post-RA optimizations
Krzysztof Parzyszek [Tue, 12 Jan 2016 19:09:01 +0000 (19:09 +0000)]
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257504 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform pow(x, 0.5...
Sanjay Patel [Tue, 12 Jan 2016 19:06:35 +0000 (19:06 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform pow(x, 0.5) calls

Also, propagate the FMF to the newly created sqrt() call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257503 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] More cleanup, partially aimed at working around GCC ICE.
Lang Hames [Tue, 12 Jan 2016 19:01:49 +0000 (19:01 +0000)]
[ORC] More cleanup, partially aimed at working around GCC ICE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257501 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agorangify; NFCI
Sanjay Patel [Tue, 12 Jan 2016 18:47:59 +0000 (18:47 +0000)]
rangify; NFCI

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257500 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAuto-link with ole32.dll to simplify building LLVM.dll
Reid Kleckner [Tue, 12 Jan 2016 18:33:49 +0000 (18:33 +0000)]
Auto-link with ole32.dll to simplify building LLVM.dll

Patch by Jakob Bornecrantz

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257499 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Replace lambda with a helper method.
Lang Hames [Tue, 12 Jan 2016 18:17:23 +0000 (18:17 +0000)]
[Orc] Replace lambda with a helper method.

This is good cleanup, but I'm also hoping it'll fix some more GCC ICEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257498 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofunction names start with a lower case letter ; NFC
Sanjay Patel [Tue, 12 Jan 2016 18:03:37 +0000 (18:03 +0000)]
function names start with a lower case letter ; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257496 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix bot failure from r257493: remove extraneous temp file read
Teresa Johnson [Tue, 12 Jan 2016 17:53:59 +0000 (17:53 +0000)]
Fix bot failure from r257493: remove extraneous temp file read

This was left from an earlier version of the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257494 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ThinLTO] Handle an external call from an import to an alias in dest
Teresa Johnson [Tue, 12 Jan 2016 17:48:44 +0000 (17:48 +0000)]
[ThinLTO] Handle an external call from an import to an alias in dest

The findExternalCalls routine ignores calls to functions already
defined in the dest module. This was not handling the case where
the definition in the current module is actually an alias to a
function call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257493 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform pow(exp(x...
Sanjay Patel [Tue, 12 Jan 2016 17:30:37 +0000 (17:30 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform pow(exp(x)) calls

See also:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257491 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRDF: Copy propagation
Krzysztof Parzyszek [Tue, 12 Jan 2016 17:23:48 +0000 (17:23 +0000)]
RDF: Copy propagation

This is a very limited implementation of DFG-based copy propagation.
It only handles actual COPY instructions (does not handle other equivalents
such as add-immediate with a 0 operand).
The major limitation is that it does not update the DFG: that will be the
change required to make it more robust (hopefully coming up soon).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257490 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Emit note directive for HSA even if there are no functions
Tom Stellard [Tue, 12 Jan 2016 17:18:17 +0000 (17:18 +0000)]
AMDGPU: Emit note directive for HSA even if there are no functions

Reviewers: arsenm, echristo

Subscribers: arsenm, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257488 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Clang-format.
Lang Hames [Tue, 12 Jan 2016 17:06:32 +0000 (17:06 +0000)]
[Orc] Clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257487 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Take another shot at working around the GCC 4.7 ICE in
Lang Hames [Tue, 12 Jan 2016 17:04:12 +0000 (17:04 +0000)]
[Orc] Take another shot at working around the GCC 4.7 ICE in

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257486 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRDF: Dead code elimination
Krzysztof Parzyszek [Tue, 12 Jan 2016 17:01:16 +0000 (17:01 +0000)]
RDF: Dead code elimination

Utility class to perform DFG-based dead code elimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257485 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoconsolidate exp/exp2 tests
Sanjay Patel [Tue, 12 Jan 2016 17:00:38 +0000 (17:00 +0000)]
consolidate exp/exp2 tests

The transform is identical, so keep the tests together and save some overhead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257484 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix compiler warnings from r257477
Krzysztof Parzyszek [Tue, 12 Jan 2016 16:51:55 +0000 (16:51 +0000)]
Fix compiler warnings from r257477

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257483 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add a macro LLVM_FUZZER_DEFINES_SANITIZER_WEAK_HOOOKS
Kostya Serebryany [Tue, 12 Jan 2016 16:50:18 +0000 (16:50 +0000)]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257482 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd/edit tests to include instruction-level FMF on calls
Sanjay Patel [Tue, 12 Jan 2016 16:50:17 +0000 (16:50 +0000)]
Add/edit tests to include instruction-level FMF on calls
Prepatory patch before changing LibCallSimplifier to use the FMF.
Also, tighten the CHECK lines and give the tests more meaningful names.
Similar changes to:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257481 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRDF: Implement register liveness analysis
Krzysztof Parzyszek [Tue, 12 Jan 2016 15:56:33 +0000 (15:56 +0000)]
RDF: Implement register liveness analysis

Compute block live-ins and operand kill flags from the DFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257480 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[mips] Correct operand order in DSP's mthi/mtlo
Daniel Sanders [Tue, 12 Jan 2016 15:15:14 +0000 (15:15 +0000)]
[mips] Correct operand order in DSP's mthi/mtlo

Summary: The result register is the second operand as per the other mt* instructions.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257478 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRegister Data Flow: data flow graph
Krzysztof Parzyszek [Tue, 12 Jan 2016 15:09:49 +0000 (15:09 +0000)]
Register Data Flow: data flow graph

Target independent, SSA-based data flow framework for representing
data flow between physical registers.

This commit implements the creation of the actual data flow graph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257477 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Hexagon] Make helper function static. NFC.
Benjamin Kramer [Tue, 12 Jan 2016 14:58:49 +0000 (14:58 +0000)]
[Hexagon] Make helper function static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257476 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix test on windows.
Rafael Espindola [Tue, 12 Jan 2016 14:58:40 +0000 (14:58 +0000)]
Fix test on windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257475 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Fix several state persistence bugs
Keno Fischer [Tue, 12 Jan 2016 13:38:15 +0000 (13:38 +0000)]
[ARM] Fix several state persistence bugs

This fixes three bugs, in all of which state is not or incorrecly reset between
objects (i.e. when reusing the same pass manager to create multiple object
1) AttributeSection needs to be reset to nullptr, because otherwise the backend
   will try to emit into the old object file's attribute section causing a
   segmentation fault.
2) MappingSymbolCounter needs to be reset, otherwise the second object file
   will start where the first one left off.
3) The MCStreamer base class resets the Streamer's e_flags settings. Since
   EF_ARM_EABI_VER5 is set on streamer creation, we need to set it again
   after the MCStreamer was rest.

Also rename Reset (uppser case) to EHReset to avoid confusion with
reset (lower case).

Reviewers: rengolin
Differential Revision: http://reviews.llvm.org/D15950

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257473 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoTest commit access - tiny comment and code style fix.
Andrey Turetskiy [Tue, 12 Jan 2016 13:34:11 +0000 (13:34 +0000)]
Test commit access - tiny comment and code style fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257472 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoThe isel pattern that selects the memory-register form of VCVTPH2PS
Robert Lougher [Tue, 12 Jan 2016 11:48:25 +0000 (11:48 +0000)]
The isel pattern that selects the memory-register form of VCVTPH2PS
(64 to 128-bit) matches against the pattern fragment 'vzmovl_v2i64'
(a zero-extended 64-bit load).

However, a change in r248784 teaches the instruction combiner that only
the lower 64 bits of the input to a 128-bit vcvtph2ps are used.  This means
the instruction combiner will ordinarily optimize away the upper 64-bit
insertelement instruction in the zero-extension and so we no longer select
the memory-register form.  To fix this a new pattern has been added.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257470 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoThe --debug-only option now takes a comma separated list of debug types.
Christof Douma [Tue, 12 Jan 2016 10:23:13 +0000 (10:23 +0000)]
The --debug-only option now takes a comma separated list of debug types.

This means that the DEBUG_TYPE cannot take a comma anymore. All existing passes
conform to this rule.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257466 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAVX512: VPMOVAPS/PD and VPMOVUPS/PD (load) intrinsic implementation.
Igor Breger [Tue, 12 Jan 2016 10:02:32 +0000 (10:02 +0000)]
AVX512: VPMOVAPS/PD and VPMOVUPS/PD (load) intrinsic implementation.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257463 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoExplicitly enable OBJECT library "target".
Axel Naumann [Tue, 12 Jan 2016 07:44:58 +0000 (07:44 +0000)]
Explicitly enable OBJECT library "target".

With this, one can build a lib from the objects of other libs:

Reviewed by Chris Bieneman - thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257459 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Comment out debugging output in OrcRemoteTargetClient::reserveMem to see
Lang Hames [Tue, 12 Jan 2016 07:26:28 +0000 (07:26 +0000)]
[Orc] Comment out debugging output in OrcRemoteTargetClient::reserveMem to see
whether this affects the GCC 4.7 ICE on
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75 .

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257458 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r257003
Andrew Wilkins [Tue, 12 Jan 2016 07:23:58 +0000 (07:23 +0000)]
Revert r257003

This revision breaks llvm-config if you set
BUILD_SHARED_LIBS=on in a CMake build. Backing
out until the fix is ready to land.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257457 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Remove extraneous '&'.
Lang Hames [Tue, 12 Jan 2016 07:10:10 +0000 (07:10 +0000)]
[ORC] Remove extraneous '&'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257455 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Replace some more 'auto' uses with std::error_code.
Lang Hames [Tue, 12 Jan 2016 07:09:41 +0000 (07:09 +0000)]
[ORC] Replace some more 'auto' uses with std::error_code.

One of the GCC 4.7 bots doesn't seem to like auto, and is currently suffering
from an ICE. I'm hoping this will help.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257454 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Add overloads of RPC::handle and RPC::expect that take member functions as
Lang Hames [Tue, 12 Jan 2016 06:48:52 +0000 (06:48 +0000)]
[Orc] Add overloads of RPC::handle and RPC::expect that take member functions as

It is expected that RPC handlers will usually be member functions. Accepting them
directly in handle and expect allows for the remove of a lot of lambdas an
explicit error variables.

This patch also uses this new feature to substantially tidy up the
OrcRemoteTargetServer class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257452 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Move the actual unrolling logic to a standalone function. NFC
Justin Bogner [Tue, 12 Jan 2016 05:21:37 +0000 (05:21 +0000)]
LoopUnroll: Move the actual unrolling logic to a standalone function. NFC

This is pure code motion - break the actual work out of runOnLoop into
a reusable standalone function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257445 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Implement a prototype instruction encoder and disassembler.
Dan Gohman [Tue, 12 Jan 2016 03:32:29 +0000 (03:32 +0000)]
[WebAssembly] Implement a prototype instruction encoder and disassembler.

This is using an extremely simple temporary made-up binary format, not the
official binary format (which isn't defined yet).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257440 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Register the MC subtarget info.
Dan Gohman [Tue, 12 Jan 2016 03:30:06 +0000 (03:30 +0000)]
[WebAssembly] Register the MC subtarget info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257439 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Define OperandTypes for decoding immediate values.
Dan Gohman [Tue, 12 Jan 2016 03:09:16 +0000 (03:09 +0000)]
[WebAssembly] Define OperandTypes for decoding immediate values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257438 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Define a custom segment type for function definitions.
Dan Gohman [Tue, 12 Jan 2016 02:58:12 +0000 (02:58 +0000)]
[WebAssembly] Define a custom segment type for function definitions.

Since function definitions are not loaded into the address space, PT_LOAD is
inappropriate. PT_WEBASSEMBLY_FUNCTIONS is used to identify where the function
definitions are so that they can be processed at program startup time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257436 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] when a new unit is discovered using a dictionary, print all used dictiona...
Kostya Serebryany [Tue, 12 Jan 2016 02:36:59 +0000 (02:36 +0000)]
[libFuzzer] when a new unit is discovered using a dictionary, print all used dictionary entries

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257435 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] add various debug prints. Also don't mutate based on a cmp trace like...
Kostya Serebryany [Tue, 12 Jan 2016 02:08:37 +0000 (02:08 +0000)]
[libFuzzer] add various debug prints. Also don't mutate based on a cmp trace like (a eq a) or (a neq a)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257434 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Use TSFlags instead of keeping a list of special-case opcodes.
Dan Gohman [Tue, 12 Jan 2016 01:45:12 +0000 (01:45 +0000)]
[WebAssembly] Use TSFlags instead of keeping a list of special-case opcodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257433 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoOrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Tue, 12 Jan 2016 01:23:43 +0000 (01:23 +0000)]
OrcRemoteTargetServer.h: Suppress a warning. [-Wunused-variable]

FIXME: It may return ErrorOr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257431 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agolli: Fix warnings. [-Wsign-compare]
NAKAMURA Takumi [Tue, 12 Jan 2016 01:23:30 +0000 (01:23 +0000)]
lli: Fix warnings. [-Wsign-compare]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257430 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: performance improvement for x86-64.
Manman Ren [Tue, 12 Jan 2016 01:08:46 +0000 (01:08 +0000)]
CXX_FAST_TLS calling convention: performance improvement for x86-64.

This is the same change on x86-64 as r255821 on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257428 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Make canUnrollCompletely static - it doesn't use any state. NFC
Justin Bogner [Tue, 12 Jan 2016 01:06:32 +0000 (01:06 +0000)]
LoopUnroll: Make canUnrollCompletely static - it doesn't use any state. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257427 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Clean up the maze of initialization for unroll parameters. NFC
Justin Bogner [Tue, 12 Jan 2016 00:55:26 +0000 (00:55 +0000)]
LoopUnroll: Clean up the maze of initialization for unroll parameters. NFC

The layering of where the various loop unroll parameters are
initialized and overridden here was very confusing, making it pretty
difficult to tell just how the various sources interacted. Instead, we
put all of the initialization logic together in a single function so
that it's obvious what overrides what.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257426 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: performance improvement for ARM.
Manman Ren [Tue, 12 Jan 2016 00:47:18 +0000 (00:47 +0000)]
CXX_FAST_TLS calling convention: performance improvement for ARM.

This is the same change on ARM as r255821 on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257424 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive the result...
Kostya Serebryany [Tue, 12 Jan 2016 00:43:42 +0000 (00:43 +0000)]
[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive the result of the computations. With that, don't do any mutations if memcmp/etc returned 0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257423 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IRMover] Don't copy personality, etc unless creating def
Teresa Johnson [Tue, 12 Jan 2016 00:24:24 +0000 (00:24 +0000)]
[IRMover] Don't copy personality, etc unless creating def

Function::copyAttributesFrom will copy the personality function, prefix
data and prolog data from the source function to the new function, and
is invoked when the IRMover copies the function prototype. This puts a
reference to a constant in the source module on a function in the dest
module, which causes an error when deleting the source module after
importing, since the personality function in the source module still has
uses (this would presumably also be an issue for the prologue and prefix
data). Remove the copies added to the dest copy when creating the new
prototype, as they are mapped properly when/if we link the function body.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257420 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] XFAIL a few remote-jit test cases that I missed in r257391.
Lang Hames [Mon, 11 Jan 2016 23:57:39 +0000 (23:57 +0000)]
[Orc] XFAIL a few remote-jit test cases that I missed in r257391.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257419 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCXX_FAST_TLS calling convention: Add support for ARM on Darwin.
Manman Ren [Mon, 11 Jan 2016 23:50:43 +0000 (23:50 +0000)]
CXX_FAST_TLS calling convention: Add support for ARM on Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257417 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Define WebAssembly-specific relocation codes.
Dan Gohman [Mon, 11 Jan 2016 23:38:05 +0000 (23:38 +0000)]
[WebAssembly] Define WebAssembly-specific relocation codes.

Currently WebAssembly has two kinds of relocations; data addresses and
function addresses. This adds ELF relocations for them, as well as an
MC symbol kind to indicate which type of relocation is needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257416 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAvoid the deprecated GetVersionEx API
Reid Kleckner [Mon, 11 Jan 2016 23:33:03 +0000 (23:33 +0000)]
Avoid the deprecated GetVersionEx API

Apparently the preferred version is the incredibly complicated
VerifyVersionInfoW function.

Rename the function to avoid potential future name clashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257415 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform log calls
Sanjay Patel [Mon, 11 Jan 2016 23:31:48 +0000 (23:31 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform log calls

Also, add tests to verify that we're checking 'fast' on both calls of each transform pair,
tighten the CHECK lines, and give the tests more meaningful names.

This is a continuation of:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257414 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove a bugs assert.
Rafael Espindola [Mon, 11 Jan 2016 23:21:45 +0000 (23:21 +0000)]
Remove a bugs assert.

There is no reason the value being printed has to be positive.
Fixes pr25802.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257412 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agolli-child-target: Introduce a new dependency on RuntimeDyld.
NAKAMURA Takumi [Mon, 11 Jan 2016 23:12:30 +0000 (23:12 +0000)]
lli-child-target: Introduce a new dependency on RuntimeDyld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257410 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] don't allow sqrt transform unless all ops are unsafe
Sanjay Patel [Mon, 11 Jan 2016 22:50:36 +0000 (22:50 +0000)]
[LibCallSimplifier] don't allow sqrt transform unless all ops are unsafe

Fix the FIXME added with:

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257404 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoLoopUnroll: Use the optsize threshold for minsize as well
Justin Bogner [Mon, 11 Jan 2016 22:39:43 +0000 (22:39 +0000)]
LoopUnroll: Use the optsize threshold for minsize as well

Currently we're unrolling loops more in minsize than in optsize, which
means -Oz will have a larger code size than -Os. That doesn't make any

This resolves the FIXME about this in LoopUnrollPass and extends the
optsize test to make sure we use the smaller threshold for minsize as

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257402 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agomore space; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:35:39 +0000 (22:35 +0000)]
more space; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257401 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls
Sanjay Patel [Mon, 11 Jan 2016 22:34:19 +0000 (22:34 +0000)]
[LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls

This is a continuation of adding FMF to call instructions:

The intent of the patch is to preserve the current behavior of the transform except
that we use the sqrt instruction's 'fast' attribute as a trigger rather than the
function-level attribute.

But this raises a bug noted by the new FIXME comment.

In order to do this transform:
sqrt((x * x) * y) ---> fabs(x) * sqrt(y)

...we need all of the sqrt, the first fmul, and the second fmul to be 'fast'.
If any of those ops is strict, we should bail out.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257400 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agogetParent()->getParent() == getFunction() and clang-format ; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:24:35 +0000 (22:24 +0000)]
getParent()->getParent() == getFunction() and clang-format ; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257399 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodon't repeat function names in comments; NFC
Sanjay Patel [Mon, 11 Jan 2016 22:14:42 +0000 (22:14 +0000)]
don't repeat function names in comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257396 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd a missing error handling to llvm-lto.
Rafael Espindola [Mon, 11 Jan 2016 22:08:22 +0000 (22:08 +0000)]
Add a missing error handling to llvm-lto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257395 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Reorganize address offset folding.
Dan Gohman [Mon, 11 Jan 2016 22:05:44 +0000 (22:05 +0000)]
[WebAssembly] Reorganize address offset folding.

Always expect tglobaladdr and texternalsym to be wrapped in
WebAssemblywrapper nodes. Also, split out a regPlusGA from regPlusImm so
that it can special-case global addresses, as they can be folded in more

Unfortunately this doesn't enable any new optimizations yet due to
SelectionDAG limitations. I'll be submitting changes to the SelectionDAG
infrastructure, along with tests, in a separate patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257394 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Implement {{s|u}}int_to_fp i64 -> f32
Matt Arsenault [Mon, 11 Jan 2016 22:01:48 +0000 (22:01 +0000)]
AMDGPU: Implement {{s|u}}int_to_fp i64 -> f32

The old lowering for uint_to_fp failed opencl conformance.
It might be OK for fast math mode, but I'm not sure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257393 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoXFAIL the LLI remote JIT tests on Win32.
Lang Hames [Mon, 11 Jan 2016 21:41:34 +0000 (21:41 +0000)]
XFAIL the LLI remote JIT tests on Win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257391 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSplit resolveCycles(bool AllowTemps) into two interfaces and document
Teresa Johnson [Mon, 11 Jan 2016 21:37:41 +0000 (21:37 +0000)]
Split resolveCycles(bool AllowTemps) into two interfaces and document

Address review feedback from r255909.

Move body of resolveCycles(bool AllowTemps) to
resolveRecursivelyImpl(bool AllowTemps). Revert resolveCycles back
to asserting on temps, and add new resolveNonTemporaries interface
to invoke the new implementation with AllowTemps=true. Document
the differences between these interfaces, specifically the effect
on RAUW support and uniquing. Call appropriate interface from

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257389 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoBumpPtrAllocator::Reset should also poison the first slab which doesn't get deallocated.
Pete Cooper [Mon, 11 Jan 2016 21:28:03 +0000 (21:28 +0000)]
BumpPtrAllocator::Reset should also poison the first slab which doesn't get deallocated.

When asan is enabled, we poison slabs as we allocate them, and only unpoison the pieces
we need from the slab.

However, in Reset, we were failing to reset the state of the slab back to being poisoned.

Patch by b17 c0de.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257388 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Cleanup udiv test
Matt Arsenault [Mon, 11 Jan 2016 21:18:40 +0000 (21:18 +0000)]
AMDGPU: Cleanup udiv test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257387 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Fix crash with dispatch.ptr intrinsic with non-HSA target
Matt Arsenault [Mon, 11 Jan 2016 21:18:33 +0000 (21:18 +0000)]
AMDGPU: Fix crash with dispatch.ptr intrinsic with non-HSA target

It might be better to let this be a select failure instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257386 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add AVX512 testcase for r248965/PR24512.
Ahmed Bougacha [Mon, 11 Jan 2016 21:16:21 +0000 (21:16 +0000)]
[X86] Add AVX512 testcase for r248965/PR24512.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257385 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[Windows] Simplify assertion code. NFC."
Reid Kleckner [Mon, 11 Jan 2016 21:07:48 +0000 (21:07 +0000)]
Revert "[Windows] Simplify assertion code. NFC."

This reverts commit r254363.

load64BitDebugHelp() has the side effect of loading dbghelp and setting
globals. It should be called in no-asserts builds as well as debug

llvm_unreachable is also not appropriate here, since we actually want to
return if dbghelp couldn't be loaded in a non-asserts build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257384 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Add explicit move construction/assignment to
Lang Hames [Mon, 11 Jan 2016 20:52:33 +0000 (20:52 +0000)]
[ORC] Add explicit move construction/assignment to

More MSVC bot appeasement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257382 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate the VS getting started docs to reflect the current state of support
Reid Kleckner [Mon, 11 Jan 2016 20:51:57 +0000 (20:51 +0000)]
Update the VS getting started docs to reflect the current state of support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257381 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUse ::GetVersionEx directly rather than the Win8.1 SDK helpers
Reid Kleckner [Mon, 11 Jan 2016 20:35:45 +0000 (20:35 +0000)]
Use ::GetVersionEx directly rather than the Win8.1 SDK helpers

This removes ifdefs and fixes the build for users of the Win8.0 SDK,
which I happen to be. Upgrading is not hard, but executing the same code
everywhere seems better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257379 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] More MSVC error wrangling.
Lang Hames [Mon, 11 Jan 2016 20:25:25 +0000 (20:25 +0000)]
[ORC] More MSVC error wrangling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257377 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoEnsure -mcpu=xscale works for arm targets, after rL252903 and rL252904
Dimitry Andric [Mon, 11 Jan 2016 20:12:53 +0000 (20:12 +0000)]
Ensure -mcpu=xscale works for arm targets, after rL252903 and rL252904

After these revisions, for arm targets, the -mcpu=xscale option caused
an error: "the clang compiler does not support '-mcpu=xscale'".  Adding
"v5e" as a SUB_ARCH in ARMTargetParser.def helps.

Submitted by: Andrew Turner
Differential Revision: http://reviews.llvm.org/D16043

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257376 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[sanitizer] [msan] Fix origin store of array types
Adhemerval Zanella [Mon, 11 Jan 2016 19:55:27 +0000 (19:55 +0000)]
[sanitizer] [msan] Fix origin store of array types

This patch fixes the memory sanitizer origin store instrumentation for
array types.  This can be triggered by cases where frontend lowers
function return to array type instead of aggregation.

For instance, the C code:

struct mypair {
 int64_t x;
 int y;

mypair my_make_pair(int64_t x, int y)  {
 mypair p;
 p.x = x;
 p.y = y;
 return p;

int foo (int p)
  mypair z = my_make_pair(p, 0);
  return z.y + z.x;

It will be lowered with target set to aarch64-linux and -O0 to:

define i32 @_Z3fooi(i32 %p) #0 {
%call = call [2 x i64] @_Z12my_make_pairxi(i64 %conv, i32 0)
%1 = bitcast %struct.mypair* %z to [2 x i64]*
store [2 x i64] %call, [2 x i64]* %1, align 8

The origin store will emit a 'icmp' to test each store value again the
TLS origin array.  However since 'icmp' does not support ArrayType the
memory instrumentation phase will bail out with an error.

This patch change it by using the same strategy used for struct type on

It fixes the 'test/msan/insertvalue_origin.cc' for aarch64 (the -O0 case).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257375 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Fix missing return.
Lang Hames [Mon, 11 Jan 2016 19:40:25 +0000 (19:40 +0000)]
[Orc] Fix missing return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257373 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Add explicit move construction/assignment to RCMemoryManager.
Lang Hames [Mon, 11 Jan 2016 19:39:49 +0000 (19:39 +0000)]
[Orc] Add explicit move construction/assignment to RCMemoryManager.

Yet another attempt to pacify MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257372 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix some GCC 4.7 issues with the new Orc remote JIT support
David Blaikie [Mon, 11 Jan 2016 19:26:01 +0000 (19:26 +0000)]
Fix some GCC 4.7 issues with the new Orc remote JIT support

I'm still seeing GCC ICE locally, but figured I'd throw this at the wall
& see if it sticks for the bots at least. Will continue investigating
the ICE in any case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257367 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCode refactoring for commit r257278.
Chen Li [Mon, 11 Jan 2016 19:20:53 +0000 (19:20 +0000)]
Code refactoring for commit r257278.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257366 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NFC] Fix whitespace.
Chad Rosier [Mon, 11 Jan 2016 19:17:36 +0000 (19:17 +0000)]
[NFC] Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257365 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.
Lang Hames [Mon, 11 Jan 2016 19:05:45 +0000 (19:05 +0000)]
[ORC] Explicitly delete copy constructors for RCMemoryManager::Alloc.

More MSVC bot appeasement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257364 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Include <system_error> in OrcTargetClient.
Lang Hames [Mon, 11 Jan 2016 18:48:37 +0000 (18:48 +0000)]
[Orc] Include <system_error> in OrcTargetClient.

Another shot at appeasing the clang-x86_64-ubuntu-gdb-75 builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257362 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agolli/ChildTarget now depends on OrcJIT. Add that component to the Makefile.
Lang Hames [Mon, 11 Jan 2016 17:44:07 +0000 (17:44 +0000)]
lli/ChildTarget now depends on OrcJIT. Add that component to the Makefile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257360 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRemove the remote-JIT small code model tests for now. They're causing
Lang Hames [Mon, 11 Jan 2016 17:38:25 +0000 (17:38 +0000)]
Remove the remote-JIT small code model tests for now. They're causing
intermittent XPASSes on some builders.

These can be reinstated when we have proper support for small-code model in
the JIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257359 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] More explicit move construction/assignment to appease MSVC.
Lang Hames [Mon, 11 Jan 2016 17:32:03 +0000 (17:32 +0000)]
[Orc] More explicit move construction/assignment to appease MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257358 91177308-0d34-0410-b5e6-96231b3b80d8