oota-llvm.git
13 years agoRevert r130178. It turned out to be not the optimal path to emit complex location...
Devang Patel [Wed, 27 Apr 2011 20:29:27 +0000 (20:29 +0000)]
Revert r130178. It turned out to be not the optimal path to emit complex location expressions.

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

13 years agoIf converter was being too cute. It look for root BBs (which don't have
Evan Cheng [Wed, 27 Apr 2011 19:32:43 +0000 (19:32 +0000)]
If converter was being too cute. It look for root BBs (which don't have
successors) and use inverse depth first search to traverse the BBs. However
that doesn't work when the CFG has infinite loops. Simply do a linear
traversal of all BBs work just fine.

rdar://9344645

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

13 years agoWhen analyzing functions known to only access argument pointees,
Dan Gohman [Wed, 27 Apr 2011 18:39:03 +0000 (18:39 +0000)]
When analyzing functions known to only access argument pointees,
only check arguments with pointer types. Update the documentation
of IntrReadArgMem reflect this.

While here, add support for TBAA tags on intrinsic calls.

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

13 years agoCorrects an old, old typo in a case that doesn't seem to be reached in practice.
Andrew Trick [Wed, 27 Apr 2011 18:17:36 +0000 (18:17 +0000)]
Corrects an old, old typo in a case that doesn't seem to be reached in practice.

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

13 years agoSimplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLo...
Devang Patel [Wed, 27 Apr 2011 17:59:27 +0000 (17:59 +0000)]
Simplify cfg inserts a call to trap when unreachable code is detected. Assign DebugLoc to this new trap instruction.

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

13 years agoAlso add <imp-def> operands for defined and dead super-registers when rewriting.
Jakob Stoklund Olesen [Wed, 27 Apr 2011 17:42:31 +0000 (17:42 +0000)]
Also add <imp-def> operands for defined and dead super-registers when rewriting.

We cannot rely on the <imp-def> operands added by LiveIntervals in all cases as
demonstrated by the test case.

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

13 years agoFactor a bit of code to MCStreamer::EmitLabel. Keep track of the last
Rafael Espindola [Wed, 27 Apr 2011 15:21:19 +0000 (15:21 +0000)]
Factor a bit of code to MCStreamer::EmitLabel. Keep track of the last
non private symbol. This will be use for handling

foo:
  .cfi_startproc
  ...

On OS X where we have to create a foo.eh symbol.

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

13 years agoStop trying to have instcombine preserve LCSSA form: this was not
Duncan Sands [Wed, 27 Apr 2011 10:55:12 +0000 (10:55 +0000)]
Stop trying to have instcombine preserve LCSSA form: this was not
effective in avoiding recomputation of LCSSA form; the widespread
use of instsimplify (which looks through phi nodes) means it was
not preserving LCSSA form anyway; and instcombine is no longer
scheduled in the middle of the loop passes so this doesn't matter
anymore.

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

13 years agoTest case and comment for PR9633.
Andrew Trick [Wed, 27 Apr 2011 05:42:17 +0000 (05:42 +0000)]
Test case and comment for PR9633.

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

13 years agoUse static inline to do the right thing when built in C99 mode. Of course,
Nick Lewycky [Wed, 27 Apr 2011 03:22:17 +0000 (03:22 +0000)]
Use static inline to do the right thing when built in C99 mode. Of course,
C89 doesn't have an inline keyword.

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

13 years agoRefactor out code to fast-isel a memcpy operation with a small constant
Eli Friedman [Wed, 27 Apr 2011 01:45:07 +0000 (01:45 +0000)]
Refactor out code to fast-isel a memcpy operation with a small constant
length.  (I'm planning to use this to implement byval.)

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

13 years agoForce some values to be absolute and align based on the FDE pointers size. A small
Rafael Espindola [Wed, 27 Apr 2011 01:43:49 +0000 (01:43 +0000)]
Force some values to be absolute and align based on the FDE pointers size. A small
step towards using .cfi_* on OS X.

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

13 years agoFix an edge case involving branches in fast-isel on x86.
Eli Friedman [Wed, 27 Apr 2011 01:34:27 +0000 (01:34 +0000)]
Fix an edge case involving branches in fast-isel on x86.
rdar://problem/9303306 .

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

13 years agoFix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatib...
Andrew Trick [Wed, 27 Apr 2011 01:21:25 +0000 (01:21 +0000)]
Fix for PR9633 [indvars] Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.

Added a type check in ScalarEvolution::computeSCEVAtScope to handle the case in which operands of an
AddRecExpr in the current scope are folded.

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

13 years agoEnhance memdep to return clobber relation between noalias loads when
Chris Lattner [Tue, 26 Apr 2011 22:42:01 +0000 (22:42 +0000)]
Enhance memdep to return clobber relation between noalias loads when
an earlier load could be widened to encompass a later load.  For example,
if we see:

  X = load i8* P, align 4
  Y = load i8* (P+3), align 1

and we have a 32-bit native integer type, we can widen the former load
to i32 which then makes the second load redundant.  GVN can't actually
do anything with this load/load relation yet, so this isn't testable, but
it is the next step to resolving PR6627, and a fairly general class of
"merge neighboring loads" missed optimizations.

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

13 years agoAdd a safe-guard against repeated splitting for some rare cases.
Jakob Stoklund Olesen [Tue, 26 Apr 2011 22:33:12 +0000 (22:33 +0000)]
Add a safe-guard against repeated splitting for some rare cases.

The number of blocks covered by a live range must be strictly decreasing when
splitting, otherwise we can't allow repeated splitting.

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

13 years agouse AA::isMustAlias to simplify some calls.
Chris Lattner [Tue, 26 Apr 2011 21:53:34 +0000 (21:53 +0000)]
use AA::isMustAlias to simplify some calls.

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

13 years agoremove support for llvm.invariant.end from memdep. It is a
Chris Lattner [Tue, 26 Apr 2011 21:50:51 +0000 (21:50 +0000)]
remove support for llvm.invariant.end from memdep.  It is a
work-in-progress that is not progressing, and it has issues.

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

13 years agoBe careful about scheduling nodes above previous calls. It increase usages of
Evan Cheng [Tue, 26 Apr 2011 21:31:35 +0000 (21:31 +0000)]
Be careful about scheduling nodes above previous calls. It increase usages of
more callee-saved registers and introduce copies. Only allows it if scheduling
a node above calls would end up lessen register pressure.

Call operands also has added ABI restrictions for register allocation, so be
extra careful with hoisting them above calls.

rdar://9329627

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

13 years agoThis test should be in MC. It breaks with changes to scheduling / register allocation...
Evan Cheng [Tue, 26 Apr 2011 21:09:04 +0000 (21:09 +0000)]
This test should be in MC. It breaks with changes to scheduling / register allocation so it's being removed.

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

13 years agomake a couple of changes to the standard pass pipeline:
Chris Lattner [Tue, 26 Apr 2011 20:45:33 +0000 (20:45 +0000)]
make a couple of changes to the standard pass pipeline:
1. Only run the early (in the module pass pipe) instcombine/simplifycfg
   if the "unit at a time" passes they are cleaning up after runs.

2. Move the "clean up after the unroller" pass to the very end of the
   function-level pass pipeline.  Loop unroll uses instsimplify now,
   so it doesn't create a ton of trash.  Moving instcombine later allows
   it to clean up after opportunities are exposed by GVN, DSE, etc.

3. Introduce some phase ordering tests for things that are specifically
   intended to be simplified by the full optimizer as a whole.

This resolves PR2338, and is progress towards PR6627, which will be
generating code that looks similar to test2.

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

13 years agoTransform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
Chris Lattner [Tue, 26 Apr 2011 20:18:20 +0000 (20:18 +0000)]
Transform: "icmp eq (trunc (lshr(X, cst1)), cst" to "icmp (and X, mask), cst"
when X has multiple uses.  This is useful for exposing secondary optimizations,
but the X86 backend isn't ready for this when X has a single use.  For example,
this can disable load folding.

This is inching towards resolving PR6627.

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

13 years agosome random cleanups, no functionality change.
Chris Lattner [Tue, 26 Apr 2011 20:02:45 +0000 (20:02 +0000)]
some random cleanups, no functionality change.

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

13 years agoadd an m_ConstantInt matching predicate that binds to a uint64_t, and add an m_OneUse()
Chris Lattner [Tue, 26 Apr 2011 19:50:39 +0000 (19:50 +0000)]
add an m_ConstantInt matching predicate that binds to a uint64_t, and add an m_OneUse()
predicate that matches if the subexpr has a single use.

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

13 years agoARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.
Jim Grosbach [Tue, 26 Apr 2011 19:44:18 +0000 (19:44 +0000)]
ARM and Thumb2 support for atomic MIN/MAX/UMIN/UMAX loads.

rdar://9326019

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

13 years agoPrint the label if we will use it in debug_frame.
Rafael Espindola [Tue, 26 Apr 2011 19:26:53 +0000 (19:26 +0000)]
Print the label if we will use it in debug_frame.

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

13 years agoRefactor code. Keep dwarf register operation selection logic at one place.
Devang Patel [Tue, 26 Apr 2011 19:06:18 +0000 (19:06 +0000)]
Refactor code. Keep dwarf register operation selection logic at one place.

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

13 years agoUse the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.
Jakob Stoklund Olesen [Tue, 26 Apr 2011 18:52:36 +0000 (18:52 +0000)]
Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.

This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

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

13 years agoAdd a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class...
Jakob Stoklund Olesen [Tue, 26 Apr 2011 18:52:33 +0000 (18:52 +0000)]
Add a TRI::getLargestLegalSuperClass hook to provide an upper limit on register class inflation.

The hook will be used by the register allocator when recomputing register
classes after removing constraints.

Thumb1 code doesn't allow anything larger than tGPR, and x86 needs to ensure
that the spill size doesn't change.

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

13 years agoForce a triple on this test to unbreak windows buildbots.
Benjamin Kramer [Tue, 26 Apr 2011 18:47:43 +0000 (18:47 +0000)]
Force a triple on this test to unbreak windows buildbots.

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

13 years agoFix an off by one error while accessing complex address element of a DIVariable.
Devang Patel [Tue, 26 Apr 2011 18:24:39 +0000 (18:24 +0000)]
Fix an off by one error while accessing complex address element of a DIVariable.
This worked untill now because stars are aligned (i.e. num of complex address elments are always 0 or 2+ and when it is 2+ at least two elements are access together)

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

13 years agoImprove the bail-out predicate to really only kick in when phi
Chris Lattner [Tue, 26 Apr 2011 17:41:02 +0000 (17:41 +0000)]
Improve the bail-out predicate to really only kick in when phi
translation fails.  We were bailing out in some cases that would
cause us to miss GVN'ing some non-local cases away.

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

13 years agoFast-isel support for simple inline asms.
Dan Gohman [Tue, 26 Apr 2011 17:18:34 +0000 (17:18 +0000)]
Fast-isel support for simple inline asms.

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

13 years agoHonor LLVM_BUILD_RUNTIME.
Oscar Fuentes [Tue, 26 Apr 2011 14:55:27 +0000 (14:55 +0000)]
Honor LLVM_BUILD_RUNTIME.

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

13 years agoAdd test for PR9743.
Rafael Espindola [Tue, 26 Apr 2011 14:17:42 +0000 (14:17 +0000)]
Add test for PR9743.

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

13 years agoAnother example of a static table that wasn't marked static.
Duncan Sands [Tue, 26 Apr 2011 07:30:10 +0000 (07:30 +0000)]
Another example of a static table that wasn't marked static.

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

13 years agodon't emit the symbol name twice for local bss and common
Chris Lattner [Tue, 26 Apr 2011 06:14:13 +0000 (06:14 +0000)]
don't emit the symbol name twice for local bss and common
symbols.  For example, don't emit:
        .comm   _i,4,2                  ## @i
                                        ## @i

instead emit:
        .comm   _i,4,2                  ## @i

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

13 years agoAdd cmakefiles to build profile_rt.so!
Nick Lewycky [Tue, 26 Apr 2011 05:48:41 +0000 (05:48 +0000)]
Add cmakefiles to build profile_rt.so!

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

13 years agoFix typo
Evan Cheng [Tue, 26 Apr 2011 04:57:37 +0000 (04:57 +0000)]
Fix typo

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

13 years agoPrint all the moves at a given label instead of just the first one.
Rafael Espindola [Tue, 26 Apr 2011 03:58:56 +0000 (03:58 +0000)]
Print all the moves at a given label instead of just the first one.
Remove previous DwarfCFI hack.

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

13 years agoRename everything to follow LLVM style ... I think.
Nick Lewycky [Tue, 26 Apr 2011 03:54:16 +0000 (03:54 +0000)]
Rename everything to follow LLVM style ... I think.

Add support for switch and indirectbr edges. This works by densely numbering
all blocks which have such terminators, and then separately numbering the
possible successors. The predecessors write down a number, the successor knows
its own number (as a ConstantInt) and sends that and the pointer to the number
the predecessor wrote down to the runtime, who looks up the counter in a
per-function table.

Coverage data should now be functional, but I haven't tested it on anything
other than my 2-file synthetic test program for coverage.

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

13 years agoNo relocation produces a SLEB or ULEB, make sure they are handled in MC.
Rafael Espindola [Tue, 26 Apr 2011 02:17:58 +0000 (02:17 +0000)]
No relocation produces a SLEB or ULEB, make sure they are handled in MC.

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

13 years agoEnhance MemDep: When alias analysis returns a partial alias result,
Chris Lattner [Tue, 26 Apr 2011 01:21:15 +0000 (01:21 +0000)]
Enhance MemDep: When alias analysis returns a partial alias result,
return it as a clobber.  This allows GVN to do smart things.

Enhance GVN to be smart about the case when a small load is clobbered
by a larger overlapping load.  In this case, forward the value.  This
allows us to compile stuff like this:

int test(void *P) {
  int tmp = *(unsigned int*)P;
  return tmp+*((unsigned char*)P+1);
}

into:

_test:                                  ## @test
movl (%rdi), %ecx
movzbl %ch, %eax
addl %ecx, %eax
ret

which has one load.  We already handled the case where the smaller
load was from a must-aliased base pointer.

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

13 years agoLet dwarf writer allocate extra space in the debug location expression. This space...
Devang Patel [Tue, 26 Apr 2011 00:12:46 +0000 (00:12 +0000)]
Let dwarf writer allocate extra space in the debug location expression. This space, if requested, will be used for complex addresses of the Blocks' variables.

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

13 years agoRename a local variable.
Devang Patel [Mon, 25 Apr 2011 23:05:21 +0000 (23:05 +0000)]
Rename a local variable.

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

13 years agoRename a method to match what it really does.
Devang Patel [Mon, 25 Apr 2011 23:02:17 +0000 (23:02 +0000)]
Rename a method to match what it really does.
s/addVariableAddress/addFrameVariableAddress/g

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

13 years agoDo not drop a variable's complex address if it is not based on frame base.
Devang Patel [Mon, 25 Apr 2011 22:52:55 +0000 (22:52 +0000)]
Do not drop a variable's complex address if it is not based on frame base.
Observed this while reading code, so I do not have a test case handy here.

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

13 years agoFix an iterator invalidation bug.
Dan Gohman [Mon, 25 Apr 2011 22:48:29 +0000 (22:48 +0000)]
Fix an iterator invalidation bug.

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

13 years agoMake this test disable fast isel as it's not needed.
Eric Christopher [Mon, 25 Apr 2011 22:39:46 +0000 (22:39 +0000)]
Make this test disable fast isel as it's not needed.

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

13 years agomark a large static table static. Pointed out by Michael Ilseman!
Chris Lattner [Mon, 25 Apr 2011 22:14:33 +0000 (22:14 +0000)]
mark a large static table static.  Pointed out by Michael Ilseman!

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

13 years agoImprove adherence to general style, use "foo_t &x" instead of "foo_t& x"
Chris Lattner [Mon, 25 Apr 2011 21:02:12 +0000 (21:02 +0000)]
Improve adherence to general style, use "foo_t &x" instead of "foo_t& x"

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

13 years agoallow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
Chris Lattner [Mon, 25 Apr 2011 20:58:50 +0000 (20:58 +0000)]
allow adding a FoldingSetNodeID to a FastFoldingSetNode, resolving PR9499,
patch by Johannes Schaub!

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

13 years agoadd a missed bitfield instcombine.
Chris Lattner [Mon, 25 Apr 2011 18:44:26 +0000 (18:44 +0000)]
add a missed bitfield instcombine.

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

13 years agoLower BlockAddress node when relocation-model is static.
Akira Hatanaka [Mon, 25 Apr 2011 17:10:45 +0000 (17:10 +0000)]
Lower BlockAddress node when relocation-model is static.

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

13 years agoA dbg.declare may not be in entry block, even if it is referring to an incoming argum...
Devang Patel [Mon, 25 Apr 2011 16:33:52 +0000 (16:33 +0000)]
A dbg.declare may not be in entry block, even if it is referring to an incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction.

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

13 years agoMake tests more useful.
Benjamin Kramer [Mon, 25 Apr 2011 10:12:01 +0000 (10:12 +0000)]
Make tests more useful.

lit needs a linter ...

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

13 years agoRemove some hard coded CR-LFs. Some of these were the entire files, one of
Chandler Carruth [Mon, 25 Apr 2011 07:11:23 +0000 (07:11 +0000)]
Remove some hard coded CR-LFs. Some of these were the entire files, one of
these was just one line of a file. Explicitly set the eol-style property on the
files to try and ensure this fix stays.

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

13 years agoFix comment typo. Noticed by Liu.
Duncan Sands [Mon, 25 Apr 2011 06:21:43 +0000 (06:21 +0000)]
Fix comment typo.  Noticed by Liu.

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

13 years agoSimplify the logic. Noticed by aKor.
Rafael Espindola [Sun, 24 Apr 2011 19:55:34 +0000 (19:55 +0000)]
Simplify the logic. Noticed by aKor.

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

13 years agoSynchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Rafael Espindola [Sun, 24 Apr 2011 19:00:34 +0000 (19:00 +0000)]
Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.
Fixes PR9787.

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

13 years agoFix Target/ARM/Thumb1FrameLowering.h header guard.
Sebastian Redl [Sun, 24 Apr 2011 15:47:01 +0000 (15:47 +0000)]
Fix Target/ARM/Thumb1FrameLowering.h header guard.

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

13 years agoGive MC/MCDisassembler/Disassembler.h a header guard.
Sebastian Redl [Sun, 24 Apr 2011 15:46:56 +0000 (15:46 +0000)]
Give MC/MCDisassembler/Disassembler.h a header guard.

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

13 years agoGive SplitKit.h a header guard.
Sebastian Redl [Sun, 24 Apr 2011 15:46:51 +0000 (15:46 +0000)]
Give SplitKit.h a header guard.

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

13 years agoGive ImmutableIntervalMap.h an include guard.
Sebastian Redl [Sun, 24 Apr 2011 15:46:46 +0000 (15:46 +0000)]
Give ImmutableIntervalMap.h an include guard.

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

13 years agoFix an assert to check exactly what it says.
Jay Foad [Sun, 24 Apr 2011 14:30:00 +0000 (14:30 +0000)]
Fix an assert to check exactly what it says.

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

13 years agoAdd a TODO.
Mikhail Glushenkov [Sun, 24 Apr 2011 14:17:41 +0000 (14:17 +0000)]
Add a TODO.

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

13 years agoRegenerate.
Mikhail Glushenkov [Sun, 24 Apr 2011 14:17:37 +0000 (14:17 +0000)]
Regenerate.

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

13 years agoRemove all references to plugins from the LLVMC docs.
Mikhail Glushenkov [Sun, 24 Apr 2011 14:17:32 +0000 (14:17 +0000)]
Remove all references to plugins from the LLVMC docs.

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

13 years agoPR9214: Convert the DIBuilder API to use ArrayRef.
Jay Foad [Sun, 24 Apr 2011 10:11:03 +0000 (10:11 +0000)]
PR9214: Convert the DIBuilder API to use ArrayRef.

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

13 years agoRemove unused STL header includes.
Jay Foad [Sat, 23 Apr 2011 19:53:52 +0000 (19:53 +0000)]
Remove unused STL header includes.

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

13 years agoLike the coding standards say, do not use "using namespace std".
Jay Foad [Sat, 23 Apr 2011 09:06:00 +0000 (09:06 +0000)]
Like the coding standards say, do not use "using namespace std".

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

13 years agoSilence an overzealous uninitialized variable warning from GCC.
Benjamin Kramer [Sat, 23 Apr 2011 08:21:06 +0000 (08:21 +0000)]
Silence an overzealous uninitialized variable warning from GCC.

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

13 years agoAccidental function name mangling.
Andrew Trick [Sat, 23 Apr 2011 04:08:15 +0000 (04:08 +0000)]
Accidental function name mangling.

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

13 years agoThumb2 and ARM add/subtract with carry fixes.
Andrew Trick [Sat, 23 Apr 2011 03:55:32 +0000 (03:55 +0000)]
Thumb2 and ARM add/subtract with carry fixes.

Fixes Thumb2 ADCS and SBCS lowering: <rdar://problem/9275821>.
t2ADCS/t2SBCS are now pseudo instructions, consistent with ARM, so the
assembly printer correctly prints the 's' suffix.

Fixes Thumb2 adde -> SBC matching to check for live/dead carry flags.

Fixes the internal ARM machine opcode mnemonic for ADCS/SBCS.
Fixes ARM SBC lowering to check for live carry (potential bug).

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

13 years agoComment edit.
Andrew Trick [Sat, 23 Apr 2011 03:27:19 +0000 (03:27 +0000)]
Comment edit.

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

13 years agowhitespace
Andrew Trick [Sat, 23 Apr 2011 03:24:11 +0000 (03:24 +0000)]
whitespace

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

13 years agodocs: Introduce cascading style <div> and <p> continued on <h[2-5]>.
NAKAMURA Takumi [Sat, 23 Apr 2011 00:30:22 +0000 (00:30 +0000)]
docs: Introduce cascading style <div> and <p> continued on <h[2-5]>.

<h2>Section Example</h2>
<div> <!-- h2+div is applied -->
<p>Section preamble.</p>

<h3>Subsection Example</h3>
<p> <!-- h3+p is applied -->
Subsection body
</p>

<!-- End of section body -->
</div>

FIXME: Care H5 better.

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

13 years agotest/CodeGen/X86/shrink-compare.ll: Relax expressions for Win64.
NAKAMURA Takumi [Sat, 23 Apr 2011 00:15:45 +0000 (00:15 +0000)]
test/CodeGen/X86/shrink-compare.ll: Relax expressions for Win64.

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

13 years agoTeach FastISel to deal with instructions that have two immediate operands.
Owen Anderson [Fri, 22 Apr 2011 23:38:06 +0000 (23:38 +0000)]
Teach FastISel to deal with instructions that have two immediate operands.

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

13 years agoLet front-end tie subprogram declaration with subprogram definition directly.
Devang Patel [Fri, 22 Apr 2011 23:10:17 +0000 (23:10 +0000)]
Let front-end tie subprogram declaration with subprogram definition directly.

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

13 years agoFix comment.
Eric Christopher [Fri, 22 Apr 2011 23:08:45 +0000 (23:08 +0000)]
Fix comment.

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

13 years agoAlways compare the cost of region splitting with the cost of per-block splitting.
Jakob Stoklund Olesen [Fri, 22 Apr 2011 22:47:40 +0000 (22:47 +0000)]
Always compare the cost of region splitting with the cost of per-block splitting.

Sometimes it is better to split per block, and we missed those cases.

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

13 years agoThe .inc file is auto-generated and must not be edited by hand.
Mikhail Glushenkov [Fri, 22 Apr 2011 22:05:29 +0000 (22:05 +0000)]
The .inc file is auto-generated and must not be edited by hand.

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

13 years agoRecommit the fix for rdar://9289512 with a couple tweaks to
Chris Lattner [Fri, 22 Apr 2011 21:59:37 +0000 (21:59 +0000)]
Recommit the fix for rdar://9289512 with a couple tweaks to
fix bugs exposed by the gcc dejagnu testsuite:
1. The load may actually be used by a dead instruction, which
   would cause an assert.
2. The load may not be used by the current chain of instructions,
   and we could move it past a side-effecting instruction. Change
   how we process uses to define the problem away.

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

13 years agoDisassembly of A8.6.59 LDR (literal) Encoding T1 (16-bit thumb instruction) should
Johnny Chen [Fri, 22 Apr 2011 19:12:43 +0000 (19:12 +0000)]
Disassembly of A8.6.59 LDR (literal) Encoding T1 (16-bit thumb instruction) should
print out ldr, not ldr.n.

rdar://problem/9267772

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

13 years agoDAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.
Benjamin Kramer [Fri, 22 Apr 2011 18:47:44 +0000 (18:47 +0000)]
DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.

On x86 this allows to fold a load into the cmp, greatly reducing register pressure.
  movzbl (%rdi), %eax
  cmpl $47, %eax
->
  cmpb $47, (%rdi)

This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :)

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

13 years agoDo not leak argument's DbgVariables.
Devang Patel [Fri, 22 Apr 2011 18:09:57 +0000 (18:09 +0000)]
Do not leak argument's DbgVariables.

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

13 years agoAdd asserts.
Devang Patel [Fri, 22 Apr 2011 16:44:29 +0000 (16:44 +0000)]
Add asserts.

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

13 years agoX86: Try to use a smaller encoding by transforming (X << C1) & C2 into (X & (C2 ...
Benjamin Kramer [Fri, 22 Apr 2011 15:30:40 +0000 (15:30 +0000)]
X86: Try to use a smaller encoding by transforming (X << C1) & C2 into (X & (C2 >> C1)) & C1. (Part of PR5039)

This tends to happen a lot with bitfield code generated by clang. A simple example for x86_64 is
uint64_t foo(uint64_t x) { return (x&1) << 42; }
which used to compile into bloated code:
shlq $42, %rdi               ## encoding: [0x48,0xc1,0xe7,0x2a]
movabsq $4398046511104, %rax    ## encoding: [0x48,0xb8,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00]
andq %rdi, %rax              ## encoding: [0x48,0x21,0xf8]
ret                             ## encoding: [0xc3]

with this patch we can fold the immediate into the and:
andq $1, %rdi                ## encoding: [0x48,0x83,0xe7,0x01]
movq %rdi, %rax              ## encoding: [0x48,0x89,0xf8]
shlq $42, %rax               ## encoding: [0x48,0xc1,0xe0,0x2a]
ret                             ## encoding: [0xc3]

It's possible to save another byte by using 'andl' instead of 'andq' but I currently see no way of doing
that without making this code even more complicated. See the TODOs in the code.

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

13 years agoComment out some unused parameter names to silence out-of-tree -Wunused warnings.
Frits van Bommel [Fri, 22 Apr 2011 11:36:45 +0000 (11:36 +0000)]
Comment out some unused parameter names to silence out-of-tree -Wunused warnings.

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

13 years agoUse enums for constant values.
Eric Christopher [Fri, 22 Apr 2011 06:34:01 +0000 (06:34 +0000)]
Use enums for constant values.

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

13 years agoMake the file format strings a little prettier for mach-o.
Eric Christopher [Fri, 22 Apr 2011 04:08:58 +0000 (04:08 +0000)]
Make the file format strings a little prettier for mach-o.

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

13 years agoAdd MachOObjectFile.cpp to cmake.
Eric Christopher [Fri, 22 Apr 2011 04:06:24 +0000 (04:06 +0000)]
Add MachOObjectFile.cpp to cmake.

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

13 years agoHook in mach-o object files into Object interface.
Eric Christopher [Fri, 22 Apr 2011 03:50:50 +0000 (03:50 +0000)]
Hook in mach-o object files into Object interface.

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

13 years agoAdd support for 64-bit object files to Path.
Eric Christopher [Fri, 22 Apr 2011 03:50:19 +0000 (03:50 +0000)]
Add support for 64-bit object files to Path.

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

13 years agoAdd an ObjectFile implementation for mach-o.
Eric Christopher [Fri, 22 Apr 2011 03:19:48 +0000 (03:19 +0000)]
Add an ObjectFile implementation for mach-o.

Patch by Patrick Walton!

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

13 years ago80-col fix.
Eric Christopher [Fri, 22 Apr 2011 03:07:06 +0000 (03:07 +0000)]
80-col fix.

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

13 years agoinclude/llvm/Target/TargetAsmInfo.h: Fix a warning.
NAKAMURA Takumi [Fri, 22 Apr 2011 01:56:59 +0000 (01:56 +0000)]
include/llvm/Target/TargetAsmInfo.h: Fix a warning.

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

13 years agoIn Thumb2 mode, lower frame indix references to:
Evan Cheng [Fri, 22 Apr 2011 01:42:52 +0000 (01:42 +0000)]
In Thumb2 mode, lower frame indix references to:
add <rd>, sp, #<imm8>
ldr <rd>, [sp, #<imm8>]
When the offset from sp is multiple of 4 and in range of 0-1020.
This saves code size by utilizing 16-bit instructions.

rdar://9321541

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

13 years agoTypo
Evan Cheng [Fri, 22 Apr 2011 01:40:20 +0000 (01:40 +0000)]
Typo

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