oota-llvm.git
15 years agoDon't sign extend the char when expanding char -> int during
Nick Lewycky [Sat, 21 Feb 2009 20:50:42 +0000 (20:50 +0000)]
Don't sign extend the char when expanding char -> int during
load(bitcast(char[4] to i32*)) evaluation.

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

15 years agoAdd makefile debugging target; use "make print-FOO" to print the
Daniel Dunbar [Sat, 21 Feb 2009 20:42:39 +0000 (20:42 +0000)]
Add makefile debugging target; use "make print-FOO" to print the
value/definition/origin of FOO.

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

15 years agobug 3610: Floating point vaarg not softened.
Richard Pennington [Sat, 21 Feb 2009 19:11:18 +0000 (19:11 +0000)]
bug 3610: Floating point vaarg not softened.

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

15 years agoAdd version of StringsEqualNoCase that takes two null-terminated C-strings and compar...
Ted Kremenek [Sat, 21 Feb 2009 18:25:30 +0000 (18:25 +0000)]
Add version of StringsEqualNoCase that takes two null-terminated C-strings and compares up to 'len' characters.  I tend to screw up string comparison functions, so anyone who is interested please review this\!

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

15 years agoDrop bunch of half-working stuff in the ext_weak linkage support.
Anton Korobeynikov [Sat, 21 Feb 2009 11:53:32 +0000 (11:53 +0000)]
Drop bunch of half-working stuff in the ext_weak linkage support.
Now we're using one gross, but quite robust hack :) (previous ones
did not work, for example, when ext_weak symbol was used deep inside
constant expression in the initializer).

The proper fix of this problem will require some quite huge asmprinter
changes and that's why was postponed. This fixes PR3629 by the way :)

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

15 years agoPass different flags on different platforms when building PIC.
Nick Lewycky [Sat, 21 Feb 2009 08:41:09 +0000 (08:41 +0000)]
Pass different flags on different platforms when building PIC.

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

15 years agoAdd AddrModeMatcher.cpp
Evan Cheng [Sat, 21 Feb 2009 07:05:11 +0000 (07:05 +0000)]
Add AddrModeMatcher.cpp

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

15 years agoIf two-address def is dead and the instruction does not define other registers, and...
Evan Cheng [Sat, 21 Feb 2009 03:14:25 +0000 (03:14 +0000)]
If two-address def is dead and the instruction does not define other registers, and it doesn't produce side effects, just delete the instruction.

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

15 years agoTeach LSR sink to sink the immediate portion of the common expression back into uses...
Evan Cheng [Sat, 21 Feb 2009 02:06:47 +0000 (02:06 +0000)]
Teach LSR sink to sink the immediate portion of the common expression back into uses if they fit in address modes of all the uses.

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

15 years agoMake sure this doesn't access .end() too.
Bill Wendling [Sat, 21 Feb 2009 01:11:36 +0000 (01:11 +0000)]
Make sure this doesn't access .end() too.

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

15 years agofix and clean up a comment
Gabor Greif [Sat, 21 Feb 2009 01:09:07 +0000 (01:09 +0000)]
fix and clean up a comment

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

15 years agoMake sure we don't dereference the .end() of the container.
Bill Wendling [Sat, 21 Feb 2009 01:07:26 +0000 (01:07 +0000)]
Make sure we don't dereference the .end() of the container.

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

15 years agorename a function to indicate that it checks for profitability as well
Chris Lattner [Sat, 21 Feb 2009 00:46:50 +0000 (00:46 +0000)]
rename a function to indicate that it checks for profitability as well
as legality.  Make load sinking and gep sinking more careful: we only
do it when it won't pessimize loads from the stack.  This has the added
benefit of not producing code that is unanalyzable to SROA.

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

15 years agoPropagate more debug loc infos. This also includes some code cleaning.
Bill Wendling [Sat, 21 Feb 2009 00:43:56 +0000 (00:43 +0000)]
Propagate more debug loc infos. This also includes some code cleaning.

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

