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

46751 Commits

Author SHA1 Message Date
Eli Friedman
2080604056 Eliminate more special cases for opcodes.
llvm-svn: 72464
2009-05-27 07:05:37 +00:00
Eli Friedman
12fa5c7acf Remove more special cases from LegalizeDAG.
llvm-svn: 72456
2009-05-27 03:33:44 +00:00
Eli Friedman
9a7c584e6a Remove unused argument.
llvm-svn: 72455
2009-05-27 02:21:29 +00:00
Eli Friedman
a6ff2e5bce Remove more opcode special cases.
llvm-svn: 72454
2009-05-27 02:16:40 +00:00
Dan Gohman
491de1fe7e Add braces around an array initializer.
llvm-svn: 72453
2009-05-27 02:07:15 +00:00
Dan Gohman
0124c21ba0 Teach SCEVExpander to avoid creating over-indexed GEP indices when
possible. For example, it now emits

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1

instead of the equivalent but less obvious

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19

llvm-svn: 72452
2009-05-27 02:00:53 +00:00
Dan Gohman
5dd6f54a5f Teach BasicAliasAnalysis to understand constant gep indices that fall
beyond their associated static array type.

I believe that this fixes a legitimate bug, because BasicAliasAnalysis
already has code to check for this condition that works for non-constant
indices, however it was missing the case of constant indices. With this
change, it checks for both.

This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href.

llvm-svn: 72451
2009-05-27 01:48:27 +00:00
Eli Friedman
3af054adb7 Start of refactoring LegalizeDAG so that we don't need specialized
handling for every single opcode.

llvm-svn: 72447
2009-05-27 01:25:56 +00:00
Eli Friedman
b8c9f7ee35 Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on.  Updated 
from the previous version (r72431) to fix a bug and make some things a 
bit clearer.

llvm-svn: 72445
2009-05-27 00:47:34 +00:00
Dale Johannesen
02649aa161 Testcase for (llvm-gcc-4.2) 72442 (PR 4242).
llvm-svn: 72443
2009-05-26 23:19:19 +00:00
Daniel Dunbar
75f52bda74 Back out r72431, it is causing a number of compilation crashes with clang.
llvm-svn: 72436
2009-05-26 21:27:02 +00:00
Stefanus Du Toit
031dcf315f Update CPU capabilities for AMD machines
- added processors k8-sse3, opteron-sse3, athlon64-sse3, amdfam10, and
barcelona with appropriate sse3/4a levels
- added FeatureSSE4A for amdfam10 processors
in X86Subtarget:
- added hasSSE4A
- updated AutoDetectSubtargetFeatures to detect SSE4A
- updated GetCurrentX86CPU to detect family 15 with sse3 as k8-sse3 and
family 10h as amdfam10

New processor names match those used by gcc.

Patch by Paul Redmond!

llvm-svn: 72434
2009-05-26 21:04:35 +00:00
Eli Friedman
f7d0c01ed6 Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on. 

llvm-svn: 72431
2009-05-26 19:18:56 +00:00
Torok Edwin
1eb7bb1f05 For the new ar --plugin libLLVMgold.so to work we need libLTO linked with
pthreads, otherwise ar complains of unresolved references to pthread_mutex_*.
LTO doesn't actually use pthreads, but ManagedStatic does.

Fix this by linking in LIBS (that contains pthreads) for LTO and gold.
For now this links in more libs than needed (libffi for example), we can figure
out later how to link in those libs per-tool later.

llvm-svn: 72430
2009-05-26 19:11:47 +00:00
Jeffrey Yasskin
14f27c22aa LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
entries as there are basic blocks in the function.  LiveVariables::getVarInfo
creates a VarInfo struct for every register in the function, leading to
quadratic space use.  This patch changes the BitVector to a SparseBitVector,
which doesn't help the worst-case memory use but does reduce the actual use in
very long functions with short-lived variables.

llvm-svn: 72426
2009-05-26 18:27:15 +00:00
Dan Gohman
5003d0ee42 For the return type of SCEVUDivExpr, use the RHS' type instead of
that of the LHS. It doesn't matter for correctness, but the LHS
is more likely than the RHS to be a pointer type in exotic cases,
and it's more tidy to have it return the integer type.

