oota-llvm.git
15 years agoIf header of inner loop is aligned, do not align the outer loop header. We don't...
Evan Cheng [Tue, 12 May 2009 23:58:14 +0000 (23:58 +0000)]
If header of inner loop is aligned, do not align the outer loop header. We don't want to add nops in the outer loop for the sake of aligning the inner loop.

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

15 years agoTeach TransferDeadness to delete truly dead instructions if they do not produce side...
Evan Cheng [Tue, 12 May 2009 23:07:00 +0000 (23:07 +0000)]
Teach TransferDeadness to delete truly dead instructions if they do not produce side effects.

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

15 years agoSlightly improve generated code in a degenerate case.
Dale Johannesen [Tue, 12 May 2009 22:32:29 +0000 (22:32 +0000)]
Slightly improve generated code in a degenerate case.
Should remove a warning from MSVC.

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

15 years agocorrect register class for tADDspi to GPR since the register will always be SP
Jim Grosbach [Tue, 12 May 2009 22:30:18 +0000 (22:30 +0000)]
correct register class for tADDspi to GPR since the register will always be SP

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

15 years agoMore MSVC fixes -- class/struct conflicts.
Bill Wendling [Tue, 12 May 2009 21:55:29 +0000 (21:55 +0000)]
More MSVC fixes -- class/struct conflicts.

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

15 years agoUse struct instead of class to make MCVS compile.
Bill Wendling [Tue, 12 May 2009 21:50:43 +0000 (21:50 +0000)]
Use struct instead of class to make MCVS compile.

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

15 years agoRestructure PEI code:
John Mosby [Tue, 12 May 2009 20:33:29 +0000 (20:33 +0000)]
Restructure PEI code:

- moved shrink wrapping code from PrologEpilogInserter.cpp to
  new file ShrinkWrapping.cpp.

- moved PEI pass definition into new shared header PEI.h.

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

15 years agoSwitch to using IRBuilder throughout.
Jay Foad [Tue, 12 May 2009 20:27:44 +0000 (20:27 +0000)]
Switch to using IRBuilder throughout.

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

15 years ago80 col violations.
Evan Cheng [Tue, 12 May 2009 20:17:52 +0000 (20:17 +0000)]
80 col violations.

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

15 years agoAdd nounwind.
Evan Cheng [Tue, 12 May 2009 18:35:43 +0000 (18:35 +0000)]
Add nounwind.

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

15 years agoFixed a stack slot coloring with reg bug: do not update implicit use / def when doing...
Evan Cheng [Tue, 12 May 2009 18:31:57 +0000 (18:31 +0000)]
Fixed a stack slot coloring with reg bug: do not update implicit use / def when doing forward / backward propagation.

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

15 years agoUse llvm::raw_stream instead of llvm::Streams.
Bill Wendling [Tue, 12 May 2009 18:29:42 +0000 (18:29 +0000)]
Use llvm::raw_stream instead of llvm::Streams.

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

15 years agoFix up a few minor typos in comments.
Bob Wilson [Tue, 12 May 2009 17:35:29 +0000 (17:35 +0000)]
Fix up a few minor typos in comments.

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

15 years agoFix 80-col violations and remove trailing whitespace. No functional changes.
Bob Wilson [Tue, 12 May 2009 17:09:30 +0000 (17:09 +0000)]
Fix 80-col violations and remove trailing whitespace.  No functional changes.

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

15 years agoClarify a comment.
Dan Gohman [Tue, 12 May 2009 17:08:34 +0000 (17:08 +0000)]
Clarify a comment.

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

15 years agoIterate over globals once and sectionize them into appropriate sections.
Sanjiv Gupta [Tue, 12 May 2009 17:07:27 +0000 (17:07 +0000)]
Iterate over globals once and sectionize them into appropriate sections.
Later in asmprinter, go over thsese sections and print them.
Do not print empty sections.

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