15 years agoWe need to propagate the debug location information even when dealing with the
Bill Wendling [Sat, 21 Feb 2009 00:32:08 +0000 (00:32 +0000)]
We need to propagate the debug location information even when dealing with the
prologue/epilogue.

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

15 years ago* Fixed spelling
Misha Brukman [Fri, 20 Feb 2009 23:44:54 +0000 (23:44 +0000)]
* Fixed spelling
* Linters now return their information instead of printing it, to
  enable easier unittesting
* Added support for finding tabs in files, added to C++ linter

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

15 years agoFix a bug that David Greene found in the DAGCombiner's logic
Dan Gohman [Fri, 20 Feb 2009 23:29:13 +0000 (23:29 +0000)]
Fix a bug that David Greene found in the DAGCombiner's logic
that checks whether it's safe to transform a store of a bitcast
value into a store of the original value.

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

15 years agoRemoved trailing whitespace.
Misha Brukman [Fri, 20 Feb 2009 23:04:06 +0000 (23:04 +0000)]
Removed trailing whitespace.

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

15 years agoRemoved trailing whitespace.
Misha Brukman [Fri, 20 Feb 2009 22:54:36 +0000 (22:54 +0000)]
Removed trailing whitespace.

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

15 years agoRemoved trailing whitespace.
Misha Brukman [Fri, 20 Feb 2009 22:51:36 +0000 (22:51 +0000)]
Removed trailing whitespace.

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

15 years agoKeep the newline character at the end of the lines whose trailing whitespace we
Misha Brukman [Fri, 20 Feb 2009 22:30:46 +0000 (22:30 +0000)]
Keep the newline character at the end of the lines whose trailing whitespace we
are deleting; otherwise, everything ends up on a single line.

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

15 years agoOnly strip the newline character at the end of the lines that we're considering
Misha Brukman [Fri, 20 Feb 2009 22:28:45 +0000 (22:28 +0000)]
Only strip the newline character at the end of the lines that we're considering
for length and for trailing whitespace; otherwise, the whitespace themselves
will also be removed.

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

15 years agoFixed lint errors:
Misha Brukman [Fri, 20 Feb 2009 22:20:18 +0000 (22:20 +0000)]
Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars

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

15 years agoWe have logic in there to emit a default debugging label at the beginning of a
Bill Wendling [Fri, 20 Feb 2009 22:19:20 +0000 (22:19 +0000)]
We have logic in there to emit a default debugging label at the beginning of a
function. Emitting another label after the prologue messes up the debugging. We
are doing that because the first DebugLoc object it sees is different from the
previous, which was nothing. Check for this situation, and don't emit one if
it's the first.

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

15 years agoFix strange logic in CollectIVUsers used to determine whether all uses are
Evan Cheng [Fri, 20 Feb 2009 22:16:49 +0000 (22:16 +0000)]
Fix strange logic in CollectIVUsers used to determine whether all uses are
addresses, part 1. This fixes an obvious logic bug. Previously if the only
in-loop use is a PHI, it would return AllUsesAreAddresses as true.

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

15 years agoSimplify code and reduce indentation. No functionality change.
Dan Gohman [Fri, 20 Feb 2009 21:27:23 +0000 (21:27 +0000)]
Simplify code and reduce indentation. No functionality change.

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

15 years agoFix 80-column violations.
Dan Gohman [Fri, 20 Feb 2009 21:06:57 +0000 (21:06 +0000)]
Fix 80-column violations.

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

15 years agoIt's not necessary to check if Base is null here.
Dan Gohman [Fri, 20 Feb 2009 21:05:23 +0000 (21:05 +0000)]
It's not necessary to check if Base is null here.

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

15 years agoSupport return of MMX values in 64-bit mode.
Evan Cheng [Fri, 20 Feb 2009 20:43:02 +0000 (20:43 +0000)]
Support return of MMX values in 64-bit mode.

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

