Revert "Revert "Add Constant Hoisting Pass" (r200034)"

This reverts commit r200058 and adds the using directive for
ARMTargetTransformInfo to silence two g++ overload warnings.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200062 91177308-0d34-0410-b5e6-96231b3b80d8
[Mips] Move 2 test cases from MC to CodeGen.

No code changes. Just reassignment of test case files.


git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200064 91177308-0d34-0410-b5e6-96231b3b80d8
Remove an easy use of EmitRawText from PPC.

This makes lib/Target/PowerPC EmitRawText free.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200065 91177308-0d34-0410-b5e6-96231b3b80d8
[LPM] Make LCSSA a utility with a FunctionPass that applies it to all
the loops in a function, and teach LICM to work in the presance of
LCSSA.

Previously, LCSSA was a loop pass. That made passes requiring it also be
loop passes and unable to depend on function analysis passes easily. It
also caused outer loops to have a different "canonical" form from inner
loops during analysis. Instead, we go into LCSSA form and preserve it
through the loop pass manager run.

Note that this has the same problem as LoopSimplify that prevents
enabling its verification -- loop passes which run at the end of the loop
pass manager and don't preserve these are valid, but the subsequent loop
pass runs of outer loops that do preserve this pass trigger too much
verification and fail because the inner loop no longer verifies.

The other problem this exposed is that LICM was completely unable to
handle LCSSA form. It didn't preserve it and it actually would give up
on moving instructions in many cases when they were used by an LCSSA phi
node. I've taught LICM to support detecting LCSSA-form PHI nodes and to
hoist and sink around them. This may actually let LICM fire
significantly more because we put everything into LCSSA form to rotate
the loop before running LICM. =/ Now LICM should handle that fine and
preserve it correctly. The down side is that LICM has to require LCSSA
in order to preserve it. This is just a fact of life for LCSSA. It's
entirely possible we should completely remove LCSSA from the optimizer.

The test updates are essentially accomodating LCSSA phi nodes in the
output of LICM, and the fact that we now completely sink every
instruction in ashr-crash below the loop bodies prior to unrolling.

With this change, LCSSA is computed only three times in the pass
pipeline. One of them could be removed (and potentially a SCEV run and
a separate LoopPassManager entirely!) if we had a LoopPass variant of
InstCombine that ran InstCombine on the loop body but refused to combine
away LCSSA PHI nodes. Currently, this also prevents loop unrolling from
being in the same loop pass manager is rotate, LICM, and unswitch.

There is one thing that I *really* don't like -- preserving LCSSA in
LICM is quite expensive. We end up having to re-run LCSSA twice for some
loops after LICM runs because LICM can undo LCSSA both in the current
loop and the parent loop. I don't really see good solutions to this
other than to completely move away from LCSSA and using tools like
SSAUpdater instead.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200067 91177308-0d34-0410-b5e6-96231b3b80d8
Fix EnforceSmallerThan to check !hasVectorTypes on the other type instead of this type to force this type to be scalar.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200070 91177308-0d34-0410-b5e6-96231b3b80d8
Use isConcrete and getConcrete instead of using TypeVec directly.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200071 91177308-0d34-0410-b5e6-96231b3b80d8
[LPM] Conclude my immediate work by making the LoopVectorizer
a FunctionPass. With this change the loop vectorizer no longer is a loop
pass and can readily depend on function analyses. In particular, with
this change we no longer have to form a loop pass manager to run the
loop vectorizer which simplifies the entire pass management of LLVM.

The next step here is to teach the loop vectorizer to leverage profile
information through the profile information providing analysis passes.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200074 91177308-0d34-0410-b5e6-96231b3b80d8
This reverts commit r200064 and r200051.

r200064 depends on r200051.

r200051 is broken: I tries to replace .mips_hack_elf_flags, which is a good
thing, but what it replaces it with is even worse.

The new emitMipsELFFlags it adds corresponds to no assembly directive, is not
marked as a hack and is not even printed to the .s file.

The patch also introduces more uses of hasRawTextSupport.

