1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 20:12:56 +02:00
Commit Graph

5021 Commits

Author SHA1 Message Date
Bill Wendling
7fdda71ad7 Remove accidental check-ins in r65960. :-(
llvm-svn: 65961
2009-03-03 19:25:16 +00:00
Bill Wendling
8244b700bf Use > instead of >=. We want to promote aggregates of 128-bytes.
llvm-svn: 65960
2009-03-03 19:18:49 +00:00
Bill Wendling
a77bedb70b Reapply r65755, but reversing "<" to ">=".
llvm-svn: 65945
2009-03-03 12:12:58 +00:00
Dan Gohman
51d4e8db6a Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.

llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Dale Johannesen
d4a205b300 Don't count DebugInfo instructions in another limit
(lest they affect codegen).

llvm-svn: 65915
2009-03-03 01:43:03 +00:00
Dale Johannesen
33fa9dc8a9 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).

llvm-svn: 65910
2009-03-03 01:09:07 +00:00
Devang Patel
b69b449ce8 Ignore debug info intrinsics.
llvm-svn: 65908
2009-03-03 00:28:44 +00:00
Devang Patel
e98e6bc27c 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.
llvm-svn: 65902
2009-03-02 23:39:14 +00:00
Devang Patel
5220700e0d Remove all dbg symobls, including those with circular references.
This is ugly, but I can't figure out a quick way out of this.

llvm-svn: 65889
2009-03-02 22:50:58 +00:00
Duncan Sands
51ce06c788 Fix PR3694: add an instcombine micro-optimization that helps
clean up when using variable length arrays in llvm-gcc.

llvm-svn: 65832
2009-03-02 09:18:21 +00:00
Bill Wendling
0dd6d44518 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.

llvm-svn: 65758
2009-03-01 03:55:12 +00:00
Chris Lattner
7228db7662 hoist the check for alloca size up so that it controls CanConvertToScalar
as well as isSafeAllocaToScalarRepl.

llvm-svn: 65755
2009-03-01 02:26:47 +00:00
Nick Lewycky
44b8675102 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.

llvm-svn: 65621
2009-02-27 06:37:39 +00:00
Nick Lewycky
f5563f28d3 Fix compiler warning about uninitialized variables. No functional change.
llvm-svn: 65620
2009-02-27 06:29:31 +00:00
Zhou Sheng
670d50e102 Ignore dbg info intrinsics when folding conditional branch to
conditional branch predecessors.

llvm-svn: 65509
2009-02-26 06:56:37 +00:00
Chris Lattner
1443cb8f77 Fix PR3667
llvm-svn: 65464
2009-02-25 18:20:01 +00:00
Zhou Sheng
241d74737b Don't block basic block with only SwitchInst to fold into predecessors.
llvm-svn: 65456
2009-02-25 15:34:27 +00:00
Dan Gohman
dd9c79d45b 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.

llvm-svn: 65382
2009-02-24 18:55:53 +00:00
Dan Gohman
1197d46ccf 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.

llvm-svn: 65364
2009-02-24 02:00:40 +00:00
Dan Gohman
f5bb2d8747 Generalize the ChangeCompareStride code, in preparation for
handling non-constant strides. No functionality change.

llvm-svn: 65363
2009-02-24 01:58:00 +00:00
Dan Gohman
3a3b51162b Preserve the DominanceFrontier analysis in the LoopDeletion pass.
llvm-svn: 65359
2009-02-24 01:21:53 +00:00
Devang Patel
702836b2dd 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

llvm-svn: 65353
2009-02-24 00:05:16 +00:00
Dan Gohman
1d93a1d2cb 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.

llvm-svn: 65347
2009-02-23 23:20:35 +00:00
Dan Gohman
f7d0d6fe22 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.

llvm-svn: 65323
2009-02-23 17:10:29 +00:00
Dan Gohman
67530bbc77 IndVarSimplify preserves ScalarEvolution. In the
-std-compile-opts sequence, this avoids the need for ScalarEvolution to
be rerun before LoopDeletion.