llvm-svn: 72424
2009-05-26 17:44:05 +00:00
Dan Gohman
c1ef7f9059 Give SCEVNaryExpr a doxygen comment.
llvm-svn: 72423
2009-05-26 17:42:32 +00:00
Dan Gohman
fb34a67498 In cases where a pointer value is an operand of a multiplication or
division operation, don't attempt to use the operation's value as
the base of a getelementptr. This fixes PR4271.

llvm-svn: 72422
2009-05-26 17:41:16 +00:00
Eli Friedman
cda5677720 Delete a bunch of dead code from LegalizeDAG.
llvm-svn: 72414
2009-05-26 08:55:52 +00:00
Evan Cheng
28673c9554 Eliminate VarInfo::UsedBlocks.
llvm-svn: 72411
2009-05-26 06:25:46 +00:00
Chris Lattner
8f4210d099 make memdep use the getModRefInfo method for stores instead of the
low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory.  PR4189

llvm-svn: 72403
2009-05-25 21:28:56 +00:00
Nick Lewycky
1637afae75 Audit the type constructors. Previously it was possible to create [0 x void]
or use labels as members of structures for example. Also included a couple of
whitespace fixes.

llvm-svn: 72402
2009-05-25 21:28:11 +00:00
Chris Lattner
636bd70540 add some late optimizations that GCC does. It thinks these are a win
even on Core2, not just AMD processors which was a surprise to me.

llvm-svn: 72396
2009-05-25 20:28:19 +00:00
Chris Lattner
10cac1a776 fix typo
llvm-svn: 72395
2009-05-25 19:51:07 +00:00
Chris Lattner
60098b3e93 we should eventually add -march=atom and the new atom movbe instruction.
llvm-svn: 72387
2009-05-25 16:34:44 +00:00
Nick Lewycky
c1dbf95623 Fix the crash debugger to actually bisect globals once it's determined that it
can't just eliminate all global initializers.

llvm-svn: 72378
2009-05-25 06:29:56 +00:00
Nick Lewycky
dc75efd40a Add a bisection step on the list of instructions before doing the linear
simplification. It's not clear to me whether this can replace the first of the
linear instruction simplification stages or not, so I left it in.

llvm-svn: 72377
2009-05-25 05:30:00 +00:00
Dan Gohman
621071c6c4 Various comment fixes.
llvm-svn: 72376
2009-05-24 23:45:28 +00:00
Dan Gohman
19be1fa810 Change ScalarEvolution::getSCEVAtScope to always return the original value
in the case where a loop exit value cannot be computed, instead of only in
some cases while using SCEVCouldNotCompute in others. This simplifies
getSCEVAtScope's callers.

llvm-svn: 72375
2009-05-24 23:25:42 +00:00
Eli Friedman
50affb11af Add a comment which should hopefully make the purpose of this method a
bit clearer.

llvm-svn: 72374
2009-05-24 20:32:10 +00:00
Eli Friedman
abde12d79b Minor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the
corresponding integer type is legal.

llvm-svn: 72373
2009-05-24 20:29:11 +00:00
Torok Edwin
5854389857 Move Rewriter.clear() earlier, to avoid triggerring the AssertingVH by
one of the RecursivelyDeleteTriviallyDeadInstructions.
Add a comment explaining why the cache needs to be cleared.

llvm-svn: 72372
2009-05-24 20:08:21 +00:00
Torok Edwin
aca641232c Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Also fix 80 column violation.

llvm-svn: 72371
2009-05-24 19:36:09 +00:00
Dan Gohman
eb3ddbb1ac When rewriting the loop exit test with the canonical induction variable,
leave the original comparison in place if it has other uses, since the
other uses won't be dominated by the new comparison instruction.

llvm-svn: 72369
2009-05-24 19:11:38 +00:00
Dan Gohman
942daf73f8 Fix this code for hosts where std::vector doesn't have .data().
Use &Ops[0] instead, which is safe since Ops will never be empty here.