15 years ago- Early exit a nested block.
Bill Wendling [Fri, 20 Feb 2009 20:40:28 +0000 (20:40 +0000)]
- Early exit a nested block.
- Correct comment.
- Whitespace changes.

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

15 years agoAdd a comment about how Imm can be used for loop-variant values.
Dan Gohman [Fri, 20 Feb 2009 20:29:04 +0000 (20:29 +0000)]
Add a comment about how Imm can be used for loop-variant values.

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

15 years agoadd note about sin
Torok Edwin [Fri, 20 Feb 2009 18:42:06 +0000 (18:42 +0000)]
add note about sin

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

15 years agoFactor address mode matcher out of codegen prepare to make it available to other...
Evan Cheng [Fri, 20 Feb 2009 18:24:38 +0000 (18:24 +0000)]
Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.

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

15 years agoJust roll back the previous change to -mem2reg.
Zhou Sheng [Fri, 20 Feb 2009 17:49:33 +0000 (17:49 +0000)]
Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.

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

15 years agopatch to update the line number information in pass -mem2reg.
Zhou Sheng [Fri, 20 Feb 2009 16:31:35 +0000 (16:31 +0000)]
patch to update the line number information in pass -mem2reg.
Currently this pass will delete the variable declaration info,
and keep the line number info. But the kept line number info is not updated,
and some is redundant or not correct, this patch just updates those info.

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

15 years agoFix a crash in the pre-alloc splitter exposed by recent codegen changes.
Owen Anderson [Fri, 20 Feb 2009 10:02:23 +0000 (10:02 +0000)]
Fix a crash in the pre-alloc splitter exposed by recent codegen changes.

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

15 years agoAdd a quick pass to the stack slot colorer to eliminate some trivially redundant...
Owen Anderson [Fri, 20 Feb 2009 09:11:36 +0000 (09:11 +0000)]
Add a quick pass to the stack slot colorer to eliminate some trivially redundant spills after coloring.
Ideally these would never get created in the first place, but until we enhance the spiller to have a more
global picture of what's happening, this is necessary for code quality in some circumstances.

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

15 years agomake these tests pass when run on a G5.
Chris Lattner [Fri, 20 Feb 2009 07:10:11 +0000 (07:10 +0000)]
make these tests pass when run on a G5.

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

15 years agoImplement "superhero" strength reduction, or full strength
Dan Gohman [Fri, 20 Feb 2009 04:17:46 +0000 (04:17 +0000)]
Implement "superhero" strength reduction, or full strength
reduction of address calculations down to basic pointer arithmetic.
This is currently off by default, as it needs a few other features
before it becomes generally useful. And even when enabled, full
strength reduction is only performed when it doesn't increase
register pressure, and when several other conditions are true.

This also factors out a bunch of exisiting LSR code out of
StrengthReduceStridedIVUsers into separate functions, and tidies
up IV insertion. This actually decreases register pressure even
in non-superhero mode. The change in iv-users-in-other-loops.ll
is an example of this; there are two more adds because there are
two fewer leas, and there is less spilling.

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

15 years agoAdd an accessor method to DwarfWriter to tell of debugging info should be emitted.
Bill Wendling [Fri, 20 Feb 2009 00:44:43 +0000 (00:44 +0000)]
Add an accessor method to DwarfWriter to tell of debugging info should be emitted.

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

15 years agoAdd a default debug location object to the Machine Function. It's used to emit a...
Bill Wendling [Fri, 20 Feb 2009 00:42:52 +0000 (00:42 +0000)]
Add a default debug location object to the Machine Function. It's used to emit a default debugging label at the beginning of a function.

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

15 years agoTemporarily revert r65065. It was causing test failures.
Bill Wendling [Thu, 19 Feb 2009 21:57:07 +0000 (21:57 +0000)]
Temporarily revert r65065. It was causing test failures.

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

