Use CHECK-DAG to reduce the noise in an upcoming patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223663 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Adding packhl instruction.

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

This is just testing the largest merge mode for comdats. No need to use
hard to read names and fancy types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223665 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify the test. NFC.

Since the main file was empty, we can just copy the content of the Input file
into it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223666 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Adding combine reg, reg with predicated forms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223667 91177308-0d34-0410-b5e6-96231b3b80d8
[X86] Improved tablegen patters for matching TZCNT/LZCNT.

Teach ISel how to match a TZCNT/LZCNT from a conditional move if the
condition code is X86_COND_NE.
Existing tablegen patterns only allowed to match TZCNT/LZCNT from a
X86cond with condition code equal to X86_COND_E. To avoid introducing
extra rules, I added an 'ImmLeaf' definition that checks if the
condition code is COND_E or COND_NE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223668 91177308-0d34-0410-b5e6-96231b3b80d8
AArch64: treat HFAs containing "half" types as blocks too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223669 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the JIT code for the Kaleidoscope tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223670 91177308-0d34-0410-b5e6-96231b3b80d8
Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.

Thanks to David Blaikie for his assistance with this tutorial.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223671 91177308-0d34-0410-b5e6-96231b3b80d8
InstrProf: An intrinsic and lowering for instrumentation based profiling

Introduce the ``llvm.instrprof_increment`` intrinsic and the
``-instrprof`` pass. These provide the infrastructure for writing
counters for profiling, as in clang's ``-fprofile-instr-generate``.

The implementation of the instrprof pass is ported directly out of the
CodeGenPGO classes in clang, and with the followup in clang that rips
that code out to use these new intrinsics this ends up being NFC.

Doing the instrumentation this way opens some doors in terms of
improving the counter performance. For example, this will make it
simple to experiment with alternate lowering strategies, and allows us
to try handling profiling specially in some optimizations if we want
to.

Finally, this drastically simplifies the frontend and puts all of the
lowering logic in one place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223672 91177308-0d34-0410-b5e6-96231b3b80d8
Don't crash when the key of a comdat is lazily linked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223673 91177308-0d34-0410-b5e6-96231b3b80d8
Fix KS tutorial build failure.

make all doesn't build the examples and it was uniquified since
last build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223675 91177308-0d34-0410-b5e6-96231b3b80d8
[CompactUnwind] Fix register encoding logic

Fix a compact unwind encoding logic bug which would try to encode
more callee saved registers than it should, leading to early bail out
in the encoding logic and abusive use of DWARF frame mode unnecessarily.

Also remove no-compact-unwind.ll which was testing the wrong thing
based on this bug and move it to valid 'compact unwind' tests. Added
other few more tests too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223676 91177308-0d34-0410-b5e6-96231b3b80d8
Attempt to fix the cmake build by requiring mcjit on the cmake
dependencies for the KS tutorials

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223677 91177308-0d34-0410-b5e6-96231b3b80d8
Once more on the cmake build. nativecodegen->native on the dependencies.

Thanks to Rafael Espindola for testing assistance.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223678 91177308-0d34-0410-b5e6-96231b3b80d8
InstSimplify: Try to bring back the rest of r223583

This reverts r223624 with a small tweak, hopefully this will make stage3
equivalent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223679 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Adding add/sub with saturation.  Removing unused def.  Cleaning up shift patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223680 91177308-0d34-0410-b5e6-96231b3b80d8
Lazily link GlobalVariables and GlobalAliases.

We were already lazily linking functions, but all GlobalValues can be treated
uniformly for this.

The test updates are to ensure that a given GlobalValue is still linked in.

This fixes pr21494.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223681 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up the rst for the debug info tutorial

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223682 91177308-0d34-0410-b5e6-96231b3b80d8
ConstantFold: Zero-sized globals might land on top of another global

A zero sized array is zero sized and might share its address with
another global.

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