llvm-svn: 72368
2009-05-24 19:02:45 +00:00
Dan Gohman
ccdd18130a When replacing a floating-point comparison with an integer
comparison, use takeName to give the integer comparison a name.

llvm-svn: 72367
2009-05-24 18:09:01 +00:00
Dan Gohman
fdba9c8fce Generalize SCEVExpander::visitAddRecExpr's GEP persuit, and avoid
sending SCEVUnknowns to expandAddToGEP. This avoids the need for
expandAddToGEP to bend the rules and peek into SCEVUnknown
expressions.

Factor out the code for testing whether a SCEV can be factored by
a constant for use in a GEP index. This allows it to handle
SCEVAddRecExprs, by recursing.

As a result, SCEVExpander can now put more things in GEP indices,
so it emits fewer explicit mul instructions.

llvm-svn: 72366
2009-05-24 18:06:31 +00:00
Dan Gohman
378152d9d0 When the low bits of one operand of an add are zero, that number
of low bits of the other operand are preserved in the output.

llvm-svn: 72365
2009-05-24 18:02:35 +00:00
Torok Edwin
8936fc2e28 The rewriter may hold references to instructions that are deleted because they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead
instructions.
Also make InsertedExpressions use an AssertingVH to catch these
bugs easier.

llvm-svn: 72364
2009-05-24 14:23:16 +00:00
Eli Friedman
39e1c1711d Rewrite ISD::FCOPYSIGN lowering to never use i64. Not really ideal, but
it's late, and I don't have any better ideas at the moment.  Fixes PR4257.

llvm-svn: 72363
2009-05-24 10:21:20 +00:00
Torok Edwin
c492a2c1bc Make bugpoint emit a bugpoint-reduced-blocks.bc, because bugpoint itself
can crash during instruction simplification (for example if it creates a
broken module).

llvm-svn: 72362
2009-05-24 09:40:47 +00:00
Torok Edwin
65289dbda1 Add -disable-global-remove option to bugpoint.
Sometimes when bugpointing a crash the bugpoint-reduced-simplified.bc reproduces
a totally different bug than the original one ("GV doesn't have initializer").
Although its useful to report that bug too, I need a way to reduce the original
bug, hence I introduced -disable-global-remove.

llvm-svn: 72361
2009-05-24 09:31:04 +00:00
Eli Friedman
3a5ec52517 Update for CMakeLists; untested, so tell me if there are issues.
llvm-svn: 72360
2009-05-24 09:13:13 +00:00
Eli Friedman
a5fb6bc728 Remove checks of getTypeAction from LegalizeOp; we already assert that
all results and all operands are legal, so this change shouldn't affect 
behavior at all.

llvm-svn: 72359
2009-05-24 08:42:01 +00:00
Eli Friedman
722dd1b861 Disable type legalization in LegalizeDAG.
This leaves around 4000 lines of dead code; I'll clean that up 
in subsequent commits.

llvm-svn: 72358
2009-05-24 02:46:31 +00:00
Nick Lewycky
c8242fc08b Remove border around table used for layout.
llvm-svn: 72357
2009-05-24 02:46:06 +00:00
Eli Friedman
fa8df9fa26 Make the PPC backend use a legal type for the operands to the BUILD_VECTOR
nodes it generates.

llvm-svn: 72356
2009-05-24 02:03:36 +00:00
Eli Friedman
bae1c229e0 Fix a bug in the expansion of EXTRACT_SUBVECTOR in
ExpandExtractFromVectorThroughStack.

llvm-svn: 72351
2009-05-23 23:03:28 +00:00
Eli Friedman
f4d25bb2b6 Make the X86 backend mark EXTRACT_SUBVECTOR as Expand, at least for the
moment.

llvm-svn: 72350
2009-05-23 22:44:52 +00:00
Eli Friedman
9e2df358e3 Add a proper implementation of EXTRACT_SUBVECTOR legalization that
doesn't split legal vector operands.  This is necessary because the 
type legalization (and therefore, vector splitting) code will be going 
away soon.

llvm-svn: 72349
2009-05-23 22:37:25 +00:00