Commit Graph

5029 Commits

Author SHA1 Message Date
Chris Lattner
1541e0f7da Fix PR3720 by properly propagating alignment information from memcpy/memmove
onto element accesses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 19:20:50 +00:00
Dale Johannesen
0744f09efc Revert unintended commmit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:09:48 +00:00
Dale Johannesen
d9c05d7711 Skip ptr-to-ptr bitcasts when counting in another case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:06:53 +00:00
Dale Johannesen
cdb16aa5ab Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion.  Slightly faster.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:53:05 +00:00
Devang Patel
7f6179d1d8 If a global constant is dead then global's debug info should not prevent the optimizer in deleting the global. And while deleting global, delete global's debug info also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:22:23 +00:00
Dale Johannesen
0d6596b7bf Make my earlier patch to skip debug intrinsics
when counting work; it was only off by 1.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65993 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:20:34 +00:00
Dale Johannesen
127a7936de Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead.  Fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 23:30:00 +00:00
Dale Johannesen
4ded40a44d Instruction counters must skip the bitcasts that
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 22:36:47 +00:00
Devang Patel
9adb01cbc3 Recursively remove dead argument while removing llvm.dbg.declare intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 21:31:02 +00:00
Dale Johannesen
4945c65784 When removing a store to an alloca that has only one
use, check also for the case where it has two uses,
the other being a llvm.dbg.declare.  This is needed so
debug info doesn't affect codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 21:26:39 +00:00
Bill Wendling
1c85503e38 Remove accidental check-ins in r65960. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:25:16 +00:00
Bill Wendling
3aaf5d9933 Use > instead of >=. We want to promote aggregates of 128-bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:18:49 +00:00
Bill Wendling
5a377cb27b Reapply r65755, but reversing "<" to ">=".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 12:12:58 +00:00
Dan Gohman
0f8b53f19d Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 02:55:14 +00:00
Dale Johannesen
acb51a3037 Don't count DebugInfo instructions in another limit
(lest they affect codegen).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 01:43:03 +00:00
Dale Johannesen
bd8e650876 When sinking an insn in InstCombine bring its debug
info with it.
Don't count debug info insns against the scan maximum
in FindAvailableLoadedValue (lest they affect codegen).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 01:09:07 +00:00
Devang Patel
cd11991203 Ignore debug info intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 00:28:44 +00:00
Devang Patel
cf42ee42b1 If branch conditions' one successor is dominating another non-latch successor then this loop's iteration space can not be restricted. In this example block bb5 is always executed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65902 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 23:39:14 +00:00
Devang Patel
73df3c9721 Remove all dbg symobls, including those with circular references.
This is ugly, but I can't figure out a quick way out of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65889 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 22:50:58 +00:00
Duncan Sands
5b7cfb02f7 Fix PR3694: add an instcombine micro-optimization that helps
clean up when using variable length arrays in llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65832 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02 09:18:21 +00:00
Bill Wendling
8fe40819ae Temporarily revert r65755. It was causing failures in the self-hosting
testsuite:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/nancvt.ll
Failed with exit(1) at line 2
while running: grep 2147027116 nancvt.ll.tmp | count 3
count: expected 3 lines and got        0.
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll
Failed with exit(1) at line 1
while running:  llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/CodeGen/X86/vec_ins_extract.ll |  opt -scalarrepl -instcombine |   llc -march=x86 -mcpu=yonah | not /usr/bin/grep sub.*esp
      subl      $28, %esp
      subl      $28, %esp
child process exited abnormally

