7 years ago[Orc] Add TransformUtils to Orc's dependency list.
Lang Hames [Sat, 24 Jan 2015 19:00:09 +0000 (19:00 +0000)]
[Orc] Add TransformUtils to Orc's dependency list.

Patch by Jan Vesely. Thanks Jan!

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

7 years agoRemove a number of redundant ExecutionEngine regression tests.
Lang Hames [Sat, 24 Jan 2015 18:49:51 +0000 (18:49 +0000)]
Remove a number of redundant ExecutionEngine regression tests.

These tests used to test the legacy JIT but since that has been removed they're
just redundantly testing MCJIT. Remove them and just leave their counterparts in

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

7 years agobpf: add missing lit.local.cfg
Alexei Starovoitov [Sat, 24 Jan 2015 18:20:52 +0000 (18:20 +0000)]
bpf: add missing lit.local.cfg

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

7 years agoBPF backend
Alexei Starovoitov [Sat, 24 Jan 2015 17:51:26 +0000 (17:51 +0000)]
BPF backend

- cleanup tests

- addressed feedback from David:
- switched to range-based 'for' loops
- fixed formatting of tests

- rebased and adjusted AsmPrinter args
- CamelCased .td, fixed formatting, cleaned up names, removed unused patterns
- diffstat: 3 files changed, 203 insertions(+), 227 deletions(-)

- addressed feedback from Chandler:
- reinstated full verbose standard banner in all files
- fixed variables that were not in CamelCase
- fixed names of #ifdef in header files
- removed redundant braces in if/else chains with single statements
- fixed comments
- removed trailing empty line
- dropped debug annotations from tests
- diffstat of these changes:
  46 files changed, 456 insertions(+), 469 deletions(-)

- fix setLoadExtAction() interface
- clang-formated all where it made sense

- added CODE_OWNERS entry for BPF backend

- fix metadata in tests

- addressed feedback from Tom and Matt
- removed top level change to configure (now everything via 'experimental-backend')
- reworked error reporting via DiagnosticInfo (similar to R600)
- added few more tests
- added cmake build
- added Triple::bpf
- tested on linux and darwin

V1 cover letter:
recently linux gained "universal in-kernel virtual machine" which is called
eBPF or extended BPF. The name comes from "Berkeley Packet Filter", since
new instruction set is based on it.
This patch adds a new backend that emits extended BPF instruction set.

The concept and development are covered by the following articles:

One of use cases: dtrace/systemtap alternative.

bpf syscall manpage:

instruction set description and differences vs classic BPF:

Short summary of instruction set:
- 64-bit registers
  R0      - return value from in-kernel function, and exit value for BPF program
  R1 - R5 - arguments from BPF program to in-kernel function
  R6 - R9 - callee saved registers that in-kernel function will preserve
  R10     - read-only frame pointer to access stack
- two-operand instructions like +, -, *, mov, load/store
- implicit prologue/epilogue (invisible stack pointer)
- no floating point, no simd

Short history of extended BPF in kernel:
interpreter in 3.15, x64 JIT in 3.16, arm64 JIT, verifier, bpf syscall in 3.18, more to come in the future.

It's a very small and simple backend.
There is no support for global variables, arbitrary function calls, floating point, varargs,
exceptions, indirect jumps, arbitrary pointer arithmetic, alloca, etc.
From C front-end point of view it's very restricted. It's done on purpose, since kernel
rejects all programs that it cannot prove safe. It rejects programs with loops
and with memory accesses via arbitrary pointers. When kernel accepts the program it is
guaranteed that program will terminate and will not crash the kernel.

This patch implements all 'must have' bits. There are several things on TODO list,
so this is not the end of development.
Most of the code is a boiler plate code, copy-pasted from other backends.
Only odd things are lack or < and <= instructions, specialized load_byte intrinsics
and 'compare and goto' as single instruction.
Current instruction set is fixed, but more instructions can be added in the future.

Signed-off-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Subscribers: majnemer, chandlerc, echristo, joerg, pete, rengolin, kristof.beyls, arsenm, t.p.northover, tstellarAMD, aemerson, llvm-commits

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

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

7 years ago[mips] Fix 'jumpy' debug line info around calls.
Daniel Sanders [Sat, 24 Jan 2015 14:35:11 +0000 (14:35 +0000)]
[mips] Fix 'jumpy' debug line info around calls.

At the moment, address calculation is taking the debug line info from the
address node (e.g. TargetGlobalAddress). When a function is called multiple
times, this results in output of the form:

  .loc $first_call_location
  .. address calculation ..
  .. function call ..
  .. address calculation ..
  .loc $second_call_location
  .. function call ..
  .loc $first_call_location
  .. address calculation ..
  .loc $third_call_location
  .. function call ..

This patch makes address calculations for function calls take the debug line
info for the call node and results in output of the form:
  .loc $first_call_location
  .. address calculation ..
  .. function call ..
  .loc $second_call_location
  .. address calculation ..
  .. function call ..
  .loc $third_call_location
  .. address calculation ..
  .. function call ..

All other address calculations continue to use the address node.

Test Plan: Fixes test/DebugInfo/multiline.ll on a mips host.

Subscribers: dblaikie, llvm-commits

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

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

7 years agoUpdate of the gold-plugin.cpp code to match Chandler's changes (r226981)
Sylvestre Ledru [Sat, 24 Jan 2015 13:59:08 +0000 (13:59 +0000)]
Update of the gold-plugin.cpp code to match Chandler's changes (r226981)

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

