1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 20:43:44 +02:00
Commit Graph

46484 Commits

Author SHA1 Message Date
Evan Cheng
c7f7276825 Teach TransferDeadness to delete truly dead instructions if they do not produce side effects.
llvm-svn: 71606
2009-05-12 23:07:00 +00:00
Dale Johannesen
edbd4d5c4c Slightly improve generated code in a degenerate case.
Should remove a warning from MSVC.

llvm-svn: 71603
2009-05-12 22:32:29 +00:00
Jim Grosbach
4861b683a8 correct register class for tADDspi to GPR since the register will always be SP
llvm-svn: 71602
2009-05-12 22:30:18 +00:00
Bill Wendling
a6f172b0f2 More MSVC fixes -- class/struct conflicts.
llvm-svn: 71601
2009-05-12 21:55:29 +00:00
Bill Wendling
4698f862f3 Use struct instead of class to make MCVS compile.
llvm-svn: 71600
2009-05-12 21:50:43 +00:00
John Mosby
618e3e6578 Restructure PEI code:
- moved shrink wrapping code from PrologEpilogInserter.cpp to
  new file ShrinkWrapping.cpp.

- moved PEI pass definition into new shared header PEI.h.

llvm-svn: 71588
2009-05-12 20:33:29 +00:00
Jay Foad
a4531bdfe8 Switch to using IRBuilder throughout.
llvm-svn: 71587
2009-05-12 20:27:44 +00:00
Evan Cheng
7f78e63cf3 80 col violations.
llvm-svn: 71582
2009-05-12 20:17:52 +00:00
Evan Cheng
b0a4c44103 Add nounwind.
llvm-svn: 71575
2009-05-12 18:35:43 +00:00
Evan Cheng
d6e3e4d746 Fixed a stack slot coloring with reg bug: do not update implicit use / def when doing forward / backward propagation.
llvm-svn: 71574
2009-05-12 18:31:57 +00:00
Bill Wendling
562178b9a4 Use llvm::raw_stream instead of llvm::Streams.
llvm-svn: 71573
2009-05-12 18:29:42 +00:00
Bob Wilson
5a9381d75f Fix up a few minor typos in comments.
llvm-svn: 71563
2009-05-12 17:35:29 +00:00
Bob Wilson
de6e2f9bf0 Fix 80-col violations and remove trailing whitespace. No functional changes.
llvm-svn: 71562
2009-05-12 17:09:30 +00:00
Dan Gohman
1de5ac9269 Clarify a comment.
llvm-svn: 71561
2009-05-12 17:08:34 +00:00
Sanjiv Gupta
b1a0a4a7f5 Iterate over globals once and sectionize them into appropriate sections.
Later in asmprinter, go over thsese sections and print them.
Do not print empty sections.

llvm-svn: 71560
2009-05-12 17:07:27 +00:00
Daniel Dunbar
353db71295 Allow client Makefiles control over whether they want -pedantic by
defining NO_PEDANTIC.
  - Pedantic C89 is a painful language...

llvm-svn: 71545
2009-05-12 07:26:49 +00:00
Sanjiv Gupta
ead0ba2ea0 We do not need to create a label for external defs and decls,
just emit a comment for readability.

llvm-svn: 71544
2009-05-12 06:52:41 +00:00
Daniel Dunbar
0d350a6e69 Refactor dependency generation for .ll files.
- This matches the normal dependency generation code.

 - This also fixes the problem that when building a normal and bitcode
   archive from the same source, the dependency files would overwrite
   one another. Which was bad.

llvm-svn: 71542
2009-05-12 06:35:50 +00:00
Daniel Dunbar
f9f96f1ce1 Remove obsolete Makefile magic for calling llvm-upgrade
llvm-svn: 71540
2009-05-12 05:49:22 +00:00
Daniel Dunbar
92d38f05bc Install bytecode libraries with a .bca suffix, otherwise it isn't
possible to build both a .a and a .bca.
 - My understanding is no one else is using this stuff, please let me
   know if I am wrong.

