oota-llvm.git
13 years agoMerge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
Dan Gohman [Wed, 17 Nov 2010 23:21:44 +0000 (23:21 +0000)]
Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.

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

13 years agoNow that the MBlaze backend is in its own directory, split the test cases into multip...
Wesley Peck [Wed, 17 Nov 2010 22:54:43 +0000 (22:54 +0000)]
Now that the MBlaze backend is in its own directory, split the test cases into multiple files for different types of instructions.

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

13 years agoMake SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
Dan Gohman [Wed, 17 Nov 2010 22:27:42 +0000 (22:27 +0000)]
Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual.

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

13 years agoSecond attempt at correct encodings for Thumb2 bitfield instructions.
Owen Anderson [Wed, 17 Nov 2010 22:16:31 +0000 (22:16 +0000)]
Second attempt at correct encodings for Thumb2 bitfield instructions.

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

13 years agoFix comment typo.
Jim Grosbach [Wed, 17 Nov 2010 21:57:51 +0000 (21:57 +0000)]
Fix comment typo.

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

13 years agoThese tests are looking for library function names that
Dale Johannesen [Wed, 17 Nov 2010 21:57:32 +0000 (21:57 +0000)]
These tests are looking for library function names that
appear to differ on Linux.  Try to make them pass on Linux.
Would be good for a Linux person to review this.

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

13 years agoMove SCEV::dominates and properlyDominates to ScalarEvolution.
Dan Gohman [Wed, 17 Nov 2010 21:41:58 +0000 (21:41 +0000)]
Move SCEV::dominates and properlyDominates to ScalarEvolution.

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

13 years agoChange ARMGlobalMerge to keep BSS globals in separate pools.
Bob Wilson [Wed, 17 Nov 2010 21:25:39 +0000 (21:25 +0000)]
Change ARMGlobalMerge to keep BSS globals in separate pools.
This completes the fixes for Radar 8673120.

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

13 years agoFix ARMGlobalMerge pass to check if globals are entirely within range.
Bob Wilson [Wed, 17 Nov 2010 21:25:36 +0000 (21:25 +0000)]
Fix ARMGlobalMerge pass to check if globals are entirely within range.
It is generally not sufficient to check if the starting offset is in range
of the maximum offset that can be efficiently used for the target.

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

13 years agoChange the symbol for merged globals from "merged" to "_MergedGlobals".
Bob Wilson [Wed, 17 Nov 2010 21:25:33 +0000 (21:25 +0000)]
Change the symbol for merged globals from "merged" to "_MergedGlobals".
This makes it more clear that the symbol is an internal, compiler-generated
name and gives a little more description about its contents.

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

13 years agoFix the ARMGlobalMerge pass to look at variable sizes instead of pointer sizes.
Bob Wilson [Wed, 17 Nov 2010 21:25:27 +0000 (21:25 +0000)]
Fix the ARMGlobalMerge pass to look at variable sizes instead of pointer sizes.
It was mistakenly looking at the pointer type when checking for the size of
global variables.  This is a partial fix for Radar 8673120.

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

13 years agoMove SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
Dan Gohman [Wed, 17 Nov 2010 21:23:15 +0000 (21:23 +0000)]
Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
functions of ScalarEvolution, in preparation for memoization and
other optimizations.

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

13 years agoMake the ARM BR_JTadd instruction an explicit pseudo and lower it properly
Jim Grosbach [Wed, 17 Nov 2010 21:05:55 +0000 (21:05 +0000)]
Make the ARM BR_JTadd instruction an explicit pseudo and lower it properly
in the MC lowering process.

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

13 years agoAvoid isel movcc of large immediates when the large immediate is available in a regis...
Evan Cheng [Wed, 17 Nov 2010 20:56:30 +0000 (20:56 +0000)]
Avoid isel movcc of large immediates when the large immediate is available in a register. These immediates aren't free.

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

13 years agoReference ScalarEvolution by name rather than directly in LICM,
Dan Gohman [Wed, 17 Nov 2010 20:50:07 +0000 (20:50 +0000)]
Reference ScalarEvolution by name rather than directly in LICM,
to avoid an unneeded dependence.

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