15 years agoAllow client Makefiles control over whether they want -pedantic by
Daniel Dunbar [Tue, 12 May 2009 07:26:49 +0000 (07:26 +0000)]
Allow client Makefiles control over whether they want -pedantic by
defining NO_PEDANTIC.
  - Pedantic C89 is a painful language...

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

15 years agoWe do not need to create a label for external defs and decls,
Sanjiv Gupta [Tue, 12 May 2009 06:52:41 +0000 (06:52 +0000)]
We do not need to create a label for external defs and decls,
just emit a comment for readability.

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

15 years agoSet svn:ignore on a slew of +Coverage directories
Daniel Dunbar [Tue, 12 May 2009 06:47:12 +0000 (06:47 +0000)]
Set svn:ignore on a slew of +Coverage directories

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

15 years agoRefactor dependency generation for .ll files.
Daniel Dunbar [Tue, 12 May 2009 06:35:50 +0000 (06:35 +0000)]
Refactor dependency generation for .ll files.
 - This matches the normal dependency generation code.

 - This also fixes the problem that when building a normal and bitcode
   archive from the same source, the dependency files would overwrite
   one another. Which was bad.

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

15 years agoRemove obsolete Makefile magic for calling llvm-upgrade
Daniel Dunbar [Tue, 12 May 2009 05:49:22 +0000 (05:49 +0000)]
Remove obsolete Makefile magic for calling llvm-upgrade

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

15 years agoInstall bytecode libraries with a .bca suffix, otherwise it isn't
Daniel Dunbar [Tue, 12 May 2009 05:35:40 +0000 (05:35 +0000)]
Install bytecode libraries with a .bca suffix, otherwise it isn't
possible to build both a .a and a .bca.
 - My understanding is no one else is using this stuff, please let me
   know if I am wrong.

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

15 years agoMark mayLoad, mayStore for insns correctly and use them
Sanjiv Gupta [Tue, 12 May 2009 04:30:38 +0000 (04:30 +0000)]
Mark mayLoad, mayStore for insns correctly and use them
to check if an insn is accessing memory during mem sel optimization.

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

15 years agoFix pr4195: When iterating through predecessor blocks, break out of the loop
Bob Wilson [Tue, 12 May 2009 03:48:10 +0000 (03:48 +0000)]
Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor.  Sometimes a block may be listed
more than once, and processing it more than once in this loop can lead to
inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not
clear these values.  There's no point in continuing the loop regardless.
The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource
test.

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

15 years agoFactor the code for collecting IV users out of LSR into an IVUsers class,
Dan Gohman [Tue, 12 May 2009 02:17:14 +0000 (02:17 +0000)]
Factor the code for collecting IV users out of LSR into an IVUsers class,
and generalize it so that it can be used by IndVarSimplify. Implement the
base IndVarSimplify transformation code using IVUsers. This removes
TestOrigIVForWrap and associated code, as ScalarEvolution now has enough
builtin overflow detection and folding logic to handle all the same cases,
and more. Run "opt -iv-users -analyze -disable-output" on your favorite
loop for an example of what IVUsers does.

This lets IndVarSimplify eliminate IV casts and compute trip counts in
more cases. Also, this happens to finally fix the remaining testcases
in PR1301.

Now that IndVarSimplify is being more aggressive, it occasionally runs
into the problem where ScalarEvolutionExpander's code for avoiding
duplicate expansions makes it difficult to ensure that all expanded
instructions dominate all the instructions that will use them. As a
temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function
to fix up instructions inserted by SCEVExpander. Fortunately, this code
is contained, and can be easily removed once a more comprehensive
solution is available.

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

15 years agoWhen forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.
Dan Gohman [Tue, 12 May 2009 01:27:58 +0000 (01:27 +0000)]
When forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.
These values aren't analyzable, so they don't care if more information
about the loop trip count can be had. Also, SCEVUnknown is used for
a PHI while the PHI itself is being analyzed, so it needs to be left
in the Scalars map. This fixes a variety of subtle issues.

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

