Commit Graph

44020 Commits

Author SHA1 Message Date
Dan Gohman 643b3a0581 Add #includes to make some dependencies explicit.
llvm-svn: 51496
2008-05-23 20:40:06 +00:00
Steve Naroff fd16687b9a Make sure method definitions get output with -ast-dump.
llvm-svn: 51494
2008-05-23 18:50:58 +00:00
Dan Gohman 0fb92a65b3 Issue errors in several situations instead of aborting.
llvm-svn: 51493
2008-05-23 18:23:11 +00:00
Ted Kremenek a4951b7796 When known, include the analyzer build in the output of scan-build.
llvm-svn: 51492
2008-05-23 18:17:05 +00:00
Dan Gohman 66eea1b9b3 Elaborate on the entry on integer vector multiplication by constants.
llvm-svn: 51491
2008-05-23 18:05:39 +00:00
Evan Cheng 01b7fffb29 Fix a duplicated pattern.
llvm-svn: 51490
2008-05-23 18:00:18 +00:00
Dan Gohman 3388d022ac Use PMULDQ for v2i64 multiplies when SSE4.1 is available. And add
load-folding table entries for PMULDQ and PMULLD.

llvm-svn: 51489
2008-05-23 17:49:40 +00:00
Evan Cheng d25cb8e0d2 New entry.
llvm-svn: 51487
2008-05-23 17:28:11 +00:00
Ted Kremenek 6849601f69 More test cases for retain/release checker. These cases handle not flagging leaks for static variables.
llvm-svn: 51486
2008-05-23 17:25:17 +00:00
Dale Johannesen b28a17c346 Rewrite a loop to avoid using iterators pointing to
elements that have been erased.  Based on a patch
by Nicolas Capens.

llvm-svn: 51485
2008-05-23 17:19:02 +00:00
Dan Gohman 14552f83bb Fix the spelling of the va_arg keyword.
llvm-svn: 51484
2008-05-23 17:11:55 +00:00
Dan Gohman 0f731017dd Fix another isFirstClassType that now needs to be isSingleValueType.
This fixes recent CBE regressions.

llvm-svn: 51483
2008-05-23 16:57:00 +00:00
Matthijs Kooijman f52b23c0eb Replace some weird usage of UserOp1 introduced in r49492 by a plain if.
llvm-svn: 51482
2008-05-23 16:17:48 +00:00
Matthijs Kooijman e7d45b1e49 Restructure the testing documentation.
I've tried to make the distinction between the DejaGNU tests and the test-suite
more clear, added a small section about generating output from the test-suite,
removed some duplication and fixed some wordings. Most of the changes are text
movements, however.

llvm-svn: 51480
2008-05-23 11:45:18 +00:00
Gabor Greif f61cb42ab5 fix typo
llvm-svn: 51479
2008-05-23 11:19:39 +00:00
Matthijs Kooijman aef2b8198b Restucture a part of the SimplifyCFG pass and include a testcase.
The SimplifyCFG pass looks at basic blocks that contain only phi nodes,
followed by an unconditional branch. In a lot of cases, such a block (BB) can
be merged into their successor (Succ).

This merging is performed by TryToSimplifyUncondBranchFromEmptyBlock. It does
this by taking all phi nodes in the succesor block Succ and expanding them to
include the predecessors of BB. Furthermore, any phi nodes in BB are moved to
Succ and expanded to include the predecessors of Succ as well.

Before attempting this merge, CanPropagatePredecessorsForPHIs checks to see if
all phi nodes can be properly merged. All functional changes are made to
this function, only comments were updated in
TryToSimplifyUncondBranchFromEmptyBlock.

In the original code, CanPropagatePredecessorsForPHIs looks quite convoluted
and more like stack of checks added to handle different kinds of situations
than a comprehensive check. In particular the first check in the function did
some value checking for the case that BB and Succ have a common predecessor,
while the last check in the function simply rejected all cases where BB and
Succ have a common predecessor. The first check was still useful in the case
that BB did not contain any phi nodes at all, though, so it was not completely
useless.

Now, CanPropagatePredecessorsForPHIs is restructured to to look a lot more
similar to the code that actually performs the merge. Both functions now look
at the same phi nodes in about the same order.  Any conflicts (phi nodes with
different values for the same source) that could arise from merging or moving
phi nodes are detected. If no conflicts are found, the merge can happen.

Apart from only restructuring the checks, two main changes in functionality
happened.

Firstly, the old code rejected blocks with common predecessors in most cases.
The new code performs some extra checks so common predecessors can be handled
in a lot of cases. Wherever common predecessors still pose problems, the
blocks are left untouched.

Secondly, the old code rejected the merge when values (phi nodes) from BB were
used in any other place than Succ. However, it does not seem that there is any
situation that would require this check. Even more, this can be proven.

Consider that BB is a block containing of a single phi node "%a" and a branch
to Succ. Now, since the definition of %a will dominate all of its uses, BB
will dominate all blocks that use %a. Furthermore, since the branch from BB to
Succ is unconditional, Succ will also dominate all uses of %a.

Now, assume that one predecessor of Succ is not dominated by BB (and thus not
dominated by Succ). Since at least one use of %a (but in reality all of them)
is reachable from Succ, you could end up at a use of %a without passing
through it's definition in BB (by coming from X through Succ). This is a
contradiction, meaning that our original assumption is wrong. Thus, all
predecessors of Succ must also be dominated by BB (and thus also by Succ).

This means that moving the phi node %a from BB to Succ does not pose any
problems when the two blocks are merged, and any use checks are not needed.