7 years ago[mips] Fix assertion on i128 addition/subtraction on MIPS64
Daniel Sanders [Sat, 24 Jan 2015 12:58:10 +0000 (12:58 +0000)]
[mips] Fix assertion on i128 addition/subtraction on MIPS64

In addition to the included tests, this fixes
test/CodeGen/Generic/i128-addsub.ll on a mips64 host.

Reviewers: atanasyan, sagar, vmedic

Reviewed By: vmedic

Subscribers: sdkie, llvm-commits

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

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

7 years ago[DAG] Fix wrong canonicalization performed on shuffle nodes.
Andrea Di Biagio [Sat, 24 Jan 2015 11:54:29 +0000 (11:54 +0000)]
[DAG] Fix wrong canonicalization performed on shuffle nodes.

This fixes a regression introduced by r226816.
When replacing a splat shuffle node with a constant build_vector,
make sure that the new build_vector has a valid number of elements.

Thanks to Patrik Hagglund for reporting this problem and providing a
small reproducible.

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

7 years ago[PM] General doxygen and comment cleanup for this pass.
Chandler Carruth [Sat, 24 Jan 2015 11:44:32 +0000 (11:44 +0000)]
[PM] General doxygen and comment cleanup for this pass.

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

7 years ago[PM] Reformat this code with clang-format so that I can use clang-format
Chandler Carruth [Sat, 24 Jan 2015 11:33:55 +0000 (11:33 +0000)]
[PM] Reformat this code with clang-format so that I can use clang-format
when refactoring for the new pass manager without introducing too many
formatting changes into meaning full diffs.

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

7 years ago[PM] Port LowerExpectIntrinsic to the new pass manager.
Chandler Carruth [Sat, 24 Jan 2015 11:13:02 +0000 (11:13 +0000)]
[PM] Port LowerExpectIntrinsic to the new pass manager.

This just lifts the logic into a static helper function, sinks the
legacy pass to be a trivial wrapper of that helper fuction, and adds
a trivial wrapper for the new PM as well. Not much to see here.

I switched a test case to run in both modes, but we have to strip the
dead prototypes separately as that pass isn't in the new pass manager

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

7 years ago[PM] Change LowerExpectIntrinsic to actually return true when it has
Chandler Carruth [Sat, 24 Jan 2015 11:12:57 +0000 (11:12 +0000)]
[PM] Change LowerExpectIntrinsic to actually return true when it has
changed the IR. This is particularly easy as we can just look for the
existence of any expect intrinsic at all to know whether we've changed
the IR.

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

7 years ago[PM] Use a more appropriate name for the statistics variable in
Chandler Carruth [Sat, 24 Jan 2015 10:57:25 +0000 (10:57 +0000)]
[PM] Use a more appropriate name for the statistics variable in
lower-expect, as we don't have 'if's in the IR and we use it for
switches as well.

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

7 years ago[PM] Switch tihs code to use a range based for loop over the function.
Chandler Carruth [Sat, 24 Jan 2015 10:57:19 +0000 (10:57 +0000)]
[PM] Switch tihs code to use a range based for loop over the function.

We can't switch the loop over the instructions because it needs to
early-increment the iterator.

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

7 years ago[PM] Use a SmallVector instead of std::vector to avoid heap allocations
Chandler Carruth [Sat, 24 Jan 2015 10:47:13 +0000 (10:47 +0000)]
[PM] Use a SmallVector instead of std::vector to avoid heap allocations
for small switches, and avoid using a complex loop to set up the

We know what the baseline weights will be so we can just resize the
vector to contain all that value and clobber the one slot that is
likely. This seems much more direct than the previous code that tested
at every iteration, and started off by zeroing the vector.

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

7 years ago[PM] Pull the two helpers for this pass into static functions. There are
Chandler Carruth [Sat, 24 Jan 2015 10:39:24 +0000 (10:39 +0000)]
[PM] Pull the two helpers for this pass into static functions. There are
no members for them to use.

Also, make them accept references as there is no possibility of a null

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

7 years ago[PM] Add a basic doxygen comment for this pass.
Chandler Carruth [Sat, 24 Jan 2015 10:32:53 +0000 (10:32 +0000)]
[PM] Add a basic doxygen comment for this pass.

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

7 years ago[PM] Clean up the formatting of the LowerExpectIntrinsic pass prior to
Chandler Carruth [Sat, 24 Jan 2015 10:30:14 +0000 (10:30 +0000)]
[PM] Clean up the formatting of the LowerExpectIntrinsic pass prior to
refactoring its code.

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

7 years ago[PM] Move the LowerExpectIntrinsic pass to the Scalar library.
Chandler Carruth [Sat, 24 Jan 2015 10:18:47 +0000 (10:18 +0000)]
[PM] Move the LowerExpectIntrinsic pass to the Scalar library.

It was already in the Scalar header and referenced extensively as being
in this library, the source file was just in the utils directory for
some reason. No actual functionality changed. I noticed as it didn't
make sense to add a pass header to the utils headers.

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

7 years agoIf we see UTF-8 BOM sequence at the beginning of a response file, we shall
Yunzhong Gao [Sat, 24 Jan 2015 04:23:08 +0000 (04:23 +0000)]
If we see UTF-8 BOM sequence at the beginning of a response file, we shall
remove these bytes before parsing.

Phabricator Revision: http://reviews.llvm.org/D7156

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