llvm-svn: 65318
2009-02-23 16:29:41 +00:00
Zhou Sheng
d3008c8b1c Should reset DBI_Prev if DBI_Next == 0.
llvm-svn: 65314
2009-02-23 10:14:11 +00:00
Mon P Wang
75d957dba4 Changed option name from inline-threshold to basic-inline-threshold because
inline-threshold option is used by the inliner.

llvm-svn: 65309
2009-02-23 07:07:56 +00:00
Chris Lattner
29437eb4c3 fix some typos that Duncan noticed
llvm-svn: 65306
2009-02-23 05:56:17 +00:00
Dan Gohman
b105ab4e42 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.

llvm-svn: 65289
2009-02-22 18:06:32 +00:00
Dan Gohman
a78fb41553 Properly parenthesize this expression, fixing a real bug in the new
-full-lsr code, as well as a GCC warning.

llvm-svn: 65288
2009-02-22 16:40:52 +00:00
Evan Cheng
ba3f6fa814 Only try to sink immediate when TLI is not null. It needs to check if immediate would fit in target addressing field.
llvm-svn: 65268
2009-02-22 07:31:19 +00:00
Nick Lewycky
2c8f0fd57f Don't sign extend the char when expanding char -> int during
load(bitcast(char[4] to i32*)) evaluation.

llvm-svn: 65246
2009-02-21 20:50:42 +00:00
Evan Cheng
74d0dda00f Add AddrModeMatcher.cpp
llvm-svn: 65228
2009-02-21 07:05:11 +00:00
Evan Cheng
56b43045f6 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.
llvm-svn: 65215
2009-02-21 02:06:47 +00:00
Chris Lattner
3adae91c70 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.

llvm-svn: 65209
2009-02-21 00:46:50 +00:00
Evan Cheng
c2541a4450 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.

llvm-svn: 65178
2009-02-20 22:16:49 +00:00
Dan Gohman
b8783d240b Simplify code and reduce indentation. No functionality change.
llvm-svn: 65167
2009-02-20 21:27:23 +00:00
Dan Gohman
4612c1d92f Fix 80-column violations.
llvm-svn: 65159
2009-02-20 21:06:57 +00:00
Dan Gohman
33c5714553 It's not necessary to check if Base is null here.
llvm-svn: 65157
2009-02-20 21:05:23 +00:00
Dan Gohman
271a6f1142 Add a comment about how Imm can be used for loop-variant values.
llvm-svn: 65147
2009-02-20 20:29:04 +00:00
Evan Cheng
d8aad94754 Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
llvm-svn: 65134
2009-02-20 18:24:38 +00:00
Zhou Sheng
0c2e862ad0 Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.

llvm-svn: 65126
2009-02-20 17:49:33 +00:00
Zhou Sheng
580c176f47 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.

llvm-svn: 65123
2009-02-20 16:31:35 +00:00
Dan Gohman
4e8fc41d48 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.

llvm-svn: 65108
2009-02-20 04:17:46 +00:00
Dan Gohman
eb7aa11e26 Use DEBUG() instead of passing *DOUT to WriteAsOperand,
since the latter just passes a null reference when
debugging is not enabled.

llvm-svn: 65060
2009-02-19 19:32:06 +00:00
Dan Gohman
9c41f5e046 Make the debug output of LSR less cryptic and more informative.
llvm-svn: 65057
2009-02-19 19:23:27 +00:00
Duncan Sands
d1fef83598 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.

llvm-svn: 64926
2009-02-18 17:55:38 +00:00
Dan Gohman
451474da4a 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.

llvm-svn: 64918
2009-02-18 17:22:41 +00:00
Dan Gohman
5530918aff Simplify by using dyn_cast instead of isa and cast.
llvm-svn: 64917
2009-02-18 16:54:33 +00:00
Dan Gohman
30770ee7b3 Add explicit keywords.
llvm-svn: 64915
2009-02-18 16:37:45 +00:00