15 years agoFix GetMinTrailingZeros for SCEVSignExtend and SCEVZeroExtendExpr to
Dan Gohman [Tue, 12 May 2009 01:23:18 +0000 (01:23 +0000)]
Fix GetMinTrailingZeros for SCEVSignExtend and SCEVZeroExtendExpr to
return the correct value when the cast operand is all zeros. This ought
to be pretty rare, because it would mean that the regular SCEV folding
routines missed a case, though there are cases they might legitimately
miss. Also, it's unlikely anything currently using GetMinTrailingZeros
cares about this case.

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

15 years agoAvoid unneeded SIB byte encoding. Patch by Zoltan Varga.
Evan Cheng [Tue, 12 May 2009 00:07:35 +0000 (00:07 +0000)]
Avoid unneeded SIB byte encoding. Patch by Zoltan Varga.

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

15 years ago- Record that the debug info is actually used so that the label folder doesn't
Bill Wendling [Tue, 12 May 2009 00:06:59 +0000 (00:06 +0000)]
- Record that the debug info is actually used so that the label folder doesn't
  blast it away.
- Move InlineInfo bookkeeping to bookkeep the correct debug info object.

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

15 years agoFixed PR4090.
Lang Hames [Mon, 11 May 2009 23:14:13 +0000 (23:14 +0000)]
Fixed PR4090.

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

15 years agoTeach LSR to optimize more loop exit compares, i.e. change them to use postinc iv...
Evan Cheng [Mon, 11 May 2009 22:33:01 +0000 (22:33 +0000)]
Teach LSR to optimize more loop exit compares, i.e. change them to use postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values.

Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch.

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

15 years agoAdd DW_AT_APPLE_isa and DW_AT_APPLE_block. Radar 6867696
Mike Stump [Mon, 11 May 2009 21:58:01 +0000 (21:58 +0000)]
Add DW_AT_APPLE_isa and DW_AT_APPLE_block.  Radar 6867696

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

15 years agoFix PR4188. TailMerging can't tolerate inexact
Dale Johannesen [Mon, 11 May 2009 21:54:13 +0000 (21:54 +0000)]
Fix PR4188.  TailMerging can't tolerate inexact
sucessor info.

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

15 years agoApply patch review feedback.
Evan Cheng [Mon, 11 May 2009 20:53:52 +0000 (20:53 +0000)]
Apply patch review feedback.

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

15 years agoDon't #include DerivedTypes.h from TargetData.h.
Jay Foad [Mon, 11 May 2009 19:38:09 +0000 (19:38 +0000)]
Don't #include DerivedTypes.h from TargetData.h.

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

15 years agoAdd a comment about the special meaning of VoidTy in this context.
Dan Gohman [Mon, 11 May 2009 19:11:53 +0000 (19:11 +0000)]
Add a comment about the special meaning of VoidTy in this context.

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

15 years agoFix two wording errors that Duncan spotted.
Dan Gohman [Mon, 11 May 2009 18:51:16 +0000 (18:51 +0000)]
Fix two wording errors that Duncan spotted.

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

15 years agoMake this grep line a little more specific so that it doesn't
Dan Gohman [Mon, 11 May 2009 18:49:56 +0000 (18:49 +0000)]
Make this grep line a little more specific so that it doesn't
accidentally match something unrelated.

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

15 years agoUnbreak non-debug build.
Evan Cheng [Mon, 11 May 2009 18:40:52 +0000 (18:40 +0000)]
Unbreak non-debug build.

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

15 years agoEliminate a compiler warning.
Evan Cheng [Mon, 11 May 2009 18:40:35 +0000 (18:40 +0000)]
Eliminate a compiler warning.

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

15 years agoWhen scalarizing a vector BITCAST, check whether the operand has vector
Dan Gohman [Mon, 11 May 2009 18:30:42 +0000 (18:30 +0000)]
When scalarizing a vector BITCAST, check whether the operand has vector
type, rather than assume that it does. If the operand is not vector, it
shouldn't be run through ScalarizeVectorOp. This fixes one of the
testcases in PR3886.

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