13 years agoBefore replacing a phi node with a different value, it
Duncan Sands [Wed, 17 Nov 2010 20:49:12 +0000 (20:49 +0000)]
Before replacing a phi node with a different value, it
needs to be checked that this won't break LCSSA form.
Change the existing checking method to a more direct one:
rather than seeing if all predecessors belong to the loop,
check that the replacing value is either not in any loop or
is in a loop that contains the phi node.

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

13 years agoRevert r119551, which broke buildbots.
Owen Anderson [Wed, 17 Nov 2010 20:48:51 +0000 (20:48 +0000)]
Revert r119551, which broke buildbots.

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

13 years agoVerify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
Dan Gohman [Wed, 17 Nov 2010 20:48:38 +0000 (20:48 +0000)]
Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.

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

13 years agoProvide Thumb2 encodings for bitfield instructions.
Owen Anderson [Wed, 17 Nov 2010 20:35:29 +0000 (20:35 +0000)]
Provide Thumb2 encodings for bitfield instructions.

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

13 years agoFix ScalarEvolution's range memoization to avoid using a
Dan Gohman [Wed, 17 Nov 2010 20:23:08 +0000 (20:23 +0000)]
Fix ScalarEvolution's range memoization to avoid using a
default ctor with ConstantRange.

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

13 years agoRemove ARM isel hacks that fold large immediates into a pair of add, sub, and,
Evan Cheng [Wed, 17 Nov 2010 20:13:28 +0000 (20:13 +0000)]
Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

Instead, let peephole optimization pass recognize registers that are defined by
immediates and the ARM target hook will fold the immediates in.

Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ
instructions if there are multiple uses. This happens when the 'and' is live
out, machine sink would have sinked the computation and that ends up pessimizing
code. The peephole pass would recognize situations where the 'and' can be
toggled to define CPSR and eliminate the comparison anyway.

2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking
important optimizations.

rdar://8663787, rdar://8241368

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

13 years agomake isVirtualSection a virtual method on MCSection. Chris' suggestion.
Rafael Espindola [Wed, 17 Nov 2010 20:03:54 +0000 (20:03 +0000)]
make isVirtualSection a virtual method on MCSection. Chris' suggestion.

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

13 years agoMore miscellaneous Thumb2 encodings.
Owen Anderson [Wed, 17 Nov 2010 19:57:38 +0000 (19:57 +0000)]
More miscellaneous Thumb2 encodings.

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

13 years agoadd some justification for "using namespace llvm;"
Chris Lattner [Wed, 17 Nov 2010 19:47:20 +0000 (19:47 +0000)]
add some justification for "using namespace llvm;"

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

13 years agoFix typo.
Jim Grosbach [Wed, 17 Nov 2010 19:30:11 +0000 (19:30 +0000)]
Fix typo.

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

13 years agoAdd missing opcodes now that this function's used in more than one place.
Bill Wendling [Wed, 17 Nov 2010 19:16:20 +0000 (19:16 +0000)]
Add missing opcodes now that this function's used in more than one place.

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

13 years agoInstCombine: Add a missing irem identity (X % X -> 0).
Benjamin Kramer [Wed, 17 Nov 2010 19:11:46 +0000 (19:11 +0000)]
InstCombine: Add a missing irem identity (X % X -> 0).

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

13 years agoMove some those Xor simplifications which don't require creating new
Duncan Sands [Wed, 17 Nov 2010 18:52:15 +0000 (18:52 +0000)]
Move some those Xor simplifications which don't require creating new
instructions out of InstCombine and into InstructionSimplify.  While
there, introduce an m_AllOnes pattern to simplify matching with integers
and vectors with all bits equal to one.

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

13 years agoMore ARM encoding bits. LDRH now encodes properly.
Jim Grosbach [Wed, 17 Nov 2010 18:11:11 +0000 (18:11 +0000)]
More ARM encoding bits. LDRH now encodes properly.

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

13 years agovarious cleanups and other improvements, patch by Zhanyong Wan!
Chris Lattner [Wed, 17 Nov 2010 17:14:55 +0000 (17:14 +0000)]
various cleanups and other improvements, patch by Zhanyong Wan!

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