llvm-svn: 71539
2009-05-12 05:35:40 +00:00
Sanjiv Gupta
e60e9f8c0b Mark mayLoad, mayStore for insns correctly and use them
to check if an insn is accessing memory during mem sel optimization.

llvm-svn: 71537
2009-05-12 04:30:38 +00:00
Bob Wilson
16f684a429 Fix pr4195: When iterating through predecessor blocks, break out of the loop
after finding the (unique) layout predecessor.  Sometimes a block may be listed
more than once, and processing it more than once in this loop can lead to
inconsistent values for FtTBB/FtFBB, since the AnalyzeBranch method does not
clear these values.  There's no point in continuing the loop regardless.
The testcase for this is reduced from the 2003-05-02-DependentPHI SingleSource
test.

llvm-svn: 71536
2009-05-12 03:48:10 +00:00
Dan Gohman
d13f674130 Factor the code for collecting IV users out of LSR into an IVUsers class,
and generalize it so that it can be used by IndVarSimplify. Implement the
base IndVarSimplify transformation code using IVUsers. This removes
TestOrigIVForWrap and associated code, as ScalarEvolution now has enough
builtin overflow detection and folding logic to handle all the same cases,
and more. Run "opt -iv-users -analyze -disable-output" on your favorite
loop for an example of what IVUsers does.

This lets IndVarSimplify eliminate IV casts and compute trip counts in
more cases. Also, this happens to finally fix the remaining testcases
in PR1301.

Now that IndVarSimplify is being more aggressive, it occasionally runs
into the problem where ScalarEvolutionExpander's code for avoiding
duplicate expansions makes it difficult to ensure that all expanded
instructions dominate all the instructions that will use them. As a
temporary measure, IndVarSimplify now uses a FixUsesBeforeDefs function
to fix up instructions inserted by SCEVExpander. Fortunately, this code
is contained, and can be easily removed once a more comprehensive
solution is available.

llvm-svn: 71535
2009-05-12 02:17:14 +00:00
Dan Gohman
cac9b5c5be When forgetting SCEVs for loop PHIs, don't forget SCEVUnknown values.
These values aren't analyzable, so they don't care if more information
about the loop trip count can be had. Also, SCEVUnknown is used for
a PHI while the PHI itself is being analyzed, so it needs to be left
in the Scalars map. This fixes a variety of subtle issues.

llvm-svn: 71533
2009-05-12 01:27:58 +00:00
Dan Gohman
e55d6c4c8a Fix GetMinTrailingZeros for SCEVSignExtend and SCEVZeroExtendExpr to
return the correct value when the cast operand is all zeros. This ought
to be pretty rare, because it would mean that the regular SCEV folding
routines missed a case, though there are cases they might legitimately
miss. Also, it's unlikely anything currently using GetMinTrailingZeros
cares about this case.

llvm-svn: 71532
2009-05-12 01:23:18 +00:00
Evan Cheng
96cd1decc6 Avoid unneeded SIB byte encoding. Patch by Zoltan Varga.
llvm-svn: 71520
2009-05-12 00:07:35 +00:00
Bill Wendling
dd997304e8 - Record that the debug info is actually used so that the label folder doesn't
blast it away.
- Move InlineInfo bookkeeping to bookkeep the correct debug info object.

llvm-svn: 71519
2009-05-12 00:06:59 +00:00
Lang Hames
c577f429c0 Fixed PR4090.
llvm-svn: 71495
2009-05-11 23:14:13 +00:00
Evan Cheng
9b27f3ec42 Teach LSR to optimize more loop exit compares, i.e. change them to use postinc iv value. Previously LSR would only optimize those which are in the loop latch block. However, if LSR can prove it is safe (and profitable), it's now possible to change those not in the latch blocks to use postinc values.
Also, if the compare is the only use, LSR would place the iv increment instruction before the compare instead in the latch.

llvm-svn: 71485
2009-05-11 22:33:01 +00:00
Mike Stump
6ee41e64c8 Add DW_AT_APPLE_isa and DW_AT_APPLE_block. Radar 6867696
llvm-svn: 71479
2009-05-11 21:58:01 +00:00
Dale Johannesen
dd32623987 Fix PR4188. TailMerging can't tolerate inexact
sucessor info.

