oota-llvm.git
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

15 years agoTest case for llvm-gcc rev. 64648.
Devang Patel [Mon, 16 Feb 2009 19:24:29 +0000 (19:24 +0000)]
Test case for llvm-gcc rev. 64648.

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

15 years agoFix typo caused by too much surfing, dudes...
Nick Lewycky [Mon, 16 Feb 2009 04:26:53 +0000 (04:26 +0000)]
Fix typo caused by too much surfing, dudes...

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

15 years agoDelete this long-commented-out code. The situation it seems to have
Dan Gohman [Mon, 16 Feb 2009 02:57:42 +0000 (02:57 +0000)]
Delete this long-commented-out code. The situation it seems to have
been written for is no longer relevant with the elimination of
signed and unsigned types.

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

15 years agoRename IndVarsSimplify to IndVarSimplify, to be consistent with
Dan Gohman [Mon, 16 Feb 2009 00:56:15 +0000 (00:56 +0000)]
Rename IndVarsSimplify to IndVarSimplify, to be consistent with
the name used in the code that these tests are for.

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

15 years agoChange these tests to use regular loads instead of llvm.x86.sse2.loadu.dq.
Dan Gohman [Mon, 16 Feb 2009 00:44:23 +0000 (00:44 +0000)]
Change these tests to use regular loads instead of llvm.x86.sse2.loadu.dq.
Enhance instcombine to use the preferred field of
GetOrEnforceKnownAlignment in more cases, so that regular IR operations are
optimized in the same way that the intrinsics currently are.

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

15 years agoDon't assume that a left-shift of a value with one bit set will have
Dan Gohman [Sun, 15 Feb 2009 23:59:32 +0000 (23:59 +0000)]
Don't assume that a left-shift of a value with one bit set will have
one bit set, because the bit may be shifted off the end. Instead,
just check for a constant 1 being shifted. This is still sufficient
to handle all the cases in test/CodeGen/X86/bt.ll. This fixes PR3583.

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

15 years agoMachineLICM now handles these cases.
Dan Gohman [Sun, 15 Feb 2009 23:24:52 +0000 (23:24 +0000)]
MachineLICM now handles these cases.

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

15 years agoDemonstrate the act of including multiple space-separated parameter attributes,
Nick Lewycky [Sun, 15 Feb 2009 23:06:14 +0000 (23:06 +0000)]
Demonstrate the act of including multiple space-separated parameter attributes,
by request on IRC.

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

15 years agoShoot! Remove this debugging line again!
Nick Lewycky [Sun, 15 Feb 2009 22:50:17 +0000 (22:50 +0000)]
Shoot! Remove this debugging line again!

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

15 years agoDon't discard definitions of common symbols. Not sure if this is the right fix.
Nick Lewycky [Sun, 15 Feb 2009 22:49:17 +0000 (22:49 +0000)]
Don't discard definitions of common symbols. Not sure if this is the right fix.

Before this change, the program:
  int var;
  int main(void) { return 0; }
when run under 'nm -g' would show 'U var' with the gold plugin and
'B var' with gcc.

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

15 years agoUpdate the list of function annotations for nocapture. All of these came up
Nick Lewycky [Sun, 15 Feb 2009 22:47:25 +0000 (22:47 +0000)]
Update the list of function annotations for nocapture. All of these came up
when I was looking at functions used by python.

Highlights include, better largefile support (64-bit file sizes on 32-bit
systems), fputs string is nocapture, popen/pclose added (popen being noalias
return), modf and frexp and friends. Also added some missing 'break' statements
and combined identical sections.

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

15 years agoOn 64bit we may have a personality function which requires 64 bits to
Nicolas Geoffray [Sun, 15 Feb 2009 20:49:23 +0000 (20:49 +0000)]
On 64bit we may have a personality function which requires 64 bits to
be encoded.

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

15 years agoMake this more useful for cleaning up after the
Duncan Sands [Sun, 15 Feb 2009 11:54:49 +0000 (11:54 +0000)]
Make this more useful for cleaning up after the
one-definition-rule llvm-gcc changes (coming soon
to a tree near you!).

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

15 years ago80-column violation.
Mikhail Glushenkov [Sun, 15 Feb 2009 11:32:31 +0000 (11:32 +0000)]
80-column violation.

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

15 years agoIf the target of an alias has internal linkage, then the
Duncan Sands [Sun, 15 Feb 2009 09:56:08 +0000 (09:56 +0000)]
If the target of an alias has internal linkage, then the
alias can be morphed into the target.  Implement this
transform, and fix a crash in the existing transform at
the same time.

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

