Commit Graph

39124 Commits

Author SHA1 Message Date
Dan Gohman
8e6404180c Fix a copy+paste error in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:47 +00:00
Dan Gohman
35651cdf0b Fix some bugs with the handling of indices in insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:08 +00:00
Nick Lewycky
517e1f5cd7 Peer through sext/zext when looking for not(cmp).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:01:33 +00:00
Nick Lewycky
4914db09a5 Yay us! Every one of these examples turns into icmp/zext/ret.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51818 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 18:20:26 +00:00
Nick Lewycky
9419ddb289 Add more i1 optimizations. add, sub, mul, s/udiv on i1 are now simplified away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 17:59:52 +00:00
Nick Lewycky
fd12a0b20b Adding i1 is always Xor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51816 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 17:10:28 +00:00
Mikhail Glushenkov
310d2eb202 Callback was not executed on OS X when it was a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 13:43:21 +00:00
Chris Lattner
e56d946a38 Fix the CBE's handling of instructions whose result is an i1. Previously,
we did not truncate the value down to i1 with (x&1).  This caused a problem
when the computation of x was nontrivial, for example, "add i1 1, 1" would 
return 2 instead of 0.

This makes the testcase compile into:

...
  llvm_cbe_t = (((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u))&1);
  llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...

instead of:

...
  llvm_cbe_t = ((llvm_cbe_r == 0u) + (llvm_cbe_r == 0u));
  llvm_cbe_u = (((unsigned int )(bool )llvm_cbe_t));
...

This fixes a miscompilation of mediabench/adpcm/rawdaudio/rawdaudio and
403.gcc with the CBE, regressions from LLVM 2.2. Tanya, please pull 
this into the release branch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 09:23:55 +00:00
Dan Gohman
7e2dd6628e Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 02:47:54 +00:00
Dan Gohman
e4c67cdab4 Teach the DAGISelEmitter to not compute the variable_ops operand
index for the input pattern in terms of the output pattern. Instead
keep track of how many fixed operands the input pattern actually
has, and have the input matching code pass the output-emitting
function that index value. This simplifies the code, disentangles
variables_ops from the support for predication operations, and
makes variable_ops more robust.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51808 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 02:11:25 +00:00
Dan Gohman
2830741866 Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51807 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 01:44:25 +00:00
Dan Gohman
81a0c0b44e IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:58:22 +00:00
Evan Cheng
652f7ea955 Revert 51775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:47:19 +00:00
Dan Gohman
8666cc3b99 Add an isAggregateType predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:40:06 +00:00
Evan Cheng
7645e574d2 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51793 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:39:32 +00:00
Evan Cheng
89df08c8a0 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:39:18 +00:00
Dan Gohman
11bf2ace55 Add an operator< for SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51791 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:37:47 +00:00
Owen Anderson
dbb8137c11 The coalescer doesn't need LiveVariables now that we have register use iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51790 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:37:27 +00:00
Gabor Greif
ba2c487424 rewrite operand loops to use iterators
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51789 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 21:24:22 +00:00
Mikhail Glushenkov
856e106d20 Make all help strings start in upper case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51788 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 21:14:10 +00:00
Owen Anderson
15a17f5481 Forgot to commit this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 20:14:04 +00:00
Mikhail Glushenkov
74a0c28fba Fix the -opt switch and add a test case for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 19:56:27 +00:00
Mikhail Glushenkov
18aac1c622 Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51782 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov
7ef36069c8 Add a --dry-run option to llvmc2. Patch by Holger Schurig.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51781 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 18:48:52 +00:00
Owen Anderson
3947e4d142 Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 18:38:26 +00:00
Owen Anderson
427de86ada Since LCSSA switched over to DenseMap, we have to be more careful to avoid iterator invalidation. Fixes PR2385.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 17:31:01 +00:00
Evan Cheng
babf11f249 Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 17:16:20 +00:00
Matthijs Kooijman
33540adca5 Give a proper error message when a command line option is defined more than
once (ie, at two different places in the source, not two times on the
commandline).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51771 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 13:26:11 +00:00
Matthijs Kooijman
494661c623 Use eraseFromParent() instead of doing that manually in two places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51770 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 12:35:46 +00:00
Matthijs Kooijman
74b5e07cc4 Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 10:31:54 +00:00
Bill Wendling
37a6134165 Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:47:04 +00:00
Mikhail Glushenkov
7329610dfa Add a --save-temps option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:29:17 +00:00
Mikhail Glushenkov
a7d0ae34fb Add a check for side effect-free options (specified only in the OptionList).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51759 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov
0ab8ac318f Documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51758 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:28:00 +00:00
Mikhail Glushenkov
2b7bcb4e8d Refactoring: remove code duplication introduced in the previous patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:27:29 +00:00
Mikhail Glushenkov
09b51c348c Refactoring: split CollectProperties into two separate function objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51756 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:27:02 +00:00
Mikhail Glushenkov
ed3ba406c7 Show argv[0] in error messages (like gcc).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:26:35 +00:00
Mikhail Glushenkov
e43228958c New feature: OptionList.
It can be handy to have all information about options gathered in a single place
to provide an overview of all supported options. This patch allows the following:

def Options : OptionList<[
(switch_option "E", (help "Help string")),
(alias_option "quiet", "q")
...
]>;

Tool-specific option properties (like 'append_cmd') have (obviously) no meaning in
this context, so the only properties that are allowed are 'help' and 'required'.

See usage example in examples/Clang.td.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:26:08 +00:00
Mikhail Glushenkov
270cae3bf8 Documentation update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51753 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:25:24 +00:00
Mikhail Glushenkov
5fe8475e3a A small optimization: use static char* array instead of StrVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:24:49 +00:00
Mikhail Glushenkov
92b8da75a1 Make it possible to test if the '-o' option is provided.
The following is now allowed:

    (case (not_empty "o"), do_something, ...)

This didn't work previously because "-o" is built-in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51751 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:24:07 +00:00
Mikhail Glushenkov
34f376281f Fix: 'sink' handling was broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51750 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:23:29 +00:00
Mikhail Glushenkov
6be4ffc7c3 Add support for option aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov
2d0dc9ab44 Allow nesting of case expressions.
The following is now legal:

    (case (in_language "c"),
          (case (switch_on "E"), "gcc -x c -E $INFILE", (default), "gcc -x c $INFILE"),
          (default),
          "gcc $INFILE $OUTFILE")


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov
4fb71eae48 Small error message improvement.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51747 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov
708e7c29bc Remove RequireDefault parameter from EmitCaseConstructHandler.
There are now no situations when 'default' is required.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51746 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov
fb37f39111 Fix some headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
2e73e851d8 New tests for the 'case' expression: not_empty, in_language.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
ef4160dff0 -E should print to stdout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51743 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:18:50 +00:00
Mikhail Glushenkov
ffcf3a1a69 Make it possible to have multiple input languages for a single tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 06:18:16 +00:00