7 years ago[PM] Port instcombine to the new pass manager!
Chandler Carruth [Sat, 24 Jan 2015 04:19:17 +0000 (04:19 +0000)]
[PM] Port instcombine to the new pass manager!

This is exciting as this is a much more involved port. This is
a complex, existing transformation pass. All of the core logic is shared
between both old and new pass managers. Only the access to the analyses
is separate because the actual techniques are separate. This also uses
a bunch of different and interesting analyses and is the first time
where we need to use an analysis across an IR layer.

This also paves the way to expose instcombine utility functions. I've
got a static function that implements the core pass logic over
a function which might be mildly interesting, but more interesting is
likely exposing a routine which just uses instructions *already in* the
worklist and combines until empty.

I've switched one of my favorite instcombine tests to run with both as
well to make sure this keeps working.

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

7 years ago[Bitcode] Diagnose errors instead of asserting from bad input
Filipe Cabecinhas [Sat, 24 Jan 2015 04:15:05 +0000 (04:15 +0000)]
[Bitcode] Diagnose errors instead of asserting from bad input

Eventually we can make some of these pass the error along to the caller.

Reports a fatal error if:
We find an invalid abbrev record
We try to get an invalid abbrev number
We can't fill the current word due to an EOF

Fixed an invalid bitcode test to check for output with FileCheck

Bugs found with afl-fuzz

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

7 years ago[PM] Rework how the TargetLibraryInfo pass integrates with the new pass
Chandler Carruth [Sat, 24 Jan 2015 02:06:09 +0000 (02:06 +0000)]
[PM] Rework how the TargetLibraryInfo pass integrates with the new pass
manager to support the actual uses of it. =]

When I ported instcombine to the new pass manager I discover that it
didn't work because TLI wasn't available in the right places. This is
a somewhat surprising and/or subtle aspect of the new pass manager
design that came up before but I think is useful to be reminded of:

While the new pass manager *allows* a function pass to query a module
analysis, it requires that the module analysis is already run and cached
prior to the function pass manager starting up, possibly with
a 'require<foo>' style utility in the pass pipeline. This is an
intentional hurdle because using a module analysis from a function pass
*requires* that the module analysis is run prior to entering the
function pass manager. Otherwise the other functions in the module could
be in who-knows-what state, etc.

A somewhat surprising consequence of this design decision (at least to
me) is that you have to design a function pass that leverages
a module analysis to do so as an optional feature. Even if that means
your function pass does no work in the absence of the module analysis,
you have to handle that possibility and remain conservatively correct.
This is a natural consequence of things being able to invalidate the
module analysis and us being unable to re-run it. And it's a generally
good thing because it lets us reorder passes arbitrarily without
breaking correctness, etc.

This ends up causing problems in one case. What if we have a module
analysis that is *definitionally* impossible to invalidate. In the
places this might come up, the analysis is usually also definitionally
trivial to run even while other transformation passes run on the module,
regardless of the state of anything. And so, it follows that it is
natural to have a hard requirement on such analyses from a function

It turns out, that TargetLibraryInfo is just such an analysis, and
InstCombine has a hard requirement on it.

The approach I've taken here is to produce an analysis that models this
flexibility by making it both a module and a function analysis. This
exposes the fact that it is in fact safe to compute at any point. We can
even make it a valid CGSCC analysis at some point if that is useful.
However, we don't want to have a copy of the actual target library info
state for each function! This state is specific to the triple. The
somewhat direct and blunt approach here is to turn TLI into a pimpl,
with the state and mutators in the implementation class and the query
routines primarily in the wrapper. Then the analysis can lazily
construct and cache the implementations, keyed on the triple, and
on-demand produce wrappers of them for each function.

One minor annoyance is that we will end up with a wrapper for each
function in the module. While this is a bit wasteful (one pointer per
function) it seems tolerable. And it has the advantage of ensuring that
we pay the absolute minimum synchronization cost to access this
information should we end up with a nice parallel function pass manager
in the future. We could look into trying to mark when analysis results
are especially cheap to recompute and more eagerly GC-ing the cached
results, or we could look at supporting a variant of analyses whose
results are specifically *not* cached and expected to just be used and
discarded by the consumer. Either way, these seem like incremental
enhancements that should happen when we start profiling the memory and
CPU usage of the new pass manager and not before.

The other minor annoyance is that if we end up using the TLI in both
a module pass and a function pass, those will be produced by two
separate analyses, and thus will point to separate copies of the
implementation state. While a minor issue, I dislike this and would like
to find a way to cleanly allow a single analysis instance to be used
across multiple IR unit managers. But I don't have a good solution to
this today, and I don't want to hold up all of the work waiting to come
up with one. This too seems like a reasonable thing to incrementally
improve later.

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

7 years agoBring the modules buildbot back to life after r226940.
Richard Smith [Sat, 24 Jan 2015 01:55:52 +0000 (01:55 +0000)]
Bring the modules buildbot back to life after r226940.

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

7 years agoReverting r226937: lit: Make MCJIT's supported arch check case insensitive
Kuba Brecka [Sat, 24 Jan 2015 01:42:44 +0000 (01:42 +0000)]
Reverting r226937: lit: Make MCJIT's supported arch check case insensitive

The r226937 commit causes ASan lit tests to be all skipped on OS X.

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

7 years ago[AArch64][LoadStoreOptimizer] Form LDPSW when possible.
Quentin Colombet [Sat, 24 Jan 2015 01:25:54 +0000 (01:25 +0000)]
[AArch64][LoadStoreOptimizer] Form LDPSW when possible.