15 years agoLLVM has unaligned loads and stores now.
Dan Gohman [Mon, 11 May 2009 18:06:05 +0000 (18:06 +0000)]
LLVM has unaligned loads and stores now.

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

15 years agoAdd terminal width detection to llvm::sys::Process. This is needed to
Douglas Gregor [Mon, 11 May 2009 18:05:52 +0000 (18:05 +0000)]
Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.

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

15 years agoUpgrade this example to new-style syntax.
Dan Gohman [Mon, 11 May 2009 18:04:52 +0000 (18:04 +0000)]
Upgrade this example to new-style syntax.

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

15 years agoConvert a subtract into a negate and an add when it helps x86
Dan Gohman [Mon, 11 May 2009 18:02:53 +0000 (18:02 +0000)]
Convert a subtract into a negate and an add when it helps x86
address folding.

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

15 years agoAdd an svn:ignore.
Dan Gohman [Mon, 11 May 2009 17:57:43 +0000 (17:57 +0000)]
Add an svn:ignore.

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

15 years agoremove some done things: we have nocapture and SROA is smarter.
Chris Lattner [Mon, 11 May 2009 17:41:40 +0000 (17:41 +0000)]
remove some done things: we have nocapture and SROA is smarter.

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

15 years agoadd a note
Chris Lattner [Mon, 11 May 2009 17:36:33 +0000 (17:36 +0000)]
add a note

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

15 years agoReverse a loop that is counting up to a maximum to
Dale Johannesen [Mon, 11 May 2009 17:15:42 +0000 (17:15 +0000)]
Reverse a loop that is counting up to a maximum to
count down to 0 instead, under very restricted
circumstances.  Adjust 4 testcases in which this
optimization fires.

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

15 years agoShrink wrapping in PEI:
John Mosby [Mon, 11 May 2009 17:04:19 +0000 (17:04 +0000)]
Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
  and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
  limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
  multi-exit regions in the Machine CFG without
  splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.

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

15 years agoDon't generate redundant casts of constant values when lowering calls to
Jay Foad [Mon, 11 May 2009 11:32:25 +0000 (11:32 +0000)]
Don't generate redundant casts of constant values when lowering calls to
memcpy, memmove and memset.

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

15 years agoChange TargetData::getIntPtrType() to return an IntegerType instead of
Jay Foad [Mon, 11 May 2009 11:13:47 +0000 (11:13 +0000)]
Change TargetData::getIntPtrType() to return an IntegerType instead of
just a Type.

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

15 years agoFix more naming issues.
Sanjiv Gupta [Mon, 11 May 2009 08:52:04 +0000 (08:52 +0000)]
Fix more naming issues.
compiler libcalls start with .lib. now.
fixed section names.

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

15 years agoDetect calls to compiler intrinsics and emit an extern declarations
Sanjiv Gupta [Mon, 11 May 2009 06:01:38 +0000 (06:01 +0000)]
Detect calls to compiler intrinsics and emit an extern declarations
only for those. These extern declarations to intrinsics are currently
being emitted at the bottom of generated .s file, which works fine with
gpasm(not sure about MPSAM though).
PIC16 linker generates errors for few cases (function-args/struct_args_5) if you do not include any
extern declarations (even if no intrinsics are being used), but that
needs to be fixed in the linker itself.

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

15 years agoNeeded #includes. Thanks Fritz van Bommel!
Bill Wendling [Sun, 10 May 2009 23:27:41 +0000 (23:27 +0000)]
Needed #includes. Thanks Fritz van Bommel!

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

15 years agoThis is a large rewrite of how Dwarf info for inlined functions is handled.
Bill Wendling [Sun, 10 May 2009 23:14:38 +0000 (23:14 +0000)]
This is a large rewrite of how Dwarf info for inlined functions is handled.

The DwarfWriter expects DbgScopes and DIEs to behave themselves according to
DwarfWriter's rules. However, inlined functions violate these rules. There are
two different types of DIEs associated with an inlined function: an abstract
instance, which has information about the original source code for the function
being inlined; and concrete instances, which are created for each place the
function was inlined and point back to the abstract instance.