13 years agoAdd support for .int.
Rafael Espindola [Wed, 17 Nov 2010 16:24:40 +0000 (16:24 +0000)]
Add support for .int.

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

13 years agoAdd support for .2byte, .4byte and .8byte.
Rafael Espindola [Wed, 17 Nov 2010 16:15:42 +0000 (16:15 +0000)]
Add support for .2byte, .4byte and .8byte.
Fixes PR8631.

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

13 years agoMC-JIT: Stub out "pure" streamer.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:47 +0000 (16:06 +0000)]
MC-JIT: Stub out "pure" streamer.
 - No immediate use, but maybe someone feels like hacking on it.

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

13 years agoMCJIT: Stub out MCJIT implementation, still doesn't do anything useful.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:43 +0000 (16:06 +0000)]
MCJIT: Stub out MCJIT implementation, still doesn't do anything useful.

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

13 years agolli: Add stub -use-mcjit option, which doesn't currently do anything.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:37 +0000 (16:06 +0000)]
lli: Add stub -use-mcjit option, which doesn't currently do anything.

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

13 years agoHave InlineFunction use SimplifyInstruction rather than
Duncan Sands [Wed, 17 Nov 2010 11:16:23 +0000 (11:16 +0000)]
Have InlineFunction use SimplifyInstruction rather than
hasConstantValue.  I was leery of using SimplifyInstruction
while the IR was still in a half-baked state, which is the
reason for delaying the simplification until the IR is fully
cooked.

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

13 years agoNow that hasConstantValue has been made simpler, it may return the
Duncan Sands [Wed, 17 Nov 2010 10:23:23 +0000 (10:23 +0000)]
Now that hasConstantValue has been made simpler, it may return the
phi node itself if it occurs in an unreachable basic block.  Protect
against this.  Hopefully this will fix some more buildbots.

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

13 years agoRevert r119109 for now. It's breaking 176.gcc.
Evan Cheng [Wed, 17 Nov 2010 09:31:04 +0000 (09:31 +0000)]
Revert r119109 for now. It's breaking 176.gcc.

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

13 years agoPreviously SimplifyInstruction could report that an instruction
Duncan Sands [Wed, 17 Nov 2010 08:35:29 +0000 (08:35 +0000)]
Previously SimplifyInstruction could report that an instruction
simplified to itself (this can only happen in unreachable blocks).
Change it to return null instead.  Hopefully this will fix some
buildbot failures.

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

13 years agoWith the newly simplified SourceMgr interfaces and the generalized
Chris Lattner [Wed, 17 Nov 2010 08:20:42 +0000 (08:20 +0000)]
With the newly simplified SourceMgr interfaces and the generalized
SrcMgrDiagHandler, we can improve clang diagnostics for inline asm:
instead of reporting them on a source line of the original line,
we can report it on the correct line wherever the string literal came
from. For something like this:

void foo() {
  asm("push %rax\n"
      ".code32\n");
}