This patch adds the missing LD[U]RSW variants to the load store optimizer, so
that we generate LDPSW when possible.


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

7 years ago[Orc] Add some missing headers to the CompileOnDemandLayer.h
Lang Hames [Sat, 24 Jan 2015 00:45:11 +0000 (00:45 +0000)]
[Orc] Add some missing headers to the CompileOnDemandLayer.h

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

7 years ago[x86] Fix a comment
Bruno Cardoso Lopes [Sat, 24 Jan 2015 00:22:04 +0000 (00:22 +0000)]
[x86] Fix a comment

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

7 years ago[Orc] Add orcjit to the dependencies list in the Makefile for lli.
Lang Hames [Sat, 24 Jan 2015 00:01:29 +0000 (00:01 +0000)]
[Orc] Add orcjit to the dependencies list in the Makefile for lli.

This should fix a few more broken bots.

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

7 years agoR600/SI: Emit .hsa.version section for amdhsa OS
Tom Stellard [Fri, 23 Jan 2015 23:59:08 +0000 (23:59 +0000)]
R600/SI: Emit .hsa.version section for amdhsa OS

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

7 years agoFix assertion when C++ EH filters are present in functions using SEH
Reid Kleckner [Fri, 23 Jan 2015 23:51:25 +0000 (23:51 +0000)]
Fix assertion when C++ EH filters are present in functions using SEH

Should fix PR22305.

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

7 years agoAddress more review comments for DIExpression::iterator.
Adrian Prantl [Fri, 23 Jan 2015 23:40:47 +0000 (23:40 +0000)]
Address more review comments for DIExpression::iterator.
- input_iterator
- define an operator->
- make constructors private were possible

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

7 years agoInstrProf: debug dumps should go to dbgs(), not outs()
Justin Bogner [Fri, 23 Jan 2015 23:28:30 +0000 (23:28 +0000)]
InstrProf: debug dumps should go to dbgs(), not outs()

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

7 years agollvm-cov: Don't use llvm::outs() in library code
Justin Bogner [Fri, 23 Jan 2015 23:09:27 +0000 (23:09 +0000)]
llvm-cov: Don't use llvm::outs() in library code

Nothing in lib/ should be using llvm::outs() directly. Thread it in
from the caller instead.

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

7 years agollvm-cov: Use range-for (NFC)
Justin Bogner [Fri, 23 Jan 2015 22:57:02 +0000 (22:57 +0000)]
llvm-cov: Use range-for (NFC)

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

7 years agomips: Fix "XPASS" test results by removing 'not' commands
Reid Kleckner [Fri, 23 Jan 2015 22:55:31 +0000 (22:55 +0000)]
mips: Fix "XPASS" test results by removing 'not' commands

These tests are asserting and crashing for me, and 'not' sees that as a
non-zero exit code instead of a signal code for obscure Windows reasons.
This causes the test to pass, giving me an unclean 'ninja check'.

The test is already XFAILd, so just run the test without 'not' and let
lit handle the failure.

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

7 years ago[x86] Combine x86mmx/i64 to v2i64 conversion to use scalar_to_vector
Bruno Cardoso Lopes [Fri, 23 Jan 2015 22:44:16 +0000 (22:44 +0000)]
[x86] Combine x86mmx/i64 to v2i64 conversion to use scalar_to_vector

Handle the poor codegen for i64/x86xmm->v2i64 (%mm -> %xmm) moves. Instead of
using stack store/load pair to do the job, use scalar_to_vector directly, which
in the MMX case can use movq2dq. This was the current behavior prior to
improvements for vector legalization of extloads in r213897.

This commit fixes the regression and as a side-effect also remove some
unnecessary shuffles.

In the new attached testcase, we go from:

pshufw  $-18, (%rdi), %mm0
movq    %mm0, -8(%rsp)
movq    -8(%rsp), %xmm0
pshufd  $-44, %xmm0, %xmm0
movd    %xmm0, %eax


pshufw  $-18, (%rdi), %mm0
movq2dq %mm0, %xmm0
movd    %xmm0, %eax

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

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

7 years agollvm-cov: clang-format the GCOV files (NFC)
Justin Bogner [Fri, 23 Jan 2015 22:38:01 +0000 (22:38 +0000)]
llvm-cov: clang-format the GCOV files (NFC)

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

7 years agoFix the MSVC build with the new Orc JIT APIs
Reid Kleckner [Fri, 23 Jan 2015 22:25:47 +0000 (22:25 +0000)]
Fix the MSVC build with the new Orc JIT APIs

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

7 years ago[YAMLIO] Dirty hack: Force integral conversion to allow strong typedefs to convert.
Michael J. Spencer [Fri, 23 Jan 2015 22:24:57 +0000 (22:24 +0000)]
[YAMLIO] Dirty hack: Force integral conversion to allow strong typedefs to convert.

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

7 years ago[Orc] Remove a bunch of constructors from ObjectLinkingLayer.
Lang Hames [Fri, 23 Jan 2015 22:11:07 +0000 (22:11 +0000)]
[Orc] Remove a bunch of constructors from ObjectLinkingLayer.

These constructors were causing trouble for MSVC and older GCCs. This should
fix more of the build failures from r226940.

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

7 years agoR600/SI: Move i64 -> v2i32 load promotion into AMDGPUDAGToDAGISel::Select()
Tom Stellard [Fri, 23 Jan 2015 22:05:45 +0000 (22:05 +0000)]
R600/SI: Move i64 -> v2i32 load promotion into AMDGPUDAGToDAGISel::Select()