llvm-svn: 71478
2009-05-11 21:54:13 +00:00
Evan Cheng
645351d3a8 Apply patch review feedback.
llvm-svn: 71472
2009-05-11 20:53:52 +00:00
Jay Foad
2842dd918b Don't #include DerivedTypes.h from TargetData.h.
llvm-svn: 71468
2009-05-11 19:38:09 +00:00
Dan Gohman
e00e346c08 Add a comment about the special meaning of VoidTy in this context.
llvm-svn: 71466
2009-05-11 19:11:53 +00:00
Dan Gohman
2060db5db5 Fix two wording errors that Duncan spotted.
llvm-svn: 71459
2009-05-11 18:51:16 +00:00
Dan Gohman
25ab4c185c Make this grep line a little more specific so that it doesn't
accidentally match something unrelated.

llvm-svn: 71458
2009-05-11 18:49:56 +00:00
Evan Cheng
dad97e1bfc Unbreak non-debug build.
llvm-svn: 71457
2009-05-11 18:40:52 +00:00
Evan Cheng
7c7809eebd Eliminate a compiler warning.
llvm-svn: 71456
2009-05-11 18:40:35 +00:00
Dan Gohman
dfa39efe6d When scalarizing a vector BITCAST, check whether the operand has vector
type, rather than assume that it does. If the operand is not vector, it
shouldn't be run through ScalarizeVectorOp. This fixes one of the
testcases in PR3886.

llvm-svn: 71453
2009-05-11 18:30:42 +00:00
Dan Gohman
361dcef406 LLVM has unaligned loads and stores now.
llvm-svn: 71449
2009-05-11 18:06:05 +00:00
Douglas Gregor
26745696ef Add terminal width detection to llvm::sys::Process. This is needed to
fix Clang PRs 4148 and 4183.

llvm-svn: 71448
2009-05-11 18:05:52 +00:00
Dan Gohman
d365c7a5a3 Upgrade this example to new-style syntax.
llvm-svn: 71447
2009-05-11 18:04:52 +00:00
Dan Gohman
0edabc8a6f Convert a subtract into a negate and an add when it helps x86
address folding.

llvm-svn: 71446
2009-05-11 18:02:53 +00:00
Chris Lattner
f5f153394d remove some done things: we have nocapture and SROA is smarter.
llvm-svn: 71443
2009-05-11 17:41:40 +00:00
Chris Lattner
d50058b0c0 add a note
llvm-svn: 71442
2009-05-11 17:36:33 +00:00
Dale Johannesen
f86e34065b Reverse a loop that is counting up to a maximum to
count down to 0 instead, under very restricted
circumstances.  Adjust 4 testcases in which this
optimization fires.

llvm-svn: 71439
2009-05-11 17:15:42 +00:00
John Mosby
366006cfd3 Shrink wrapping in PEI:
- reduces _static_ callee saved register spills
  and restores similar to Chow's original algorithm.
- iterative implementation with simple heuristic
  limits to mitigate compile time impact.
- handles placing spills/restores for multi-entry,
  multi-exit regions in the Machine CFG without
  splitting edges.
- passes test-suite in LLCBETA mode.

Added contains() method to ADT/SparseBitVector.

llvm-svn: 71438
2009-05-11 17:04:19 +00:00
Jay Foad
5827394cd0 Don't generate redundant casts of constant values when lowering calls to
memcpy, memmove and memset.

llvm-svn: 71427
2009-05-11 11:32:25 +00:00
Jay Foad
d8149f17c2 Change TargetData::getIntPtrType() to return an IntegerType instead of
just a Type.

llvm-svn: 71426
2009-05-11 11:13:47 +00:00
Sanjiv Gupta
264cfd0017 Fix more naming issues.
compiler libcalls start with .lib. now.
fixed section names.

llvm-svn: 71424
2009-05-11 08:52:04 +00:00