15 years agoPrint out debug info when printing the machine instruction.
Bill Wendling [Thu, 19 Feb 2009 21:44:55 +0000 (21:44 +0000)]
Print out debug info when printing the machine instruction.

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

15 years agoCheck for -fast here too.
Bill Wendling [Thu, 19 Feb 2009 21:23:54 +0000 (21:23 +0000)]
Check for -fast here too.

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

15 years agoGenerate these labels when we're in "fast" mode, not simply when we're no in
Bill Wendling [Thu, 19 Feb 2009 21:12:54 +0000 (21:12 +0000)]
Generate these labels when we're in "fast" mode, not simply when we're no in
"optimize-for-size" mode.

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

15 years agoDescribe tail merging's use of InsertBranch.
Dale Johannesen [Thu, 19 Feb 2009 19:40:21 +0000 (19:40 +0000)]
Describe tail merging's use of InsertBranch.

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

15 years agoUse DEBUG() instead of passing *DOUT to WriteAsOperand,
Dan Gohman [Thu, 19 Feb 2009 19:32:06 +0000 (19:32 +0000)]
Use DEBUG() instead of passing *DOUT to WriteAsOperand,
since the latter just passes a null reference when
debugging is not enabled.

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

15 years agoMake the debug output of LSR less cryptic and more informative.
Dan Gohman [Thu, 19 Feb 2009 19:23:27 +0000 (19:23 +0000)]
Make the debug output of LSR less cryptic and more informative.

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

15 years agoPrint out a new label only if the debug location *tuple* is different. The debug
Bill Wendling [Thu, 19 Feb 2009 09:16:38 +0000 (09:16 +0000)]
Print out a new label only if the debug location *tuple* is different. The debug
locations may change, but the tuples may be the same.

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

15 years agoForgot to check that debug information is supported.
Bill Wendling [Thu, 19 Feb 2009 08:06:12 +0000 (08:06 +0000)]
Forgot to check that debug information is supported.

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

15 years agoRegenerate.
Nick Lewycky [Thu, 19 Feb 2009 06:18:56 +0000 (06:18 +0000)]
Regenerate.

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

15 years agoDefault to building with position independent code. This may increase LLVM's
Nick Lewycky [Thu, 19 Feb 2009 06:18:24 +0000 (06:18 +0000)]
Default to building with position independent code. This may increase LLVM's
run time but will make LLVM easier to use as a library.

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

15 years agoIf an executable is run through a symlink, dladdr will return the
Chris Lattner [Thu, 19 Feb 2009 05:34:35 +0000 (05:34 +0000)]
If an executable is run through a symlink, dladdr will return the
symlink.  We really want the ultimate executable being run, not
the symlink.  This lets clang find its headers when invoked through
a symlink. rdar://6602012

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

15 years agoFix the logic in this assertion to properly validate the number
Dan Gohman [Thu, 19 Feb 2009 02:55:18 +0000 (02:55 +0000)]
Fix the logic in this assertion to properly validate the number
of arguments.

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

15 years agoReapply r57340. VMKit does not presently rely on materializeFunction
Dan Gohman [Thu, 19 Feb 2009 02:40:15 +0000 (02:40 +0000)]
Reapply r57340. VMKit does not presently rely on materializeFunction
being called with the lock released, and this fixes a race condition
in the JIT as used by lli.

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

15 years agoTemporarily XFAIL this test.
Bill Wendling [Thu, 19 Feb 2009 00:13:55 +0000 (00:13 +0000)]
Temporarily XFAIL this test.

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

15 years agoPut code that generates debug labels into TableGen so that it can be used by
Bill Wendling [Wed, 18 Feb 2009 23:12:06 +0000 (23:12 +0000)]
Put code that generates debug labels into TableGen so that it can be used by
everyone.

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

15 years agoadd proper asmwriter and asmparser support for anonymous functions.
Chris Lattner [Wed, 18 Feb 2009 21:48:13 +0000 (21:48 +0000)]
add proper asmwriter and asmparser support for anonymous functions.

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