We used to do this promotion during DAG legalization, but this
caused an infinite loop in ExpandUnalignedLoad() because it assumed
that i64 loads were legal if i64 was a legal type.

It also seems better to report i64 loads as legal, since they actually
are and we were just promoting them to simplify our tablegen files.

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

7 years ago[Object][ELF] Test unknown type.
Michael J. Spencer [Fri, 23 Jan 2015 21:58:09 +0000 (21:58 +0000)]
[Object][ELF] Test unknown type.

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

7 years ago[YAMLIO] Add support for numeric values in enums.
Michael J. Spencer [Fri, 23 Jan 2015 21:57:50 +0000 (21:57 +0000)]
[YAMLIO] Add support for numeric values in enums.

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

7 years ago[Orc] LLVMLinkInOrcMCJITReplacement shouldn't be in the anonymous namespace.
Lang Hames [Fri, 23 Jan 2015 21:49:12 +0000 (21:49 +0000)]
[Orc] LLVMLinkInOrcMCJITReplacement shouldn't be in the anonymous namespace.

This should fix some of the builder errors from r226940.

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

7 years ago[Orc] New JIT APIs.
Lang Hames [Fri, 23 Jan 2015 21:25:00 +0000 (21:25 +0000)]
[Orc] New JIT APIs.

This patch adds a new set of JIT APIs to LLVM. The aim of these new APIs is to
cleanly support a wider range of JIT use cases in LLVM, and encourage the
development and contribution of re-usable infrastructure for LLVM JIT use-cases.

These APIs are intended to live alongside the MCJIT APIs, and should not affect
existing clients.

Included in this patch:

1) New headers in include/llvm/ExecutionEngine/Orc that provide a set of
   components for building JIT infrastructure.
   Implementation code for these headers lives in lib/ExecutionEngine/Orc.

2) A prototype re-implementation of MCJIT (OrcMCJITReplacement) built out of the
   new components.

3) Minor changes to RTDyldMemoryManager needed to support the new components.
   These changes should not impact existing clients.

4) A new flag for lli, -use-orcmcjit, which will cause lli to use the
   OrcMCJITReplacement class as its underlying execution engine, rather than
   MCJIT itself.

Tests to follow shortly.

Special thanks to Michael Ilseman, Pete Cooper, David Blaikie, Eric Christopher,
Justin Bogner, and Jim Grosbach for extensive feedback and discussion.

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

7 years agoMove the accessor functions from DIExpression::iterator into a wrapper
Adrian Prantl [Fri, 23 Jan 2015 21:24:41 +0000 (21:24 +0000)]
Move the accessor functions  from DIExpression::iterator into a wrapper
DIExpression::Operand, so we can write range-based for loops.

Thanks to David Blaikie for the idea.

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

7 years agolit: Make MCJIT's supported arch check case insensitive
Reid Kleckner [Fri, 23 Jan 2015 21:11:40 +0000 (21:11 +0000)]
lit: Make MCJIT's supported arch check case insensitive

Should make the tests run when using CMake on systems where 'uname -p'
reports "amd64", such as FreeBSD.

Should fix PR21559.

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

7 years agoFix the problem with llvm-objdump and -archive-headers in printing the archive header...
Kevin Enderby [Fri, 23 Jan 2015 21:02:44 +0000 (21:02 +0000)]
Fix the problem with llvm-objdump and -archive-headers in printing the archive header size field.
This problem showed up with the clang-cmake-armv7-a15-full bot.  Thanks to Renato Golin for his help.

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

7 years ago[mips] fix spelling of 'disassembler'
Alexei Starovoitov [Fri, 23 Jan 2015 21:00:08 +0000 (21:00 +0000)]
[mips] fix spelling of 'disassembler'

trivial first commit

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

7 years agoLowerSwitch: replace unreachable default with popular case destination
Hans Wennborg [Fri, 23 Jan 2015 20:43:51 +0000 (20:43 +0000)]
LowerSwitch: replace unreachable default with popular case destination

SimplifyCFG currently does this transformation, but I'm planning to remove that
to allow other passes, such as this one, to exploit the unreachable default.

This patch takes care to keep track of what case values are unreachable even
after the transformation, allowing for more efficient lowering.

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

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

7 years ago[Objdump] Output information about common symbols in a way closer to GNU objdump.
Colin LeMahieu [Fri, 23 Jan 2015 20:06:24 +0000 (20:06 +0000)]
[Objdump] Output information about common symbols in a way closer to GNU objdump.

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

7 years ago[emacs] llvm-mode: fix parens, font-lock i*
Ramkumar Ramachandra [Fri, 23 Jan 2015 19:45:35 +0000 (19:45 +0000)]
[emacs] llvm-mode: fix parens, font-lock i*

In llvm-mode, with electric-pair-mode turned on, typing a literal '['
would print out '[[', and '(' would print a '(('. This was a very
annoying bug caused by overzealous syntax-table entries: the parens are
already part of the '(' and ')' class by default. Fix this.

While at it, notice that i32, i64, i1 etc. are not font-locked despite a
clear intent to do so. The issue is that regexp-opt doesn't accept
regular expressions. So, spell out the common literal integers with
different widths.

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

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

7 years agoAdd the option, -data-in-code, to llvm-objdump used with -macho to print the Mach...
Kevin Enderby [Fri, 23 Jan 2015 18:52:17 +0000 (18:52 +0000)]
Add the option, -data-in-code, to llvm-objdump used with -macho to print the Mach-O data in code table.

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