15 years agoFix PR3522. It's not safe to sink into landing pad BB's.
Evan Cheng [Sun, 15 Feb 2009 08:36:12 +0000 (08:36 +0000)]
Fix PR3522. It's not safe to sink into landing pad BB's.

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

15 years agoFix pr3571: If stride is a value defined by an instruction, make sure it dominates...
Evan Cheng [Sun, 15 Feb 2009 06:06:15 +0000 (06:06 +0000)]
Fix pr3571: If stride is a value defined by an instruction, make sure it dominates the loop preheader. When IV users are strength reduced, the stride is inserted into the preheader. It could create a use before def situation.

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

15 years agoifdef out unneeded if statement.
Evan Cheng [Sun, 15 Feb 2009 03:20:37 +0000 (03:20 +0000)]
ifdef out unneeded if statement.

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

15 years agoFix warning on gcc 4.3.
Mikhail Glushenkov [Sun, 15 Feb 2009 03:20:32 +0000 (03:20 +0000)]
Fix warning on gcc 4.3.

"system() declared with attribute warn_unused_result."

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

15 years agoWhitespace fixes.
Mikhail Glushenkov [Sun, 15 Feb 2009 03:20:03 +0000 (03:20 +0000)]
Whitespace fixes.

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

15 years agoAdd mode_t to the config.h generated by cmake on win32. Used by clang.
Cedric Venet [Sat, 14 Feb 2009 16:13:26 +0000 (16:13 +0000)]
Add mode_t to the config.h generated by cmake on win32. Used by clang.

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

15 years agoUnbreak the build on win32.
Cedric Venet [Sat, 14 Feb 2009 16:06:42 +0000 (16:06 +0000)]
Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

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

15 years agoGeneralize some alias analysis logic from atomic
Duncan Sands [Sat, 14 Feb 2009 10:56:35 +0000 (10:56 +0000)]
Generalize some alias analysis logic from atomic
intrinsics to any IntrWriteArgMem intrinsics.

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

15 years ago80-column violation.
Mikhail Glushenkov [Sat, 14 Feb 2009 08:41:25 +0000 (08:41 +0000)]
80-column violation.

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

15 years agoThe trampoline intrinsic can be marked IntrWriteArgMem,
Duncan Sands [Sat, 14 Feb 2009 05:33:26 +0000 (05:33 +0000)]
The trampoline intrinsic can be marked IntrWriteArgMem,
now that this no longer implies nocapture.

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

15 years agoIntrWriteArgMem implies nocapture, but this wasn't
Duncan Sands [Sat, 14 Feb 2009 05:16:25 +0000 (05:16 +0000)]
IntrWriteArgMem implies nocapture, but this wasn't
taken advantage of anywhere.  Change the definition
of IntrWriteArgMem to no longer imply nocapture, and
explicitly add nocapture attributes everywhere (well,
not quite everywhere, because some of these intrinsics
did capture their arguments!).  Also, make clear that
the lack of other side-effects does not exclude doing
volatile loads or stores - the atomic intrinsics do
these, yet they are all marked IntrWriteArgMem (this
change is safe because nothing exploited it).

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

15 years agoThe x86-64 red zone is now being used.
Dan Gohman [Sat, 14 Feb 2009 03:30:05 +0000 (03:30 +0000)]
The x86-64 red zone is now being used.

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

15 years agoExtend the IndVarSimplify support for promoting induction variables:
Dan Gohman [Sat, 14 Feb 2009 02:31:09 +0000 (02:31 +0000)]
Extend the IndVarSimplify support for promoting induction variables:
 - Test for signed and unsigned wrapping conditions, instead of just
   testing for non-negative induction ranges.
 - Handle loops with GT comparisons, in addition to LT comparisons.
 - Support more cases of induction variables that don't start at 0.

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

15 years agoClarify debug output.
Dan Gohman [Sat, 14 Feb 2009 02:26:50 +0000 (02:26 +0000)]
Clarify debug output.

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

15 years agoSimplify some code. hasComputableLoopEvolution is overkill in this case.
Dan Gohman [Sat, 14 Feb 2009 02:25:19 +0000 (02:25 +0000)]
Simplify some code. hasComputableLoopEvolution is overkill in this case.
No functionality change.

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

15 years agoTestcase for llvm-gcc 64510.
Dale Johannesen [Sat, 14 Feb 2009 00:19:28 +0000 (00:19 +0000)]
Testcase for llvm-gcc 64510.

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

15 years agoTeach x86 target -soft-float.
Evan Cheng [Fri, 13 Feb 2009 22:36:38 +0000 (22:36 +0000)]
Teach x86 target -soft-float.

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