The correct way to remove .mips_hack_elf_flags is to have the mips target
streamer handle the default flags (and command line options). That way the
same code path is used for asm and obj. The streamer interface should *really*
correspond to what is printed in the .s file.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200078 91177308-0d34-0410-b5e6-96231b3b80d8
Added .DS_Store entry in .gitignore for ignoring .DS_Store files in the source
tree generated by OS X.

Patch by Abhay Kadam!

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200079 91177308-0d34-0410-b5e6-96231b3b80d8
Reverting r199886 (Prevent repetitive warnings for unrecognized processors and features)

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200083 91177308-0d34-0410-b5e6-96231b3b80d8
Improve descriptions of combiner-alias-analysis and combiner-global-alias-analysis

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200087 91177308-0d34-0410-b5e6-96231b3b80d8
Add combiner-aa-only-func (debug only)

This option (which is !NDEBUG only) allows restricting the use of alias
analysis in DAGCombiner to a specific function. This has proved extremely
valuable to isolating bugs related to this feature, and mirrors the
misched-only-func option provided by the new instruction scheduler.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200088 91177308-0d34-0410-b5e6-96231b3b80d8
Fix typo in commment tyep->type.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200089 91177308-0d34-0410-b5e6-96231b3b80d8
Fix "llvm-objdump -d -r" to show relocations inline for ELF files

This fixes a regression introduced by r182908, which broke
llvm-objdump's ability to display relocations inline in a disassembly
dump for ELF object files.

That change removed a SectionRelocMap from Object/ELF.h, which we
recreate in llvm-objdump.cpp.

I discovered this regression via an out-of-tree test
(test/NaCl/X86/pnacl-hides-sandbox-x86-64.ll) which used llvm-objdump.

Note that the "Unknown" string in the test output on i386 isn't quite
right, but this appears to be a pre-existing bug.

Differential Revision: http://llvm-reviews.chandlerc.com/D2559

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200090 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use EnforceSmallerThan for EnforceVectorSubVectorTypeIs. EnforceSmallerThan doesn't handle vectors quite right and should really enforce that vectors have the same number of elements. Add explicit checks for vector element count differing in EnforceVectorSubVectorTypeIs instead. This removes some unnecessary type checks in X86GenDAGISel.inc.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200091 91177308-0d34-0410-b5e6-96231b3b80d8
Disable the use of TBAA when using AA in CodeGen

There are currently two issues, of which I currently know, that prevent TBAA
from being correctly usable in CodeGen:

  1. Stack coloring does not update TBAA when merging allocas. This is easy
     enough to fix, but is not the largest problem.

  2. CGP inserts ptrtoint/inttoptr pairs when sinking address computations.
     Because BasicAA does not handle inttoptr, we'll often miss basic type punning
     idioms that we need to catch so we don't miscompile real-world code (like LLVM).

I don't yet have a small test case for this, but this fixes self hosting a
non-asserts build of LLVM on PPC64 when using -enable-aa-sched-mi and -misched=shuffle.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200093 91177308-0d34-0410-b5e6-96231b3b80d8
XFAIL test/CodeGen/SystemZ/alias-01.ll which requires CodeGen TBAA

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200094 91177308-0d34-0410-b5e6-96231b3b80d8
Clean up hack which is no longer needed after r198617. No functionality change.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200095 91177308-0d34-0410-b5e6-96231b3b80d8
Add a TBAA CodeGen failure test case

I disabled the use of TBAA in CodeGen in r200093. This adds a test case that
demonstrates the problems with inttoptr and TBAA in CodeGen (and, specifically,
the problem that causes LLVM to miscompile itself in Release mode). This test
will currently fail if -use-tbaa-in-sched-mi is enabled.

git-svn-id: http://llvm.org/svn/llvm-project/llvm/trunk@200097 91177308-0d34-0410-b5e6-96231b3b80d8
Set displacementSize to 1 for instrucitons with mod==0x1. Fixes PR17310. Modified from patch by James Courtier-Dutton.

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