7 years agoClassify functions by EH personality type rather than using the triple
Reid Kleckner [Fri, 23 Jan 2015 18:49:01 +0000 (18:49 +0000)]
Classify functions by EH personality type rather than using the triple

This mostly reverts commit r222062 and replaces it with a new enum. At
some point this enum will grow at least for other MSVC EH personalities.

Also beefs up the way we were sniffing the personality function.
Previously we would emit the Itanium LSDA despite using

Reviewers: majnemer

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

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

7 years agoDebug Info / PR22309: Allow union types to be emitted as unsigned constants.
Adrian Prantl [Fri, 23 Jan 2015 18:01:39 +0000 (18:01 +0000)]
Debug Info / PR22309: Allow union types to be emitted as unsigned constants.

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

7 years agoRemove some local variables in place of just querying for them
Eric Christopher [Fri, 23 Jan 2015 17:22:44 +0000 (17:22 +0000)]
Remove some local variables in place of just querying for them
in the couple of asserts.

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

7 years ago[mips] Add new error message and improve testing for parsing the .module directive.
Toma Tabacu [Fri, 23 Jan 2015 10:40:19 +0000 (10:40 +0000)]
[mips] Add new error message and improve testing for parsing the .module directive.

We used to silently ignore any empty .module's and we used to give an error saying that we found
an "unexpected token at start of statement" when the value of the option wasn't an identifier (e.g. if it was a number).

We now give an error saying that we "expected .module option identifier" in both of those cases.

I also fixed the other tests in mips-abi-bad.s, which all seemed to be broken.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

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

7 years agoThis patch fixes issue with lowering below mentioned pattern :-
Jyoti Allur [Fri, 23 Jan 2015 09:10:03 +0000 (09:10 +0000)]
This patch fixes issue with lowering below mentioned pattern :-
        smull  r0, r1, r1, r0
smull  r2, r3, r3, r2
adds r0, r2, r0
adc r1, r3, r1
bx lr


        smull  r0, r1, r1, r0
smlal  r0, r1, r3, r2
bx lr

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

7 years ago[x86] Change u8imm operands to always print as unsigned. This makes shuffle masks...
Craig Topper [Fri, 23 Jan 2015 08:00:59 +0000 (08:00 +0000)]
[x86] Change u8imm operands to always print as unsigned. This makes shuffle masks and the like make way more sense.

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

7 years agoDAGCombine: always constant fold FMA when target disable FP exceptions
Mehdi Amini [Fri, 23 Jan 2015 07:07:20 +0000 (07:07 +0000)]
DAGCombine: always constant fold FMA when target disable FP exceptions

Summary: When trying to constant fold an FMA in the DAG, getNode()
fails to fold the FMA if an operand is not finite. In this case this
patch allows the constant folding if !TLI->hasFloatingPointExceptions()

Reviewers: resistor

Reviewed By: resistor

Subscribers: hfinkel, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

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

7 years ago[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.
Lang Hames [Fri, 23 Jan 2015 06:25:17 +0000 (06:25 +0000)]
[ADT] Add move operations to SmallVector<T,N> from SmallVectorImpl<T>.

This makes it possible to move between SmallVectors of different sizes.

Thanks to Dave Blaikie and Duncan Smith for patch feedback.

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

7 years agoFix 80 column violation
Craig Topper [Fri, 23 Jan 2015 06:18:35 +0000 (06:18 +0000)]
Fix 80 column violation

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

7 years ago[X86] Add IntrNoMem to the AVX512 conflict intrinsics.
Craig Topper [Fri, 23 Jan 2015 06:11:45 +0000 (06:11 +0000)]
[X86] Add IntrNoMem to the AVX512 conflict intrinsics.

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

7 years agoAdd STB_GNU_UNIQUE to the ELF writer.
Rafael Espindola [Fri, 23 Jan 2015 04:44:35 +0000 (04:44 +0000)]
Add STB_GNU_UNIQUE to the ELF writer.

This lets llvm-mc assemble files produced by gcc.

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

7 years agoPrune an out-of-date \param since r226476. [-Wdocumentation]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:05:12 +0000 (01:05 +0000)]
Prune an out-of-date \param since r226476. [-Wdocumentation]

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

7 years agoReformat.
NAKAMURA Takumi [Fri, 23 Jan 2015 01:02:07 +0000 (01:02 +0000)]

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

7 years agoMipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]
NAKAMURA Takumi [Fri, 23 Jan 2015 01:01:52 +0000 (01:01 +0000)]
MipsAsmParser.cpp: Suppress a warning introduced in r226657. [-Wunused-variable]

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

7 years agoR600: Try to use lower types for 64bit division if possible
Jan Vesely [Thu, 22 Jan 2015 23:42:43 +0000 (23:42 +0000)]
R600: Try to use lower types for 64bit division if possible

v2: add and enable tests for SI

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226881 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT
Jan Vesely [Thu, 22 Jan 2015 23:42:41 +0000 (23:42 +0000)]
SelectionDAG: Add KnownBits and SignBits computation for EXTRACT_ELEMENT

v2: use getZExtValue
    add missing break

v3: add few more comments

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226880 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoR600: Simplify LowerUDIVREM
Jan Vesely [Thu, 22 Jan 2015 23:42:39 +0000 (23:42 +0000)]
R600: Simplify LowerUDIVREM

optimizations can handle removing the Hi part operations.
The generated code is identical for R600, ~10% icount reduction for SI