we used to get this: (note that the line in t.c isn't helpful)

t.c:4:7: error: warning: ignoring directive for now
  asm("push %rax\n"
      ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

now we get:

t.c:5:8: error: warning: ignoring directive for now
      ".code32\n"
       ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

Note that we're pointing to line 5 properly now.

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

13 years agonow that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
Chris Lattner [Wed, 17 Nov 2010 08:13:01 +0000 (08:13 +0000)]
now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff.  This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling
definition, increasing type safety and cleaning things up.

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

13 years agoAdd simple arithmetics and %type directive for PTX
Che-Liang Chiou [Wed, 17 Nov 2010 08:08:49 +0000 (08:08 +0000)]
Add simple arithmetics and %type directive for PTX

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

13 years agoSimplify code that toggle optional operand to ARM::CPSR.
Evan Cheng [Wed, 17 Nov 2010 08:06:50 +0000 (08:06 +0000)]
Simplify code that toggle optional operand to ARM::CPSR.

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

13 years agorearrange how the handler in SourceMgr is installed, eliminating the use of
Chris Lattner [Wed, 17 Nov 2010 08:03:32 +0000 (08:03 +0000)]
rearrange how the handler in SourceMgr is installed, eliminating the use of
the cookie argument to setDiagHandler

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

13 years agorefactor the interface to EmitInlineAsm a bit, no functionality change.
Chris Lattner [Wed, 17 Nov 2010 07:53:40 +0000 (07:53 +0000)]
refactor the interface to EmitInlineAsm a bit, no functionality change.

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

13 years agofix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::init
Chris Lattner [Wed, 17 Nov 2010 05:41:46 +0000 (05:41 +0000)]
fix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::init

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

13 years agotidy up
Chris Lattner [Wed, 17 Nov 2010 05:41:32 +0000 (05:41 +0000)]
tidy up

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

13 years agoThe machine instruction no longer encodes the submode as a separate operand. We
Bill Wendling [Wed, 17 Nov 2010 05:31:09 +0000 (05:31 +0000)]
The machine instruction no longer encodes the submode as a separate operand. We
should get the submode from the load/store multiple instruction's opcode.

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

13 years agoProper encoding for VLDM and VSTM instructions. The register lists for these
Bill Wendling [Wed, 17 Nov 2010 04:32:08 +0000 (04:32 +0000)]
Proper encoding for VLDM and VSTM instructions. The register lists for these
instructions have to distinguish between lists of single- and double-precision
registers in order for the ASM matcher to do a proper job. In all other
respects, a list of single- or double-precision registers are the same as a list
of GPR registers.

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

13 years agoFix a layering violation: hasConstantValue, which is part of the PHINode
Duncan Sands [Wed, 17 Nov 2010 04:30:22 +0000 (04:30 +0000)]
Fix a layering violation: hasConstantValue, which is part of the PHINode
class, uses DominatorTree which is an analysis.  This change moves all of
the tricky hasConstantValue logic to SimplifyInstruction, and replaces it
with a very simple literal implementation.  I already taught users of
hasConstantValue that need tricky stuff to use SimplifyInstruction instead.
I didn't update InlineFunction because the IR looks like it might be in a
funky state at the point it calls hasConstantValue, which makes calling
SimplifyInstruction dangerous since it can in theory do a lot of tricky
reasoning.  This may be a pessimization, for example in the case where
all phi node operands are either undef or a fixed constant.

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

13 years agoHave ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
Duncan Sands [Wed, 17 Nov 2010 04:18:45 +0000 (04:18 +0000)]
Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
While there, add a note about an inefficiency I noticed.

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

13 years agoHave RemovePredecessorAndSimplify you SimplifyInstruction
Duncan Sands [Wed, 17 Nov 2010 04:12:05 +0000 (04:12 +0000)]
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue.

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

13 years agoRemove dead code in GVN: now that SimplifyInstruction is called
Duncan Sands [Wed, 17 Nov 2010 04:05:21 +0000 (04:05 +0000)]
Remove dead code in GVN: now that SimplifyInstruction is called
systematically, CollapsePhi will always return null here.  Note
that CollapsePhi did an extra check, isSafeReplacement, which
the SimplifyInstruction logic does not do.  I think that check
was bogus - I guess we will soon find out!  (It was originally
added in commit 41998 without a testcase).

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

13 years agoMemoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
Dan Gohman [Wed, 17 Nov 2010 02:44:44 +0000 (02:44 +0000)]
Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
This fixes some extreme compile times on unrolled sha512 code.

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

13 years agoFix warnings about missing parents between || and &&.
Dan Gohman [Wed, 17 Nov 2010 02:40:30 +0000 (02:40 +0000)]
Fix warnings about missing parents between || and &&.

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

13 years agoOnly avoid the check if we're the last operand before the variable
Eric Christopher [Wed, 17 Nov 2010 00:55:36 +0000 (00:55 +0000)]
Only avoid the check if we're the last operand before the variable
operands in a variadic instruction.

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

13 years agoAdd binary emission stuff for VLDM/VSTM. This reuses the
Bill Wendling [Wed, 17 Nov 2010 00:45:23 +0000 (00:45 +0000)]
Add binary emission stuff for VLDM/VSTM. This reuses the
"getRegisterListOpValue" logic. If the registers are double or single precision,
the value returned is suitable for VLDM/VSTM.

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

13 years agoFix typo: Exectuable -> Executable
Peter Collingbourne [Wed, 17 Nov 2010 00:43:43 +0000 (00:43 +0000)]
Fix typo: Exectuable -> Executable

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

13 years agoUse new neon_vector_type and neon_polyvector_type attributes for Neon vectors.
Bob Wilson [Tue, 16 Nov 2010 23:57:06 +0000 (23:57 +0000)]
Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.

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

13 years agoChange Neon polynomial types to be signed to match GCC.
Bob Wilson [Tue, 16 Nov 2010 23:57:03 +0000 (23:57 +0000)]
Change Neon polynomial types to be signed to match GCC.

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

13 years agoRefactor to new GetNumElements function.
Bob Wilson [Tue, 16 Nov 2010 23:57:01 +0000 (23:57 +0000)]
Refactor to new GetNumElements function.
No functional change.

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

13 years agoUse the correct variable names so that the encodings will be correct.
Bill Wendling [Tue, 16 Nov 2010 23:44:49 +0000 (23:44 +0000)]
Use the correct variable names so that the encodings will be correct.

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

13 years agoReapply r118917. With pseudo-instruction expansion moved to
Dan Gohman [Tue, 16 Nov 2010 22:43:23 +0000 (22:43 +0000)]
Reapply r118917. With pseudo-instruction expansion moved to
a different pass, the complicated interaction between cmov expansion
and fast isel is no longer a concern.

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

13 years agoupdate coding standards. Partial specialization is now ok,
Chris Lattner [Tue, 16 Nov 2010 22:19:06 +0000 (22:19 +0000)]
update coding standards.  Partial specialization is now ok,
though possibly not a good idea.

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

13 years agoFix assembling X86CompilationCallback_Win64.asm on VS 10.
Oscar Fuentes [Tue, 16 Nov 2010 22:07:47 +0000 (22:07 +0000)]
Fix assembling X86CompilationCallback_Win64.asm on VS 10.

Patch by Louis Zhuang!

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

13 years agoTest for llvm-gcc patch 119392.
Dale Johannesen [Tue, 16 Nov 2010 21:57:15 +0000 (21:57 +0000)]
Test for llvm-gcc patch 119392.

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

13 years agolibc++ and compiler_rt are now dual licensed under UIUC and MIT license.
Chris Lattner [Tue, 16 Nov 2010 21:32:53 +0000 (21:32 +0000)]
libc++ and compiler_rt are now dual licensed under UIUC and MIT license.

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

13 years agoFix grammaro.
Dan Gohman [Tue, 16 Nov 2010 21:27:00 +0000 (21:27 +0000)]
Fix grammaro.

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

13 years agoAdd ExpandPseudos.cpp.
Evan Cheng [Tue, 16 Nov 2010 21:20:36 +0000 (21:20 +0000)]
Add ExpandPseudos.cpp.

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

13 years agoAdd .loc methods to the streamer.
Rafael Espindola [Tue, 16 Nov 2010 21:20:32 +0000 (21:20 +0000)]
Add .loc methods to the streamer.

Next: Add support for the !HasDotLocAndDotFile case to the MCAsmStreamer
and then switch codegen to use it.

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

13 years agoSplit pseudo-instruction expansion into a separate pass, to make it
Dan Gohman [Tue, 16 Nov 2010 21:02:37 +0000 (21:02 +0000)]
Split pseudo-instruction expansion into a separate pass, to make it
easier to debug, and to avoid complications when the CFG changes
in the middle of the instruction selection process.

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

13 years agoAdd const.
Rafael Espindola [Tue, 16 Nov 2010 20:56:23 +0000 (20:56 +0000)]
Add const.

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

13 years agoFix emergency spilling in LiveIntervals::spillPhysRegAroundRegDefsUses.
Jakob Stoklund Olesen [Tue, 16 Nov 2010 19:55:14 +0000 (19:55 +0000)]
Fix emergency spilling in LiveIntervals::spillPhysRegAroundRegDefsUses.

Always spill the full representative register at any point where any subregister
is live.

This fixes PR8620 which caused the old logic to get confused and not spill
anything at all.

The fundamental problem here is that the coalescer is too aggressive about
physical register coalescing. It sometimes makes it impossible to allocate
registers without these emergency spills.

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

13 years agoPrint out the register class of the current interval.
Jakob Stoklund Olesen [Tue, 16 Nov 2010 19:55:12 +0000 (19:55 +0000)]
Print out the register class of the current interval.

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

13 years agoDocument -enable-no-infs-fp-math and -enable-no-nans-fp-math command line options
Peter Collingbourne [Tue, 16 Nov 2010 19:40:13 +0000 (19:40 +0000)]
Document -enable-no-infs-fp-math and -enable-no-nans-fp-math command line options

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

13 years agoTidy up some things in <arm_neon.h>.
Bob Wilson [Tue, 16 Nov 2010 19:39:14 +0000 (19:39 +0000)]
Tidy up some things in <arm_neon.h>.
Stop defining types with "__neon_" prefixes and then using typedefs without
the prefix; there's no reason to do that anymore.  Remove types that combine
multiple Neon vectors and treat them as a single long vector; they are not
used.

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

13 years agoReapply "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
Bob Wilson [Tue, 16 Nov 2010 19:16:06 +0000 (19:16 +0000)]
Reapply "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
I've temporarily disabled the failing clang test.

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

13 years agosystem_error: More conditional error codes for Darwin.
Michael J. Spencer [Tue, 16 Nov 2010 18:48:21 +0000 (18:48 +0000)]
system_error: More conditional error codes for Darwin.

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

13 years agoRevert "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
Bob Wilson [Tue, 16 Nov 2010 18:43:07 +0000 (18:43 +0000)]
Revert "Stop using struct wrappers for Neon vector types in <arm_neon.h>."
It's breaking buildbots.

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

13 years agoParse and ignore some .cfi_* directives.
Rafael Espindola [Tue, 16 Nov 2010 18:34:07 +0000 (18:34 +0000)]
Parse and ignore some .cfi_* directives.

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

13 years agoThis is the first step in adding sane error handling support to LLVMSystem.
Michael J. Spencer [Tue, 16 Nov 2010 18:31:52 +0000 (18:31 +0000)]
This is the first step in adding sane error handling support to LLVMSystem.

The system API's will be shifted over to returning an error_code, and returning
other return values as out parameters to the function.

Code that needs to check error conditions will use the errc enum values which
are the same as the posix_errno defines (EBADF, E2BIG, etc...), and are
compatable with the error codes in WinError.h due to some magic in system_error.

An example would be:

if (error_code ec = KillEvil("Java")) { // error_code can be converted to bool.
  handle_error(ec);
}

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

13 years agoStop using struct wrappers for Neon vector types in <arm_neon.h>.
Bob Wilson [Tue, 16 Nov 2010 18:17:03 +0000 (18:17 +0000)]
Stop using struct wrappers for Neon vector types in <arm_neon.h>.
Thanks to Nate Begeman for an earlier version of this patch.

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

13 years agoRevert inadvertant checkin of CMake libdeps.
Jim Grosbach [Tue, 16 Nov 2010 18:14:41 +0000 (18:14 +0000)]
Revert inadvertant checkin of CMake libdeps.

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

13 years agoARM conditional mov encoding fix.
Jim Grosbach [Tue, 16 Nov 2010 18:13:42 +0000 (18:13 +0000)]
ARM conditional mov encoding fix.

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

13 years agoHave a few places that want to simplify phi nodes use SimplifyInstruction
Duncan Sands [Tue, 16 Nov 2010 17:41:24 +0000 (17:41 +0000)]
Have a few places that want to simplify phi nodes use SimplifyInstruction
rather than calling hasConstantValue.  No intended functionality change.

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

13 years agoFix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
Dan Gohman [Tue, 16 Nov 2010 17:28:22 +0000 (17:28 +0000)]
Fix missing includes of "llvm/Analysis/Passes.h" in the tutorials. Thanks
for Arnaud Allard de Grandmaison for preparing a patch.

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

13 years agoIn which I discover the existence of loops. Threading an operation
Duncan Sands [Tue, 16 Nov 2010 12:16:38 +0000 (12:16 +0000)]
In which I discover the existence of loops.  Threading an operation
over a phi node by applying it to each operand may be wrong if the
operation and the phi node are mutually interdependent (the testcase
has a simple example of this).  So only do this transform if it would
be correct to perform the operation in each predecessor of the block
containing the phi, i.e. if the other operands all dominate the phi.
This should fix the FFMPEG snow.c regression reported by İsmail Dönmez.

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

13 years agoA bit more of gnu as compatibility when handling relocations with aliases.
Rafael Espindola [Tue, 16 Nov 2010 04:11:46 +0000 (04:11 +0000)]
A bit more of gnu as compatibility when handling relocations with aliases.

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

13 years agoL_bit doesn't work here.
Bill Wendling [Tue, 16 Nov 2010 02:20:22 +0000 (02:20 +0000)]
L_bit doesn't work here.

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

13 years ago- Remove dead patterns.
Bill Wendling [Tue, 16 Nov 2010 02:08:45 +0000 (02:08 +0000)]
- Remove dead patterns.
- Add encodings to the *LDMIA_RET instrs. Probably not needed...

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

13 years agovldm and vstm are mnemonics for vldmia and vstmia resp.
Bill Wendling [Tue, 16 Nov 2010 02:00:24 +0000 (02:00 +0000)]
vldm and vstm are mnemonics for vldmia and vstmia resp.

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

13 years agoMake the verifier a little quieter on instructions that it's probably
Eric Christopher [Tue, 16 Nov 2010 01:58:21 +0000 (01:58 +0000)]
Make the verifier a little quieter on instructions that it's probably
(and likely) wrong about anyhow.

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

13 years agoFix a bug I introduced in the ppc refactoring, which caused long
Chris Lattner [Tue, 16 Nov 2010 01:45:05 +0000 (01:45 +0000)]
Fix a bug I introduced in the ppc refactoring, which caused long
branches to be emitted as:

  bne cr0, 2
instead of:
  bne cr0, $+8

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

13 years agoTest encodings for LDM and STM.
Bill Wendling [Tue, 16 Nov 2010 01:38:20 +0000 (01:38 +0000)]
Test encodings for LDM and STM.

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

13 years agoEncode the multi-load/store instructions with their respective modes ('ia',
Bill Wendling [Tue, 16 Nov 2010 01:16:36 +0000 (01:16 +0000)]
Encode the multi-load/store instructions with their respective modes ('ia',
'db', 'ib', 'da') instead of having that mode as a separate field in the
instruction. It's more convenient for the asm parser and much more readable for
humans.
<rdar://problem/8654088>

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

13 years agoObject: Get rid of sys::Path, Triple, and cleanup namespace.
Michael J. Spencer [Tue, 16 Nov 2010 01:06:51 +0000 (01:06 +0000)]
Object: Get rid of sys::Path, Triple, and cleanup namespace.

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

13 years agoadd copy of comment to the code that will survive the mcjit'ization
Chris Lattner [Tue, 16 Nov 2010 00:57:32 +0000 (00:57 +0000)]
add copy of comment to the code that will survive the mcjit'ization

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

13 years agorelax an assertion a bit, allowing the GPR argument of
Chris Lattner [Tue, 16 Nov 2010 00:55:51 +0000 (00:55 +0000)]
relax an assertion a bit, allowing the GPR argument of
these instructions to be encoded with getMachineOpValue.
This unbreaks ExecutionEngine/2003-01-04-ArgumentBug.ll
when running on a G5

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

13 years agoRemember to resize SpillSlotToUsesMap when allocating an emergency spill slot.
Jakob Stoklund Olesen [Tue, 16 Nov 2010 00:41:01 +0000 (00:41 +0000)]
Remember to resize SpillSlotToUsesMap when allocating an emergency spill slot.

Use amazing new function call technology instead of writing identical code in
multiple places.

This fixes PR8604.

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

13 years agoFix PR8612 in the standard spiller, take two.
Jakob Stoklund Olesen [Tue, 16 Nov 2010 00:40:59 +0000 (00:40 +0000)]
Fix PR8612 in the standard spiller, take two.

The live range of a register defined by an early clobber starts at the use slot,
not the def slot.

Except when it is an early clobber tied to a use operand. Then it starts at the
def slot like a standard def.

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