15 years agoIn theory the aliasee may have dead constant users
Duncan Sands [Wed, 18 Feb 2009 17:55:38 +0000 (17:55 +0000)]
In theory the aliasee may have dead constant users
here.  Since we only do the transform if there is
one use, strip off any such users in the hope of
making the transform fire more often.

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

15 years agoreally fix style
Rafael Espindola [Wed, 18 Feb 2009 17:49:06 +0000 (17:49 +0000)]
really fix style

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

15 years agoThe subprogram die may not exist while creating "default" scope.
Devang Patel [Wed, 18 Feb 2009 17:29:38 +0000 (17:29 +0000)]
The subprogram die may not exist while creating "default" scope.

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

15 years agoUse a sign-extend instead of a zero-extend when promoting a
Dan Gohman [Wed, 18 Feb 2009 17:22:41 +0000 (17:22 +0000)]
Use a sign-extend instead of a zero-extend when promoting a
trip count value when the original loop iteration condition is
signed and the canonical induction variable won't undergo signed
overflow. This isn't required for correctness; it just preserves
more information about original loop iteration values.

Add a getTruncateOrSignExtend method to ScalarEvolution,
following getTruncateOrZeroExtend.

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

15 years agoSimplify by using dyn_cast instead of isa and cast.
Dan Gohman [Wed, 18 Feb 2009 16:54:33 +0000 (16:54 +0000)]
Simplify by using dyn_cast instead of isa and cast.

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

15 years agoClarify the definition of "latch block" in a comment.
Dan Gohman [Wed, 18 Feb 2009 16:43:19 +0000 (16:43 +0000)]
Clarify the definition of "latch block" in a comment.

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

15 years agoAdd explicit keywords.
Dan Gohman [Wed, 18 Feb 2009 16:37:45 +0000 (16:37 +0000)]
Add explicit keywords.

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

15 years agoAdd support to the JIT for true non-lazy operation. When a call to a function
Nate Begeman [Wed, 18 Feb 2009 08:31:02 +0000 (08:31 +0000)]
Add support to the JIT for true non-lazy operation.  When a call to a function
that has not been JIT'd yet, the callee is put on a list of pending functions
to JIT.  The call is directed through a stub, which is updated with the address
of the function after it has been JIT'd.  A new interface for allocating and
updating empty stubs is provided.

Add support for removing the ModuleProvider the JIT was created with, which
would otherwise invalidate the JIT's PassManager, which is initialized with the
ModuleProvider's Module.

Add support under a new ExecutionEngine flag for emitting the infomration
necessary to update Function and GlobalVariable stubs after JITing them, by
recording the address of the stub and the name of the GlobalValue.  This allows
code to be copied from one address space to another, where libraries may live
at different virtual addresses, and have the stubs updated with their new
correct target addresses.

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

15 years agofix style
Rafael Espindola [Wed, 18 Feb 2009 08:30:15 +0000 (08:30 +0000)]
fix style

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

15 years agoAdd a test for r61358, which I forgot to add way back when.
Owen Anderson [Wed, 18 Feb 2009 07:50:22 +0000 (07:50 +0000)]
Add a test for r61358, which I forgot to add way back when.

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

15 years agoFactor out the code to add a MachineOperand to a MachineInstrBuilder.
Dan Gohman [Wed, 18 Feb 2009 05:45:50 +0000 (05:45 +0000)]
Factor out the code to add a MachineOperand to a MachineInstrBuilder.

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

15 years agoEliminate several more unnecessary intptr_t casts.
Dan Gohman [Wed, 18 Feb 2009 05:09:16 +0000 (05:09 +0000)]
Eliminate several more unnecessary intptr_t casts.

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

15 years agoChange the argument type in this test to something less convoluted,
Dan Gohman [Wed, 18 Feb 2009 04:25:04 +0000 (04:25 +0000)]
Change the argument type in this test to something less convoluted,
since it isn't actually used.

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