v2: rebase

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226879 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoIR: Change GenericDwarfNode::getHeader() to StringRef
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 23:10:55 +0000 (23:10 +0000)]
IR: Change GenericDwarfNode::getHeader() to StringRef

Simplify the API to use a `StringRef` directly rather than exposing the
`MDString` bits underneath.

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

7 years agoIR: DwarfNode => DebugNode, NFC
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 22:47:44 +0000 (22:47 +0000)]
IR: DwarfNode => DebugNode, NFC

These things are potentially used for non-DWARF data (see the discussion
in PR22235), so take the `Dwarf` out of the name.  Since the new name
gives fewer clues, update the doxygen to properly describe what they

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

7 years ago[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.
Simon Pilgrim [Thu, 22 Jan 2015 22:39:59 +0000 (22:39 +0000)]
[X86][AVX] Added (V)MOVDDUP / (V)MOVSLDUP / (V)MOVSHDUP memory folding + tests.

Minor tweak now that D7042 is complete, we can enable stack folding for (V)MOVDDUP and do proper testing.

Added missing AVX ymm folding patterns and fixed alignment for AVX VMOVSLDUP / VMOVSHDUP.

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

7 years agoLine endings fixes. NFC.
Simon Pilgrim [Thu, 22 Jan 2015 22:27:37 +0000 (22:27 +0000)]
Line endings fixes. NFC.

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

7 years ago[X86][SSE] Simplified PSUBUS tests
Simon Pilgrim [Thu, 22 Jan 2015 22:19:58 +0000 (22:19 +0000)]
[X86][SSE] Simplified PSUBUS tests

Removed loops from PSUBUS tests - ensures folding is tested. Also renamed SSE2 tests SSSE3 to match cpu.

This is a follow up commit agreed in http://reviews.llvm.org/D7094

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

7 years ago[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
Lang Hames [Thu, 22 Jan 2015 22:04:47 +0000 (22:04 +0000)]
[Object] Fix a bug in a condition introduced in r226217 - visibility can't be
both hidden and default.

Bug found by inspection by Rafael Espindola. No test: As discussed in the commit
message for r226217 we don't have a good way to test this yet.

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

7 years ago[PM] Actually add the new pass manager support for the assumption cache.
Chandler Carruth [Thu, 22 Jan 2015 21:53:09 +0000 (21:53 +0000)]
[PM] Actually add the new pass manager support for the assumption cache.

I had already factored this analysis specifically to enable doing this,
but hadn't actually committed the necessary wiring to get at this from
the new pass manager. This also nicely shows how the separate cache
object can be directly managed by the new pass manager.

This analysis didn't have any direct tests and so I've added a printer
pass and a boring test case. I chose to print the i1 value which is
being assumed rather than the call to llvm.assume as that seems much
more useful for testing... but suggestions on an even better printing
strategy welcome. My main goal was to make sure things actually work. =]

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

7 years agoRemove dead leak detector parts that fell out of use in r224703.
Benjamin Kramer [Thu, 22 Jan 2015 21:43:01 +0000 (21:43 +0000)]
Remove dead leak detector parts that fell out of use in r224703.

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

7 years agoIR: Update references to temporaries before deleting
Duncan P. N. Exon Smith [Thu, 22 Jan 2015 21:36:45 +0000 (21:36 +0000)]
IR: Update references to temporaries before deleting

During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)`
to update all tracking references to `nullptr`.

This fixes PR22280, where inverted destruction order between tracking
references and the temporaries themselves caused a use-after-free in

An alternative fix would be to add an assertion that there are no users,
and continue to fix inverted destruction order in clients (like
`LLParser`), but instead I decided to make getting-teardown-right easy.
(If someone disagrees let me know.)

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

7 years agoRefactoring cl::parser construction and initialization.
Chris Bieneman [Thu, 22 Jan 2015 21:01:12 +0000 (21:01 +0000)]
Refactoring cl::parser construction and initialization.

Some parsers need references back to the option they are members of. This is used for handling the argument string as well as by the various pass name parsers for making pass names into flags.

Making parsers that need to refer back to the option have a reference to the option eliminates some of the members of various parsers, and enables further code cleanup.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

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

7 years agoDon't use -z,defs on FreeBSD.
Rafael Espindola [Thu, 22 Jan 2015 20:57:30 +0000 (20:57 +0000)]
Don't use -z,defs on FreeBSD.

Looks like environ is defined only in the main binary.

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

7 years ago[emacs] Use c-mode-common-hook, derive from "gnu"
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:56:25 +0000 (20:56 +0000)]
[emacs] Use c-mode-common-hook, derive from "gnu"

Make it clear that the "llvm.org" style is deriving from "gnu" style,
and use the c-mode-common-hook instead of c-mode-hook and c++-mode-hook.

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

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

7 years agoIntrinsics: introduce llvm_any_ty aka ValueType Any
Ramkumar Ramachandra [Thu, 22 Jan 2015 20:14:38 +0000 (20:14 +0000)]
Intrinsics: introduce llvm_any_ty aka ValueType Any

Specifically, gc.result benefits from this greatly. Instead of:


We now have a gc.result.* that can specialize to literally any type.

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

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

7 years agoRevert "Don't remove a landing pad if the invoke requires a table entry."
Reid Kleckner [Thu, 22 Jan 2015 19:29:46 +0000 (19:29 +0000)]
Revert "Don't remove a landing pad if the invoke requires a table entry."

This reverts commit r176827.

Bj√∂rn Steinbrink pointed out that this didn't actually fix the bug
(PR15555) it was attempting to fix.

With this reverted, we can now remove landingpad cleanups that
immediately resume unwinding, converting the invoke to a call.

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

7 years agoAdd the option, -indirect-symbols, used with -macho to print the Mach-O indirect...
Kevin Enderby [Thu, 22 Jan 2015 18:55:27 +0000 (18:55 +0000)]
Add the option, -indirect-symbols, used with -macho to print the Mach-O indirect symbol table to llvm-objdump.

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

7 years agomerge consecutive stores of extracted vector elements (PR21711)
Sanjay Patel [Thu, 22 Jan 2015 18:21:26 +0000 (18:21 +0000)]
merge consecutive stores of extracted vector elements (PR21711)

This is a 2nd try at the same optimization as http://reviews.llvm.org/D6698.
That patch was checked in at r224611, but reverted at r225031 because it
caused a failure outside of the regression tests.

The cause of the crash was not recognizing consecutive stores that have mixed
source values (loads and vector element extracts), so this patch adds a check
to bail out if any store value is not coming from a vector element extract.

This patch also refactors the shared logic of the constant source and vector
extracted elements source cases into a helper function.

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

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

7 years agoFix the condition in this assertion, and also make it into an unreachable.
Adrian Prantl [Thu, 22 Jan 2015 17:52:08 +0000 (17:52 +0000)]
Fix the condition in this assertion, and also make it into an unreachable.

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

7 years agoRevert "PR21408: Workaround the appearance of duplicate variables due to problems...
David Blaikie [Thu, 22 Jan 2015 17:49:59 +0000 (17:49 +0000)]
Revert "PR21408: Workaround the appearance of duplicate variables due to problems when inlining two calls to the same function from the same call site."

The underlying bug has been fixed in r226736 so there's no need to
workaround this anymore.

This reverts commit r220923.

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

7 years agoAArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.
Tim Northover [Thu, 22 Jan 2015 17:23:04 +0000 (17:23 +0000)]
AArch64: decode all MRS/MSR forms early to avoid saving FeatureBits.

Currently, we're adding a uint64_t describing the current subtarget so
that matching can check whether the specified register is valid.
However, we want to move to a bitset for those bits (x86 has more than
64 of them).

This can't live in a union so it's probably better to do the checks
early (especially as there are only 3 of them).

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

7 years agoRun clang-format on parts of DebugInfo.h
Adrian Prantl [Thu, 22 Jan 2015 16:55:27 +0000 (16:55 +0000)]
Run clang-format on parts of DebugInfo.h

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

7 years agoDocument DIExpression.
Adrian Prantl [Thu, 22 Jan 2015 16:55:24 +0000 (16:55 +0000)]
Document DIExpression.

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

7 years agoRewrite DIExpression::printInternal() to use the iterator interface.
Adrian Prantl [Thu, 22 Jan 2015 16:55:22 +0000 (16:55 +0000)]
Rewrite DIExpression::printInternal() to use the iterator interface.

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

7 years agoRename DIExpressionIterator to DIExpression::iterator.
Adrian Prantl [Thu, 22 Jan 2015 16:55:20 +0000 (16:55 +0000)]
Rename DIExpressionIterator to DIExpression::iterator.
Addresses review feedback from Duncan.

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

7 years agoFix a comment.
Adrian Prantl [Thu, 22 Jan 2015 16:55:16 +0000 (16:55 +0000)]
Fix a comment.

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

7 years ago[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.
Rafael Espindola [Thu, 22 Jan 2015 14:20:45 +0000 (14:20 +0000)]
[pr21886] Change MCJIT/ELF to support MSVC C++ mangled symbol.

The ELF format is used on Windows by the MCJIT engine. Thus, on Windows, the
ELFObjectWriter can encounter symbols mangled using the MS Visual Studio C++
name mangling. Symbols mangled using the MSVC C++ name mangling can legally
have "@@@" as a substring. The EFLObjectWriter should not interpret the "@@@"
substring as specifying GNU-style symbol versioning. The ELFObjectWriter
therefore check for the MSVC C++ name mangling prefix which is either "?", "@?",
"imp_?" or "imp_?@".

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

7 years agoPass -Wl,-z,defs when building shared libraries, but not with the sanitizers.
Rafael Espindola [Thu, 22 Jan 2015 14:06:51 +0000 (14:06 +0000)]
Pass -Wl,-z,defs when building shared libraries, but not with the sanitizers.

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

7 years agoSilencing a -Wsign-compare warning (all uses of this constant are within unsigned...
Aaron Ballman [Thu, 22 Jan 2015 13:57:41 +0000 (13:57 +0000)]
Silencing a -Wsign-compare warning (all uses of this constant are within unsigned expressions anyway); NFC.

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

7 years ago[DAGCombine] Produce better code for constant splats
Michael Kuperstein [Thu, 22 Jan 2015 13:07:28 +0000 (13:07 +0000)]
[DAGCombine] Produce better code for constant splats

This solves PR22276.
Splats of constants would sometimes produce redundant shuffles, sometimes ridiculously so (see the PR for details). Fold these shuffles into BUILD_VECTORs early on instead.

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

Fixed recommit of r226811.

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

7 years agoMark |TLI| variables used to suppress -Wunused-variable warnings.
Alexander Potapenko [Thu, 22 Jan 2015 13:03:33 +0000 (13:03 +0000)]
Mark |TLI| variables used to suppress -Wunused-variable warnings.
(These vars are only used in assertions)

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