This patch tries to stay true to this schema. It bypasses how regular DbgScopes
and DIEs are created and used when necessary. It provides special handling for
DIEs of abstract and concrete instances.

This doesn't take care of all of the problems with debug info for inlined
functions, but it's a step in the right direction. For one thing, llvm-gcc
generates wrong IR (it's missing some llvm.dbg intrinsics at the point where the
function's inlined) for this example:

#include <stdio.h>
static __inline__ __attribute__((always_inline))  int bar(int x) { return 4; }
void foo() {
  long long b = 1;
  int Y = bar(4);
  printf("%d\n", Y);
}

while clang generates correct IR.

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

15 years agoMake MDNode use CallbackVH. Also change MDNode to store Value* instead of
Nick Lewycky [Sun, 10 May 2009 20:57:05 +0000 (20:57 +0000)]
Make MDNode use CallbackVH. Also change MDNode to store Value* instead of
Constant* in preperation of a future change to support holding non-Constants
in an MDNode.

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

15 years agoModule iterator contains list of filescope functions as well, we don't need to emit...
Sanjiv Gupta [Sun, 10 May 2009 16:18:39 +0000 (16:18 +0000)]
Module iterator contains list of filescope functions as well, we don't need to emit and global declarations for them. This was working earlier and was broken during one of the recent commit for PIC16 naming.

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

15 years agoAdd imm-reg and imm-mem patters for cmp on msp430
Anton Korobeynikov [Sun, 10 May 2009 14:49:00 +0000 (14:49 +0000)]
Add imm-reg and imm-mem patters for cmp on msp430
(imm is allowed to be source operand, not dest...)

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

15 years agoAdd MSP430 test for PR4136
Anton Korobeynikov [Sun, 10 May 2009 14:48:36 +0000 (14:48 +0000)]
Add MSP430 test for PR4136

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

15 years agoChanged lowering and asmprinter to use ABI Names class called PAN.
Sanjiv Gupta [Sun, 10 May 2009 05:23:47 +0000 (05:23 +0000)]
Changed lowering and asmprinter to use ABI Names class called PAN.

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

15 years ago--- Reverse-merging r71370 into '.':
Bill Wendling [Sun, 10 May 2009 00:10:50 +0000 (00:10 +0000)]
--- Reverse-merging r71370 into '.':
U    lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp

Revert r71370.

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

15 years agoA debug function start was not being recorded when the optimization level wasn't
Bill Wendling [Sat, 9 May 2009 23:51:35 +0000 (23:51 +0000)]
A debug function start was not being recorded when the optimization level wasn't
None. However, we were always recording the region end. There's no longer a good
reason for this code to be separated out between the different opt levels, as it
was doing pretty much the same thing anyway.

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

15 years agoOops. Don't forget to align single bb loops.
Evan Cheng [Sat, 9 May 2009 19:18:01 +0000 (19:18 +0000)]
Oops. Don't forget to align single bb loops.

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

15 years agofix typo
Chris Lattner [Sat, 9 May 2009 18:11:50 +0000 (18:11 +0000)]
fix typo

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

15 years agoAllow scalar evolution to compute iteration counts for loops with a
Eli Friedman [Sat, 9 May 2009 12:32:42 +0000 (12:32 +0000)]
Allow scalar evolution to compute iteration counts for loops with a
pointer-based condition.  This fixes PR3171.

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

15 years agoRemove a completed optimization. Add a potential optimization I ran
Eli Friedman [Sat, 9 May 2009 08:40:15 +0000 (08:40 +0000)]
Remove a completed optimization.  Add a potential optimization I ran
into.

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

15 years agoRename PaddedSize to AllocSize, in the hope that this
Duncan Sands [Sat, 9 May 2009 07:06:46 +0000 (07:06 +0000)]
Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.

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

15 years agoUse 16 bit arithmetic while retrieving the address of callee's frame during indirect...
Sanjiv Gupta [Sat, 9 May 2009 05:11:19 +0000 (05:11 +0000)]
Use 16 bit arithmetic while retrieving the address of callee's frame during indirect function calls, and set pclath before every call to retrieve the frame address.

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

15 years agoFactor out code that optimize loop terminating condition.
Evan Cheng [Sat, 9 May 2009 01:08:24 +0000 (01:08 +0000)]
Factor out code that optimize loop terminating condition.

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

15 years agoDon't attempt to handle unsized types in ScalarEvolution's GEP analyzer.
Dan Gohman [Sat, 9 May 2009 00:14:52 +0000 (00:14 +0000)]
Don't attempt to handle unsized types in ScalarEvolution's GEP analyzer.

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

15 years agoEnable loop bb placement optimization.
Evan Cheng [Fri, 8 May 2009 23:35:49 +0000 (23:35 +0000)]
Enable loop bb placement optimization.

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

15 years agoFix bogus overflow checks by replacing them with actual
Dan Gohman [Fri, 8 May 2009 23:11:16 +0000 (23:11 +0000)]
Fix bogus overflow checks by replacing them with actual
overflow checks.

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

15 years agoPPC::B and PPC::BCC's target operand may be an immediate.
Evan Cheng [Fri, 8 May 2009 23:09:25 +0000 (23:09 +0000)]
PPC::B and PPC::BCC's target operand may be an immediate.

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

15 years agoIn non-pic builds, we can use -mdynamic-no-pic for a little more speed.
Mike Stump [Fri, 8 May 2009 23:08:58 +0000 (23:08 +0000)]
In non-pic builds, we can use -mdynamic-no-pic for a little more speed.

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

15 years agoUse .td for tablegen files, not .ll.
Dan Gohman [Fri, 8 May 2009 23:01:28 +0000 (23:01 +0000)]
Use .td for tablegen files, not .ll.

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

15 years agoAvoid warning in release-asserts build.
Mike Stump [Fri, 8 May 2009 22:53:06 +0000 (22:53 +0000)]
Avoid warning in release-asserts build.

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

15 years agoMirror how Fast ISel determines if a region.end intrinsic is the end of an
Bill Wendling [Fri, 8 May 2009 21:14:49 +0000 (21:14 +0000)]
Mirror how Fast ISel determines if a region.end intrinsic is the end of an
inlined function or the end of a function. Before, this was never executing the
"inlined" version of the Record method.

This will become important once the inlined Dwarf writer patch lands.

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

15 years agoFold trunc casts into add-recurrence expressions, allowing the
Dan Gohman [Fri, 8 May 2009 21:03:19 +0000 (21:03 +0000)]
Fold trunc casts into add-recurrence expressions, allowing the
add-recurrence to be exposed. Add a new SCEV folding rule to
help simplify expressions in the presence of these extra truncs.

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

15 years agoCompute the offsets of the compile units. We need this so that when we emit a
Bill Wendling [Fri, 8 May 2009 21:03:15 +0000 (21:03 +0000)]
Compute the offsets of the compile units. We need this so that when we emit a
concrete instance of an inlined function, we can get the actual address of the
abstract instance inside of the compile unit.

This isn't currently used, but will be by a future check-in.

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

15 years agoFix another bug in r71252. This code supports GetElementPtr
Dan Gohman [Fri, 8 May 2009 20:58:38 +0000 (20:58 +0000)]
Fix another bug in r71252. This code supports GetElementPtr
constant exprs as well as instructions.

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

15 years agoFix typo.
Bill Wendling [Fri, 8 May 2009 20:49:29 +0000 (20:49 +0000)]
Fix typo.

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

15 years agoAdd memoization for getSCEVAtScope results for instructions
Dan Gohman [Fri, 8 May 2009 20:47:27 +0000 (20:47 +0000)]
Add memoization for getSCEVAtScope results for instructions
which are not analyzed with SCEV techniques, which can require
brute-forcing through a large number of instructions. This
fixes a massive compile-time issue on 400.perlbench (in
particular, the loop in MD5Transform).

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

15 years agoMake the SCEV* form of getSCEVAtScope public, to allow ScalarEvolution
Dan Gohman [Fri, 8 May 2009 20:38:54 +0000 (20:38 +0000)]
Make the SCEV* form of getSCEVAtScope public, to allow ScalarEvolution
clients to use it.

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

15 years agoMinor clean ups. No functionality change.
Bill Wendling [Fri, 8 May 2009 20:38:02 +0000 (20:38 +0000)]
Minor clean ups. No functionality change.

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

15 years agoFix an error from r71252.
Dan Gohman [Fri, 8 May 2009 20:36:47 +0000 (20:36 +0000)]
Fix an error from r71252.

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

15 years agoPrint out nicer dump info for DIDescriptor.
Bill Wendling [Fri, 8 May 2009 20:28:06 +0000 (20:28 +0000)]
Print out nicer dump info for DIDescriptor.

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

15 years agoFactor out the code for creating SCEVs for GEPs into a
Dan Gohman [Fri, 8 May 2009 20:26:55 +0000 (20:26 +0000)]
Factor out the code for creating SCEVs for GEPs into a
separate function.

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

15 years agoImplement several new SCEV folding rules for UDiv SCEVs.
Dan Gohman [Fri, 8 May 2009 20:18:49 +0000 (20:18 +0000)]
Implement several new SCEV folding rules for UDiv SCEVs.
This fixes an old FIXME, and is needed by some upcoming changes.

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

15 years agoAdd a getExitBlock utility function to LoopInfo which returns the
Dan Gohman [Fri, 8 May 2009 20:07:23 +0000 (20:07 +0000)]
Add a getExitBlock utility function to LoopInfo which returns the
exit block of a loop, if there is exactly one, similar to
getExitingBlock.

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

15 years agoDon't align loop header unless the loop back edge is below the header.
Evan Cheng [Fri, 8 May 2009 19:01:44 +0000 (19:01 +0000)]
Don't align loop header unless the loop back edge is below the header.

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

15 years agoFactor out cycle-finder code and make it generic.
Anton Korobeynikov [Fri, 8 May 2009 18:51:58 +0000 (18:51 +0000)]
Factor out cycle-finder code and make it generic.

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

15 years agoDo not emit bit tests if target does not support natively left shift
Anton Korobeynikov [Fri, 8 May 2009 18:51:34 +0000 (18:51 +0000)]
Do not emit bit tests if target does not support natively left shift

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

15 years agoAllow 8 bit select in custom inserter
Anton Korobeynikov [Fri, 8 May 2009 18:51:21 +0000 (18:51 +0000)]
Allow 8 bit select in custom inserter

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

15 years agoProperly expand libcalls for urem / srem. Also make code more straightforward.
Anton Korobeynikov [Fri, 8 May 2009 18:51:08 +0000 (18:51 +0000)]
Properly expand libcalls for urem / srem. Also make code more straightforward.

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

15 years agoTypo
Anton Korobeynikov [Fri, 8 May 2009 18:50:54 +0000 (18:50 +0000)]
Typo

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

15 years agoExpand UREM / SREM into libcalls
Anton Korobeynikov [Fri, 8 May 2009 18:50:41 +0000 (18:50 +0000)]
Expand UREM / SREM into libcalls

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

15 years agoAdd 8 bit select
Anton Korobeynikov [Fri, 8 May 2009 18:50:26 +0000 (18:50 +0000)]
Add 8 bit select

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

15 years agoFix PR4152: asm constraint validation happens before dag combine, so we
Chris Lattner [Fri, 8 May 2009 18:23:14 +0000 (18:23 +0000)]
Fix PR4152: asm constraint validation happens before dag combine, so we
need to work a bit to combine things like (x+c1+c2) into x+c3.

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

15 years agoAdd some examples to show the difference between
Duncan Sands [Fri, 8 May 2009 17:49:48 +0000 (17:49 +0000)]
Add some examples to show the difference between
the various notions of type size used in LLVM.

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