R600/SI: Disable commutativity for MIN/MAX_LEGACY

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222746 91177308-0d34-0410-b5e6-96231b3b80d8
[InstCombine] Change LLVM To canonicalize toward the value type being
stored rather than the pointer type.

This change is analogous to r220138 which changed the canonicalization
for loads. The rationale is the same: memory does not have a type,
operations (and thus the values they produce) have a type. We should
match that type as closely as possible rather than reading some form of
semantics into the pointer type.

With this change, loads and stores should no longer be made with
nonsensical types for the values that tehy load and store. This is
particularly important when trying to match specific loaded and stored
types in the process of doing other instcombines, which is what led me
down this twisty maze of miscanonicalization.

I've put quite some effort into looking through IR to find places where
LLVM's optimizer was being unreasonably conservative in the face of
mismatched load and store types, however it is possible (let's say,
likely!) I have missed some. If you see regressions here, or from
r220138, the likely cause is some part of LLVM failing to cope with load
and store types differing. Test cases appreciated, it is important that
we root all of these out of LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222748 91177308-0d34-0410-b5e6-96231b3b80d8
[mips][micromips] Use call instructions with short delay slots
Differential Revision: http://reviews.llvm.org/D6338


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222752 91177308-0d34-0410-b5e6-96231b3b80d8
Revert r222746: That commit did not update any tests and caused two R600
tests to start failing.

Original commit log: R600/SI: Disable commutativity for MIN/MAX_LEGACY

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222753 91177308-0d34-0410-b5e6-96231b3b80d8
Remove a bit of duplicated code.

Exactly the same checks are present in areTypesIsomorphic.

This might have been a premature performance optimization. I cannot reproduce
any slowdown with this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222758 91177308-0d34-0410-b5e6-96231b3b80d8
Mark as explicit failing on x86-64 -- small memory model doesn't agree
with default address selections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222759 91177308-0d34-0410-b5e6-96231b3b80d8
Reapply 222538 and update tests to explicitly request small code model
and PIC:

Allow FDE references outside the +/-2GB range supported by PC relative
offsets for code models other than small/medium. For JIT application,
memory layout is less controlled and can result in truncations
otherwise.

Patch from Akos Kiss.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222760 91177308-0d34-0410-b5e6-96231b3b80d8
Misc style fixes. NFC.

This just reduces the noise in the next patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222761 91177308-0d34-0410-b5e6-96231b3b80d8
[msan] Annotate zlib functions for MemorySanitizer.

Mark destination buffer in zlib::compress and zlib::decompress as fully
initialized.

When building LLVM with system zlib and MemorySanitizer instrumentation,
MSan does not observe memory writes in zlib code and erroneously considers
zlib output buffers as uninitialized, resulting in false use-of-uninitialized
memory reports. This change helps MSan understand the state of that memory
and prevents such reports.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222763 91177308-0d34-0410-b5e6-96231b3b80d8
Set the body of a new struct as soon as it is created.

This changes the order in which different types are passed to get, but
one order is not inherently better than the other.

The main motivation is that this simplifies linkDefinedTypeBodies now that
it is only linking "real" opaque types. It is also means that we only have to
call it once and that we don't need getImpl.

A small change in behavior is that we don't copy type names when resolving
opaque types. This is an improvement IMHO, but it can be added back if
desired. A test is included with the new behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222764 91177308-0d34-0410-b5e6-96231b3b80d8
Small model and JIT generally don't go well with each other.
On LP64 platforms, it will work or not depending on the choosen memory
layout, so neither PASS nor XFAIL is appropiate.
As UNSUPPORTED as per-test target doesn't exist (yet), remove the test
instead to unbreak the builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222767 91177308-0d34-0410-b5e6-96231b3b80d8
LazyValueInfo: Actually re-visit partially solved block-values in solveBlockValue()

If solveBlockValue() needs results from predecessors that are not already
computed, it returns false with the intention of resuming when the dependencies
have been resolved. However, the computation would never be resumed since an
'overdefined' result had been placed in the cache, preventing any further
computation.

The point of placing the 'overdefined' result in the cache seems to have been
to break cycles, but we can check for that when inserting work items in the
BlockValue stack instead. This makes the "stop and resume" mechanism of
solveBlockValue() work as intended, unlocking more analysis.

Using this patch shaves 120 KB off a 64-bit Chromium build on Linux.

I benchmarked compiling bzip2.c at -O2 but couldn't measure any difference in
compile time.

Tests by Jiangning Liu from r215343 / PR21238, Pete Cooper, and me.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222768 91177308-0d34-0410-b5e6-96231b3b80d8
Cleaning out google tests from MC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222770 91177308-0d34-0410-b5e6-96231b3b80d8
[Hexagon] Replacing cmp* instructions with ones that contain encoding bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222771 91177308-0d34-0410-b5e6-96231b3b80d8
Remove useless rdar:// comment from switch_to_lookup_table.ll test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222772 91177308-0d34-0410-b5e6-96231b3b80d8
Remove space before tab in all AVX512 mnemonic strings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222778 91177308-0d34-0410-b5e6-96231b3b80d8
Move a vector instead of copying it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222779 91177308-0d34-0410-b5e6-96231b3b80d8
Remove unused MaxSize variable.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222781 91177308-0d34-0410-b5e6-96231b3b80d8
Use range-based for loops.

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