Commit Graph

27300 Commits

Author SHA1 Message Date
Scott Michel
fdc40a0a69 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
2009-02-17 22:15:04 +00:00
Devang Patel
36375ee7a5 Emit debug info for bitfields.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 21:23:59 +00:00
Dan Gohman
97b6e2cc99 LoopIndexSplit doesn't actually use ScalarEvolution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 20:50:11 +00:00
Dan Gohman
60f8a63e25 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
2009-02-17 20:49:49 +00:00
Chris Lattner
a84f47c3e7 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
2009-02-17 20:47:23 +00:00
Dan Gohman
189c6357a1 Move dumpPassStructure out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 19:41:26 +00:00
Dan Gohman
cafb81337b Delete trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64784 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 19:13:57 +00:00
Duncan Sands
7ae5b9e1eb This transform also applies to private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 17:50:04 +00:00
Dan Gohman
a575871884 Fix 80-column violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 15:57:39 +00:00
Evan Cheng
bf18939180 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
2009-02-17 06:41:03 +00:00
Chris Lattner
a66878b881 add a horrible note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64719 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 01:16:14 +00:00
Bill Wendling
86e6cb924b --- 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
2009-02-17 01:04:54 +00:00
Evan Cheng
5a6c1a840a 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
2009-02-17 00:13:06 +00:00
Dan Gohman
1a5e936c53 Simplify; fix some 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 00:10:53 +00:00
Dan Gohman
9fbb52db98 Delete trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 23:14:14 +00:00
Dan Gohman
ecd0fb51cb 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
2009-02-16 23:02:21 +00:00
Nick Lewycky
586a7c4a37 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
2009-02-16 04:26:53 +00:00
Dan Gohman
ebcd4af387 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
2009-02-16 02:57:42 +00:00
Dan Gohman
926b0a27b9 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
2009-02-16 00:44:23 +00:00
Dan Gohman
97d116346c 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
2009-02-15 23:59:32 +00:00
Dan Gohman
35188eb54d MachineLICM now handles these cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 23:24:52 +00:00
Nick Lewycky
225f747486 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
2009-02-15 22:47:25 +00:00
Nicolas Geoffray
42cc8f140a 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
2009-02-15 20:49:23 +00:00
Duncan Sands
a37d119f63 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
2009-02-15 11:54:49 +00:00
Duncan Sands
4782b305c2 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
2009-02-15 09:56:08 +00:00
Evan Cheng
b599979ab5 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
2009-02-15 08:36:12 +00:00
Evan Cheng
8f40afe62d 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
2009-02-15 06:06:15 +00:00
Evan Cheng
f8546f10c2 ifdef out unneeded if statement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64575 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 03:20:37 +00:00
Mikhail Glushenkov
8eada627d5 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
2009-02-15 03:20:32 +00:00
Mikhail Glushenkov
b8863a16ad Whitespace fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15 03:20:03 +00:00
Cedric Venet
aff9c270de 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
2009-02-14 16:06:42 +00:00
Duncan Sands
d869b3847f 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
2009-02-14 10:56:35 +00:00
Dan Gohman
b5aa3ad1e7 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
2009-02-14 03:30:05 +00:00
Dan Gohman
aa03649af2 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
2009-02-14 02:31:09 +00:00
Dan Gohman
f108e2eaaa Clarify debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 02:26:50 +00:00
Dan Gohman
cd3eb9b098 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
2009-02-14 02:25:19 +00:00
Evan Cheng
c7ce29b04f Teach x86 target -soft-float.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 22:36:38 +00:00
Dan Gohman
03ce042d70 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
2009-02-13 17:45:12 +00:00
Dan Gohman
e698696569 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
2009-02-13 17:36:42 +00:00
Duncan Sands
ddd8c450ec 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
2009-02-13 17:32:26 +00:00
Nick Lewycky
02b6a6a75f 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
2009-02-13 17:08:33 +00:00
Nick Lewycky
4c49841f34 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
2009-02-13 15:31:46 +00:00
Duncan Sands
e70a6835c4 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
2009-02-13 09:42:34 +00:00
Evan Cheng
e2b3fdd649 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
2009-02-13 08:24:55 +00:00
Evan Cheng
726135ad1a 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
2009-02-13 07:54:34 +00:00
Nick Lewycky
8968a07768 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
2009-02-13 07:15:53 +00:00
Nick Lewycky
826f7cebfd 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
2009-02-13 07:06:27 +00:00
Dan Gohman
9194e8b0c8 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
2009-02-13 03:58:31 +00:00
Dale Johannesen
948175785d 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
2009-02-13 02:34:39 +00:00
Dale Johannesen
8d13f8f104 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
2009-02-13 02:33:27 +00:00