15 years agoGV with null value initializer shouldn't go to BSS if it's meant for a mergeable...
Evan Cheng [Wed, 18 Feb 2009 02:19:52 +0000 (02:19 +0000)]
GV with null value initializer shouldn't go to BSS if it's meant for a mergeable strings section. Currently it only checks for Darwin. Someone else please check if it should apply to other targets as well.

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

15 years agoallow TimeRegion to take a potentially-null pointer to a
Chris Lattner [Wed, 18 Feb 2009 01:48:17 +0000 (01:48 +0000)]
allow TimeRegion to take a potentially-null pointer to a
timer for clang.

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

15 years agoFix a corner case in the new indvars promotion logic: if there
Dan Gohman [Wed, 18 Feb 2009 00:52:00 +0000 (00:52 +0000)]
Fix a corner case in the new indvars promotion logic: if there
are multiple IV's in a loop, some of them may under go signed
or unsigned wrapping even if the IV that's used in the loop
exit condition doesn't. Restrict sign-extension-elimination
and zero-extension-elimination to only those that operate on
the original loop-controlling IV.

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

15 years agoFix a typo in a comment.
Dan Gohman [Wed, 18 Feb 2009 00:08:39 +0000 (00:08 +0000)]
Fix a typo in a comment.

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

15 years agoIf an alias is dead and so is its aliasee, then globaldce would
Duncan Sands [Tue, 17 Feb 2009 23:05:26 +0000 (23:05 +0000)]
If an alias is dead and so is its aliasee, then globaldce would
crash because the alias would still be using the aliasee when the
aliasee was deleted.

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

15 years agoAnd now, not so elegant, test case...
Devang Patel [Tue, 17 Feb 2009 22:48:18 +0000 (22:48 +0000)]
And now, not so elegant, test case...

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

15 years agoRemove changes that were accidently included in previous commit.
Devang Patel [Tue, 17 Feb 2009 22:45:18 +0000 (22:45 +0000)]
Remove changes that were accidently included in previous commit.

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

15 years agoThe debugger sometimes lookup dynamically in the runtime to find ivar info of any...
Devang Patel [Tue, 17 Feb 2009 22:43:44 +0000 (22:43 +0000)]
The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.

Add support for two additional DWARF attributes to encode Objective-C runtime version number.

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

15 years agoRemove trailing whitespace to reduce later commit patch noise.
Scott Michel [Tue, 17 Feb 2009 22:15:04 +0000 (22:15 +0000)]
Remove trailing whitespace to reduce later commit patch noise.

(Note: Eventually, commits like this will be handled via a pre-commit hook that
 does this automagically, as well as expand tabs to spaces and look for 80-col
 violations.)

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

15 years agoEmit debug info for bitfields.
Devang Patel [Tue, 17 Feb 2009 21:23:59 +0000 (21:23 +0000)]
Emit debug info for bitfields.

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

15 years agotools like nm and ar only need register_claim_file and add_symbols. Don't abort
Rafael Espindola [Tue, 17 Feb 2009 21:08:21 +0000 (21:08 +0000)]
tools like nm and ar only need register_claim_file and add_symbols. Don't abort
if other hooks are missing.

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

15 years agoLoopIndexSplit doesn't actually use ScalarEvolution.
Dan Gohman [Tue, 17 Feb 2009 20:50:11 +0000 (20:50 +0000)]
LoopIndexSplit doesn't actually use ScalarEvolution.

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

15 years agoAdd a method to ScalarEvolution for telling it when a loop has been
Dan Gohman [Tue, 17 Feb 2009 20:49:49 +0000 (20:49 +0000)]
Add a method to ScalarEvolution for telling it when a loop has been
modified in a way that may effect the trip count calculation. Change
IndVars to use this method when it rewrites pointer or floating-point
induction variables instead of using a doInitialization method to
sneak these changes in before ScalarEvolution has a chance to see
the loop. This eliminates the need for LoopPass to depend on
ScalarEvolution.

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

