Commit Graph

67278 Commits

Author SHA1 Message Date
Owen Anderson
424216453f Revert r119593 while I figure out my testing disagrees with the buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 00:42:51 +00:00
Dan Gohman
9c9fcfc719 Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 00:34:22 +00:00
Owen Anderson
18333616cd Provide correct Thumb2 encodings for basic multiplication operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 00:19:10 +00:00
Oscar Fuentes
78786f9eb6 Updated library dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18 00:12:27 +00:00
John Thompson
7730318000 Bug 8621 fix - pointer cast stripped from inline asm constraint argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:58:47 +00:00
Wesley Peck
b977f04c5b Make MCJIT work with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:35:07 +00:00
Jim Grosbach
85eb54cf0c Clean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
it as such. Add some encoding information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119588 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:33:14 +00:00
Dan Gohman
56a7568218 Factor out the code for purging a SCEV from all the various memoization maps.
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 23:28:48 +00:00
Dan Gohman
714b5290b0 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
2010-11-17 23:21:44 +00:00
Wesley Peck
e7c682b543 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
2010-11-17 22:54:43 +00:00
Dan Gohman
4ce32db913 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
2010-11-17 22:27:42 +00:00
Owen Anderson
2f7aed39a3 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
2010-11-17 22:16:31 +00:00
Jim Grosbach
0129be281e Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 21:57:51 +00:00
Dale Johannesen
8abe08d7f9 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
2010-11-17 21:57:32 +00:00
Dan Gohman
dc0e8fb9f9 Move SCEV::dominates and properlyDominates to ScalarEvolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 21:41:58 +00:00
Bob Wilson
05646099a0 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
2010-11-17 21:25:39 +00:00
Bob Wilson
619a372617 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
2010-11-17 21:25:36 +00:00
Bob Wilson
72831dc905 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
2010-11-17 21:25:33 +00:00
Bob Wilson
edf046716c 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
2010-11-17 21:25:27 +00:00
Dan Gohman
17ead4ff4b 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
2010-11-17 21:23:15 +00:00
Jim Grosbach
f8dabac604 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
2010-11-17 21:05:55 +00:00
Evan Cheng
6b19491468 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
2010-11-17 20:56:30 +00:00
Dan Gohman
a9b61e7f7b 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
2010-11-17 20:50:07 +00:00
Duncan Sands
6f8a5ddcd8 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
2010-11-17 20:49:12 +00:00
Owen Anderson
5aba9f694f Revert r119551, which broke buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119555 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 20:48:51 +00:00
Dan Gohman
203a7239ae 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
2010-11-17 20:48:38 +00:00
Owen Anderson
23465a06f4 Provide Thumb2 encodings for bitfield instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 20:35:29 +00:00
Dan Gohman
7c0fd8eb72 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
2010-11-17 20:23:08 +00:00
Evan Cheng
c4af4638df 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
2010-11-17 20:13:28 +00:00
Rafael Espindola
f2dc4aa562 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
2010-11-17 20:03:54 +00:00
Owen Anderson
46c478e802 More miscellaneous Thumb2 encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:57:38 +00:00
Chris Lattner
eddd96901e add some justification for "using namespace llvm;"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:47:20 +00:00
Jim Grosbach
4d08863108 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119542 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 19:30:11 +00:00
Bill Wendling
df8d94da01 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
2010-11-17 19:16:20 +00:00
Benjamin Kramer
1951a5b721 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
2010-11-17 19:11:46 +00:00
Duncan Sands
2b749870d0 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
2010-11-17 18:52:15 +00:00
Jim Grosbach
89e14c7579 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
2010-11-17 18:11:11 +00:00
Chris Lattner
684cf814c7 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
2010-11-17 17:14:55 +00:00
Rafael Espindola
435279b1a6 Add support for .int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119512 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-17 16:24:40 +00:00
Rafael Espindola
110f22aae8 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
2010-11-17 16:15:42 +00:00
Daniel Dunbar
abc756216d 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
2010-11-17 16:06:47 +00:00
Daniel Dunbar
6aec298486 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
2010-11-17 16:06:43 +00:00
Daniel Dunbar
6d135972bf 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
2010-11-17 16:06:37 +00:00
Duncan Sands
6fb881c036 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
2010-11-17 11:16:23 +00:00
Duncan Sands
23a19572b2 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
2010-11-17 10:23:23 +00:00
Evan Cheng
baa45f7298 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
2010-11-17 09:31:04 +00:00
Duncan Sands
d261dc650a 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
2010-11-17 08:35:29 +00:00
Chris Lattner
ce1b9ad539 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
2010-11-17 08:20:42 +00:00
Chris Lattner
4afa12890f 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
2010-11-17 08:13:01 +00:00
Che-Liang Chiou
3f409f7fef 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
2010-11-17 08:08:49 +00:00