Return word_t from read.

This removes the need for a special Read64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221909 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Allow commuting some 3 op instructions

e.g. v_mad_f32 a, b, c -> v_mad_f32 b, a, c

This simplifies matching v_madmk_f32.

This looks somewhat surprising, but it appears to be
OK to do this. We can commute src0 and src1 in all
of these instructions, and that's all that appears
to matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221910 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Allow commuting with src2_modifiers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221911 91177308-0d34-0410-b5e6-96231b3b80d8
Use -Wcast-qual in cmake builds, not only autoconfo ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221913 91177308-0d34-0410-b5e6-96231b3b80d8
Object, Mach-O: Refactor and clean code up

Don't assert if we can return an error code, reuse existing
functionality like is64Bit().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221915 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Get rid of FCLAMP_SI pseudo

It's not necessary. Also use complex patterns to allow
src modifier usage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221916 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Error on initializer for LDS.

Also give a proper error for other address spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221917 91177308-0d34-0410-b5e6-96231b3b80d8
Un-break the big-endian buildbots


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221919 91177308-0d34-0410-b5e6-96231b3b80d8
R600: Fix assert on empty function

If a function is just an unreachable, this would hit a
"this is not a MachO target" assertion because of setting
HasSubsectionViaSymbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221920 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Fix definition for s_cselect_b32

These were directly using the old base instruction
class, and specifying the wrong register classes
for operands. The operands can be the other special
inputs besides SGPRs. The op name was also being
directly used for the asm string, so this was printed
without any operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221921 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Use s_movk_i32

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221922 91177308-0d34-0410-b5e6-96231b3b80d8
[FastISel][AArch64] Don't bail during simple GEP instruction selection.

The generic FastISel code would bail, because it can't emit a sign-extend for
AArch64. This copies the code over and uses AArch64 specific emit functions.

This is not ideal and 'computeAddress' should handles this, so it can fold the
address computation into the memory operation.

I plan to clean up 'computeAddress' anyways, so I will add that in a future
commit.

Related to rdar://problem/18962471.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221923 91177308-0d34-0410-b5e6-96231b3b80d8
[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE.

Phabricator Revision: http://reviews.llvm.org/D6103
Patch by "Balaram Makam" <bmakam@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221924 91177308-0d34-0410-b5e6-96231b3b80d8
We can get the TLOF from the TargetMachine - so constructor no longer requires TargetLoweringObjectFile to be passed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221926 91177308-0d34-0410-b5e6-96231b3b80d8
Use unique_ptr to handle ownership of TreePatterns in CodeGenDAGPatterns::PatternFragments

We might be able to use unique_ptr to handle ownership of the
TreePatternNodes too - looking into that next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221928 91177308-0d34-0410-b5e6-96231b3b80d8
Make a few helper functions static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221930 91177308-0d34-0410-b5e6-96231b3b80d8
Fix nested namespace with decltype to hopefully work with MSVC

Build failed here:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/14629/steps/build_Lld/logs/stdio

So I'm taking a shot in the dark that MSVC (whatever version that is)
can't cope with nested name specifiers with a decltype prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221931 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid usage of char16_t as MSVC "14" doesn't appear to support it

Fixes the MSVC "14" build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221932 91177308-0d34-0410-b5e6-96231b3b80d8
Move calls to push_back out of readAbbreviated(Literal|Field).

These functions always return a single value and not all callers want to
push them into a SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221934 91177308-0d34-0410-b5e6-96231b3b80d8
[x86] Add some tests for specific patterns of lane-flips combined with
in-lane shuffles that aren't always handled well by the current vector
shuffle lowering.

No functionality change yet, that will follow in a subsequent commit.

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