15 years agoIn CodeGenPrepare's debug output, use WriteAsOperand instead of
Dan Gohman [Fri, 13 Feb 2009 17:45:12 +0000 (17:45 +0000)]
In CodeGenPrepare's debug output, use WriteAsOperand instead of
printing getName(), so that unnamed values are printed correctly.

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

15 years agoComplete the sentance in this comment. I have reservations
Dan Gohman [Fri, 13 Feb 2009 17:36:42 +0000 (17:36 +0000)]
Complete the sentance in this comment. I have reservations
about the code it describes, but at least now the comment
is right.

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

15 years agoCorrect a comment: since AccessArguments is now
Duncan Sands [Fri, 13 Feb 2009 17:36:13 +0000 (17:36 +0000)]
Correct a comment: since AccessArguments is now
being used for atomic intrinsics, it seems the
access may be volatile.  No code was exploiting
the original non-volatile definition, so only
the comment needs changing.

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

15 years agoIf a function only reads memory, then we know that...
Duncan Sands [Fri, 13 Feb 2009 17:32:26 +0000 (17:32 +0000)]
If a function only reads memory, then we know that...
it only reads memory!  The other change has no
functional effect, it just seems more logical to
go in order of decreasing knowledge.

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

15 years agoMark strto* as readonly when the endptr is null.
Nick Lewycky [Fri, 13 Feb 2009 17:08:33 +0000 (17:08 +0000)]
Mark strto* as readonly when the endptr is null.

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

15 years agoOn strtod and friends, mark 'endptr' nocapture in the function prototype, and
Nick Lewycky [Fri, 13 Feb 2009 15:31:46 +0000 (15:31 +0000)]
On strtod and friends, mark 'endptr' nocapture in the function prototype, and
mark the first argument nocapture if endptr=NULL for each particular call.

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

15 years agoReapply r64301. These uses of "inline" can cause strange
Duncan Sands [Fri, 13 Feb 2009 09:42:34 +0000 (09:42 +0000)]
Reapply r64301.  These uses of "inline" can cause strange
link-time failures when building with optimization.  Just
get rid of them.

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

15 years agoSwitch from new[] + delete[] to malloc + free since llvm does not catch C++ exceptions.
Evan Cheng [Fri, 13 Feb 2009 08:24:55 +0000 (08:24 +0000)]
Switch from new[] + delete[] to malloc + free since llvm does not catch C++ exceptions.

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

15 years agoIf new[] fails, return 0 rather then trying to dereference a null pointer.
Evan Cheng [Fri, 13 Feb 2009 07:54:34 +0000 (07:54 +0000)]
If new[] fails, return 0 rather then trying to dereference a null pointer.

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

15 years agoReapply r64300:
Nick Lewycky [Fri, 13 Feb 2009 07:15:53 +0000 (07:15 +0000)]
Reapply r64300:

Make sure the SCC pass manager initializes any contained
function pass managers.  Without this, simplify-libcalls
would add nocapture attributes when run on its own, but
not when run as part of -std-compile-opts or similar.

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

15 years agoBasicAA was making the assumption that a local allocation which hadn't escaped
Nick Lewycky [Fri, 13 Feb 2009 07:06:27 +0000 (07:06 +0000)]
BasicAA was making the assumption that a local allocation which hadn't escaped
couldn't ever be the return of call instruction. However, it's quite possible
that said local allocation is itself the return of a function call. That's
what malloc and calloc are for, actually.

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

15 years agoFix the code that checked if a SCEVAddRecExpr Start contains an
Dan Gohman [Fri, 13 Feb 2009 03:58:31 +0000 (03:58 +0000)]
Fix the code that checked if a SCEVAddRecExpr Start contains an
addrec in a different loop to check the value being added to
the accumulated Start value, not the Start value before it has
the new value added to it. This prevents LSR from going crazy
on the included testcase. Dale, please review.

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

15 years agoRemove non-DebugLoc versions of BuildMI.
Dale Johannesen [Fri, 13 Feb 2009 02:35:20 +0000 (02:35 +0000)]
Remove non-DebugLoc versions of BuildMI.
"I got blisters on my fingers."

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

15 years agoRemove non-DebugLoc versions of BuildMI from IA64, Mips.
Dale Johannesen [Fri, 13 Feb 2009 02:34:39 +0000 (02:34 +0000)]
Remove non-DebugLoc versions of BuildMI from IA64, Mips.

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

15 years agoRemove non-DebugLoc versions of BuildMI from X86.
Dale Johannesen [Fri, 13 Feb 2009 02:33:27 +0000 (02:33 +0000)]
Remove non-DebugLoc versions of BuildMI from X86.
There were some that might even matter in X86FastISel.

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