15 years agocommit a tweaked version of Daniel's patch for PR3599. We now
Chris Lattner [Tue, 17 Feb 2009 20:47:23 +0000 (20:47 +0000)]
commit a tweaked version of Daniel's patch for PR3599.  We now
eliminate all the extensions and all but the one required truncate
from the testcase, but the or/and/shift stuff still isn't zapped.

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

15 years agoMove dumpPassStructure out of line.
Dan Gohman [Tue, 17 Feb 2009 19:41:26 +0000 (19:41 +0000)]
Move dumpPassStructure out of line.

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

15 years agoTidy whitespace.
Dan Gohman [Tue, 17 Feb 2009 19:34:54 +0000 (19:34 +0000)]
Tidy whitespace.

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

15 years agoDelete trailing whitespace.
Dan Gohman [Tue, 17 Feb 2009 19:13:57 +0000 (19:13 +0000)]
Delete trailing whitespace.

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

15 years agoThis transform also applies to private linkage.
Duncan Sands [Tue, 17 Feb 2009 17:50:04 +0000 (17:50 +0000)]
This transform also applies to private linkage.

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

15 years agoFix 80-column violation.
Dan Gohman [Tue, 17 Feb 2009 15:57:39 +0000 (15:57 +0000)]
Fix 80-column violation.

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

15 years agoA couple of places where reused use operands should be marked kill. This is exposed...
Evan Cheng [Tue, 17 Feb 2009 06:41:03 +0000 (06:41 +0000)]
A couple of places where reused use operands should be marked kill. This is exposed by recent availability fallthrough changes.

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

15 years agoadd a horrible note
Chris Lattner [Tue, 17 Feb 2009 01:16:14 +0000 (01:16 +0000)]
add a horrible note

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

15 years ago--- Merging (from foreign repository) r64714 into '.':
Bill Wendling [Tue, 17 Feb 2009 01:04:54 +0000 (01:04 +0000)]
--- Merging (from foreign repository) r64714 into '.':
U    include/llvm/CodeGen/DebugLoc.h
U    lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
U    lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
U    lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp

Enable debug location generation at -Os. This goes with the reapplication of the
r63639 patch.

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

15 years agoTestcase for rev. 64704
Devang Patel [Tue, 17 Feb 2009 00:15:08 +0000 (00:15 +0000)]
Testcase for rev. 64704

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

15 years agoStrengthen the "non-constant stride must dominate loop preheader" check.
Evan Cheng [Tue, 17 Feb 2009 00:13:06 +0000 (00:13 +0000)]
Strengthen the "non-constant stride must dominate loop preheader" check.

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

15 years agoSimplify; fix some 80-column violations.
Dan Gohman [Tue, 17 Feb 2009 00:10:53 +0000 (00:10 +0000)]
Simplify; fix some 80-column violations.

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

15 years agoDelete trailing whitespace.
Dan Gohman [Mon, 16 Feb 2009 23:14:14 +0000 (23:14 +0000)]
Delete trailing whitespace.

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

15 years agoFix EnforceKnownAlignment so that it doesn't ever reduce the alignment
Dan Gohman [Mon, 16 Feb 2009 23:02:21 +0000 (23:02 +0000)]
Fix EnforceKnownAlignment so that it doesn't ever reduce the alignment
of an alloca or global variable.

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

15 years agoAdd llvm::RoundUpToAlignment.
Daniel Dunbar [Mon, 16 Feb 2009 22:57:04 +0000 (22:57 +0000)]
Add llvm::RoundUpToAlignment.
 - No functionality change.

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

15 years agoFix bug where APSInt::operator-- incremented instead of decremented.
Ted Kremenek [Mon, 16 Feb 2009 22:39:08 +0000 (22:39 +0000)]
Fix bug where APSInt::operator-- incremented instead of decremented.

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