And more.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 03:55:12 +00:00
Chris Lattner
af89a3f1d3 hoist the check for alloca size up so that it controls CanConvertToScalar
as well as isSafeAllocaToScalarRepl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 02:26:47 +00:00
Nick Lewycky
579214a39a Silence compiler warning about use of uninitialized variables (in reality these
are always set by reference on the path that uses them.) No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 06:37:39 +00:00
Nick Lewycky
7569af769e Fix compiler warning about uninitialized variables. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 06:29:31 +00:00
Zhou Sheng
a8d57fe96b Ignore dbg info intrinsics when folding conditional branch to
conditional branch predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 06:56:37 +00:00
Chris Lattner
58b1ac76d4 Fix PR3667
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 18:20:01 +00:00
Zhou Sheng
9a7c743fc0 Don't block basic block with only SwitchInst to fold into predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 15:34:27 +00:00
Dan Gohman
46bdfb0e6b Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,
to more accurately describe what it does. Expand its doxygen comment
to describe what the backedge-taken count is and how it differs
from the actual iteration count of the loop. Adjust names and
comments in associated code accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65382 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 18:55:53 +00:00
Dan Gohman
0001e56f15 Fix a ValueTracking rule: RHS means operand 1, not 0. Add a simple
ashr instcombine to help expose this code. And apply the fix to
SelectionDAG's copy of this code too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 02:00:40 +00:00
Dan Gohman
c34fea3935 Generalize the ChangeCompareStride code, in preparation for
handling non-constant strides. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 01:58:00 +00:00
Dan Gohman
d0a90b9876 Preserve the DominanceFrontier analysis in the LoopDeletion pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 01:21:53 +00:00
Devang Patel
5622f07a21 While folding unconditional return move DbgRegionEndInst into the predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite.
gcc.c-torture/execute/20000605-3.c
gcc.c-torture/execute/20020619-1.c
gcc.c-torture/execute/20030920-1.c
gcc.c-torture/execute/loop-ivopts-1.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 00:05:16 +00:00
Dan Gohman
15cab2817b Back out the change in 64918 that used sign-extensions when promoting
trip counts that use signed comparisons. It's not obviously the best
approach for preserving trip count information, and at any rate there
isn't anything in the tree right now that makes use of that, so for
now always using zero-extensions is preferable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 23:20:35 +00:00
Dan Gohman
e2abdd3ff0 LoopDeletion needs to inform ScalarEvolution when a loop is deleted,
so that ScalarEvolution doesn't hang onto a dangling Loop*, which
could be a problem if another Loop happens to get allocated at the
same address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 17:10:29 +00:00
Dan Gohman
474cecf0e9 IndVarSimplify preserves ScalarEvolution. In the
-std-compile-opts sequence, this avoids the need for ScalarEvolution to
be rerun before LoopDeletion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 16:29:41 +00:00
Zhou Sheng
8313ef42b7 Should reset DBI_Prev if DBI_Next == 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65314 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 10:14:11 +00:00
Mon P Wang
b0000c376c Changed option name from inline-threshold to basic-inline-threshold because
inline-threshold option is used by the inliner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 07:07:56 +00:00
Chris Lattner
2155088e8c fix some typos that Duncan noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 05:56:17 +00:00
Dan Gohman
bc989d462d Revert the part of 64623 that attempted to align the source in a
memcpy to match the alignment of the destination. It isn't necessary
for making loads and stores handled like the SSE loadu/storeu
intrinsics, and it was causing a performance regression in
MultiSource/Applications/JM/lencod.

The problem appears to have been a memcpy that copies from some
highly aligned array into an alloca; the alloca was then being
assigned a large alignment, which required codegen to perform
dynamic stack-pointer re-alignment, which forced the enclosing
function to have a frame pointer, which led to increased spilling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22 18:06:32 +00:00
Dan Gohman
a04af4380d Properly parenthesize this expression, fixing a real bug in the new
-full-lsr code, as well as a GCC warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22 16:40:52 +00:00
Evan Cheng
3cd389de39 Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-22 07:31:19 +00:00
Nick Lewycky
2ec0dbf961 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
2009-02-21 20:50:42 +00:00
Evan Cheng
b0ea08066c Add AddrModeMatcher.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 07:05:11 +00:00
Evan Cheng
d9fb712403 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
2009-02-21 02:06:47 +00:00
Chris Lattner
36d3e326df 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
2009-02-21 00:46:50 +00:00
Evan Cheng
d33cec18a9 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
2009-02-20 22:16:49 +00:00
Dan Gohman
ff518c86f7 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
2009-02-20 21:27:23 +00:00
Dan Gohman
6b38e29f13 Fix 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:06:57 +00:00
Dan Gohman
f0baa6e9cb 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
2009-02-20 21:05:23 +00:00
Dan Gohman
33e3a36f0a 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
2009-02-20 20:29:04 +00:00