Fix ARM triple parsing

The triple parser should only accept existing architecture names
when the triple starts with armv, armebv, thumbv or thumbebv.

Patch by Gabor Ballabas.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222129 91177308-0d34-0410-b5e6-96231b3b80d8
Use a more canonical way of computing a mask with N trailing 1s. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222137 91177308-0d34-0410-b5e6-96231b3b80d8
[Reassociate] Canonicalize constants to RHS operand.

Fix a thinko where the RHS was already a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222139 91177308-0d34-0410-b5e6-96231b3b80d8
[X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222141 91177308-0d34-0410-b5e6-96231b3b80d8
[Reassociate] As the expression tree is rewritten make sure the operands are
emitted in canonical form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222142 91177308-0d34-0410-b5e6-96231b3b80d8
Avoid undefined behavior by masking the shift amount.

Should hopefully fix the mips bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222146 91177308-0d34-0410-b5e6-96231b3b80d8
Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"

The specializations were broken. For example,

void foo(const CallGraph *G) {
  auto I = GraphTraits<const CallGraph *>::nodes_begin(G);
  auto K = I++;

  ...
}

or

void bar(const CallGraphNode *N) {
  auto I = GraphTraits<const CallGraphNode *>::nodes_begin(G);
  auto K = I++;

  ....
}

would not compile.

Patch by Speziale Ettore!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222149 91177308-0d34-0410-b5e6-96231b3b80d8
Revert commits r222146 and r222137.

They were producing the wrong result if NumBits == BitsInWord. The old mask
produced -1, the new mask 0.

This should fix the 32 bit bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222166 91177308-0d34-0410-b5e6-96231b3b80d8
[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.

When converting a switch to a lookup table we might have to generate a bitmaks
to encode and check for holes in the original switch statement.

The type of this mask depends on the number of switch statements, which can
result in illegal types for pretty much all architectures.

To avoid unnecessary type legalization and help FastISel this commit increases
the size of the bitmask to next power-of-2 value when necessary.

This fixes rdar://problem/18984639.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222168 91177308-0d34-0410-b5e6-96231b3b80d8
Pass a reference to ValueEnumerator.

NFC. This will just make it easier to use std::unique_ptr in a caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222170 91177308-0d34-0410-b5e6-96231b3b80d8
Factor common code it Linker::init.

The TypeFinder was not being used in one of the constructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222172 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the autoconf build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222173 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Assume SIFixSGPRCopies makes changes

I'm not sure if this was breaking anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222174 91177308-0d34-0410-b5e6-96231b3b80d8
R600/SI: Don't copy flags when extracting subreg

This was resulting in use of a register after a kill.
For some reason this showed up as a problem in many tests
when moving the SIFixSGPRCopies pass closer to instruction
selection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222175 91177308-0d34-0410-b5e6-96231b3b80d8
ADT: correctly report isMSVCEnvironment for windows itanium

The itanium environment on Windows uses MSVC and is a MSVC environment.  Report
this correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222180 91177308-0d34-0410-b5e6-96231b3b80d8
CMake: Use the new USES_TERMINAL option for test suite targets when available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222181 91177308-0d34-0410-b5e6-96231b3b80d8
Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member.

The next step is to actually use unique_ptr in TreePatternNode's
Children vector. That will be more intrusive, and may not work,
depending on exactly how these things are handled (I have a bad
suspicion things are shared more than they should be, making this more
DAG than tree - but if it's really a tree, unique_ptr should suffice)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222183 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member."

This reverts commit r222183.

Broke on the MSVC buildbots due to MSVC not producing default move
operations - I'd fix it immediately but just broke my build system a
bit, so backing out until I have a chance to get everything going again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222187 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "ADT: correctly report isMSVCEnvironment for windows itanium"

This reverts commit r222180.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222188 91177308-0d34-0410-b5e6-96231b3b80d8
IR: Simplify uniquing for MDNode

Change uniquing from a `FoldingSet` to a `DenseSet` with custom
`DenseMapInfo`.  Unfortunately, this doesn't save any memory, since
`DenseSet<T>` is a simple wrapper for `DenseMap<T, char>`, but I'll come
back to fix that later.

I used the name `GenericDenseMapInfo` to the custom `DenseMapInfo` since
I'll be splitting `MDNode` into two classes soon: `MDNodeFwdDecl` for
temporaries, and `GenericMDNode` for everything else.

I also added a non-debug-info reduced version of a type-uniquing test
that started failing on an earlier draft of this patch.

Part of PR21532.

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