llvm-svn: 51478
2008-05-23 09:09:41 +00:00
Matthijs Kooijman f399bbf980 Indent fix.
llvm-svn: 51477
2008-05-23 07:57:02 +00:00
Nick Lewycky 3bf5512d87 Constant integer vectors may also be negated.
llvm-svn: 51476
2008-05-23 04:54:45 +00:00
Nick Lewycky 8f3127c5b5 Typo.
llvm-svn: 51475
2008-05-23 04:39:38 +00:00
Nick Lewycky 4f3d878507 Revert X + X --> X * 2 optz'n which pessimizes heavily on x86.
llvm-svn: 51474
2008-05-23 04:34:58 +00:00
Chris Lattner 3546c2b4e4 we compile multiply-by-constant into horrible code. Doesn't sse4 have some
instruction for doing this?

llvm-svn: 51473
2008-05-23 04:29:53 +00:00
Nick Lewycky 452fb32927 Implement X + X for vectors.
llvm-svn: 51472
2008-05-23 04:14:51 +00:00
Nick Lewycky 2ec9a01173 Fix a recently added optimization to not crash on vectors.
llvm-svn: 51471
2008-05-23 03:26:47 +00:00
Ted Kremenek d6795749a6 Unbreak build. Forget to check in this header file change with a previous commit.
llvm-svn: 51470
2008-05-23 02:53:24 +00:00
Dan Gohman 6d5f120c5c Generalize the new code in instcombine's ComputeNumSignBits for handling
and/or to handle more cases (such as this add-sitofp.ll testcase), and
port it to selectiondag's ComputeNumSignBits.

llvm-svn: 51469
2008-05-23 02:28:01 +00:00
Dan Gohman 30499844ea Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman 53b2698531 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51467
2008-05-23 01:52:21 +00:00
Ted Kremenek 47c96d011e Fix typo.
llvm-svn: 51466
2008-05-23 01:40:41 +00:00
Bill Wendling 6e326bf0fb Remove warnings about comparison between signed and unsigned expressions.
llvm-svn: 51465
2008-05-23 01:29:08 +00:00
Dale Johannesen fecb88249f Allow for switch with no cases. Was causing fault
in gcc.dg/pr27531-1.c.

llvm-svn: 51464
2008-05-23 01:01:31 +00:00
Steve Naroff e3fa7136b0 Tweak AST dumper for ObjC ivars.
llvm-svn: 51463
2008-05-23 00:59:14 +00:00
Evan Cheng f3be7a7ea7 Bug: rcpps can only folds a load if the address is 16-byte aligned. Fixed many 'ps' load folding patterns in X86InstrSSE.td which are missing the proper alignment checks.
Also fixed some 80 col. violations.

llvm-svn: 51462
2008-05-23 00:37:07 +00:00
Dan Gohman 0752bffe9a Add more IR support for the new extractvalue and insertvalue
instructions.

llvm-svn: 51461
2008-05-23 00:36:11 +00:00
Dan Gohman 396ed504f1 Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51460
2008-05-23 00:34:04 +00:00
Dan Gohman 30ab45d01e Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51459
2008-05-23 00:17:26 +00:00
Dale Johannesen 6b4dcc1c14 Put const weak stuff in appropriate section on Darwin.
g++.dg/abi/key2.C

llvm-svn: 51458
2008-05-23 00:16:59 +00:00
Dale Johannesen 5b74efd723 Make LTO expect common and weak to be represented differently.
Reading .bc files from before that change will no longer work.

llvm-svn: 51457
2008-05-23 00:15:10 +00:00
Dan Gohman 7a0566b9cd Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51456
2008-05-23 00:12:03 +00:00
Evan Cheng 97b020e61e X86CodeEmitter should not set PIC style to None at initialization time. This will break codegen if relocation model is changed to PIC_ later.
llvm-svn: 51455
2008-05-22 23:55:24 +00:00
Ted Kremenek db622628e8 Additional retain/release checker regression tests.
llvm-svn: 51454
2008-05-22 23:46:11 +00:00
Ted Kremenek b91ef1b62b Prototyped support in the BugReporter to emit diagnostics of the form "p now aliases q".
llvm-svn: 51453
2008-05-22 23:45:19 +00:00
Dan Gohman 8830714bff Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

llvm-svn: 51452
2008-05-22 23:43:22 +00:00
Steve Naroff 4c290c7c0b Make sure the source location for @property points the the @-sign (not the decl spec).
Also added a FIXME related to how we represent @properties in the ObjCInterfaceDecl AST.

llvm-svn: 51450
2008-05-22 23:24:08 +00:00
Dan Gohman 5477a1583a Add a polygen grammar definition for LLVM assembly language.
llvm-svn: 51449
2008-05-22 22:45:03 +00:00
Dan Gohman 298a1d6d5f Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

llvm-svn: 51448
2008-05-22 22:30:09 +00:00
Dan Gohman 5d30975e5e Change uses of llvm::Type::isFirstClassType to use the new
llvm::Type::isSingleValueType. Currently these two functions have
the same behavior, but soon isFirstClassType will return true for
struct and array types.

Clang may some day want to use of isFirstClassType for some of
these some day as an optimization, but it'll require some
consideration.

llvm-svn: 51446
2008-05-22 22:12:56 +00:00
Evan Cheng a1100782d5 Add a couple of test cases.
llvm-svn: 51441
2008-05-22 21:19:19 +00:00
David Greene 830487035e When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

llvm-svn: 51440
2008-05-22 21:16:33 +00:00
David Greene 54b52fe13b Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.

llvm-svn: 51439
2008-05-22 21:12:21 +00:00
Gabor Greif ff77c8b608 transform more loops to iterator form, detabify
llvm-svn: 51436
2008-05-22 19:24:54 +00:00