1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

39203 Commits

Author SHA1 Message Date
Nick Lewycky
566baa2c72 Yay us! Every one of these examples turns into icmp/zext/ret.
llvm-svn: 51818
2008-05-31 18:20:26 +00:00
Nick Lewycky
b30afdb62b Add more i1 optimizations. add, sub, mul, s/udiv on i1 are now simplified away.
llvm-svn: 51817
2008-05-31 17:59:52 +00:00
Nick Lewycky
cdcdcddc85 Adding i1 is always Xor.
llvm-svn: 51816
2008-05-31 17:10:28 +00:00
Mikhail Glushenkov
611c1b0f47 Callback was not executed on OS X when it was a function.
llvm-svn: 51814
2008-05-31 13:43:21 +00:00
Chris Lattner
43a47ddd89 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.

llvm-svn: 51813
2008-05-31 09:23:55 +00:00
Dan Gohman
1ab21af8e0 Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.

llvm-svn: 51810
2008-05-31 02:47:54 +00:00
Dan Gohman
00823cb0d4 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.

llvm-svn: 51808
2008-05-31 02:11:25 +00:00
Dan Gohman
0ae2954dd5 Remove an unused variable.
llvm-svn: 51807
2008-05-31 01:44:25 +00:00
Dan Gohman
ac5c3382fe 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.

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Evan Cheng
ce2c3b07ba Revert 51775.
llvm-svn: 51795
2008-05-30 22:47:19 +00:00
Dan Gohman
32c27bdfc4 Add an isAggregateType predicate.
llvm-svn: 51794
2008-05-30 22:40:06 +00:00
Evan Cheng
ee4a0719c0 Fix indentation.
llvm-svn: 51793
2008-05-30 22:39:32 +00:00
Evan Cheng
f1fb1d7abf Fix indentation.
llvm-svn: 51792
2008-05-30 22:39:18 +00:00
Dan Gohman
b67e96f3aa Add an operator< for SmallVector.
llvm-svn: 51791
2008-05-30 22:37:47 +00:00
Owen Anderson
65cfda30bd The coalescer doesn't need LiveVariables now that we have register use iterators.
llvm-svn: 51790
2008-05-30 22:37:27 +00:00
Gabor Greif
d931decf37 rewrite operand loops to use iterators
llvm-svn: 51789
2008-05-30 21:24:22 +00:00
Mikhail Glushenkov
dd905591da Make all help strings start in upper case.
llvm-svn: 51788
2008-05-30 21:14:10 +00:00
Owen Anderson
d5fc134ec6 Forgot to commit this file.
llvm-svn: 51786
2008-05-30 20:14:04 +00:00
Mikhail Glushenkov
9db02580c5 Fix the -opt switch and add a test case for it.
llvm-svn: 51784
2008-05-30 19:56:27 +00:00
Mikhail Glushenkov
da5109acd4 Fix indentation.
llvm-svn: 51782
2008-05-30 18:53:09 +00:00
Mikhail Glushenkov
23bd8d1eb2 Add a --dry-run option to llvmc2. Patch by Holger Schurig.
llvm-svn: 51781
2008-05-30 18:48:52 +00:00
Owen Anderson
9ba2e2794e Preserve the register coallescer, and update live intervals more correctly by triggering a renumbering after phi elimination.
llvm-svn: 51780
2008-05-30 18:38:26 +00:00
Owen Anderson
40022e00ef Since LCSSA switched over to DenseMap, we have to be more careful to avoid iterator invalidation. Fixes PR2385.
llvm-svn: 51777
2008-05-30 17:31:01 +00:00
Evan Cheng
8ebaae9d1c Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
llvm-svn: 51775
2008-05-30 17:16:20 +00:00
Matthijs Kooijman
9fc9250ec0 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).

llvm-svn: 51771
2008-05-30 13:26:11 +00:00
Matthijs Kooijman
861df1986d Use eraseFromParent() instead of doing that manually in two places.
llvm-svn: 51770
2008-05-30 12:35:46 +00:00
Matthijs Kooijman
32c5d3a9ee Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.

llvm-svn: 51766
2008-05-30 10:31:54 +00:00
Bill Wendling
244b4db58d Add the "AsCheapAsAMove" flag to some 64-bit xor instructions.
llvm-svn: 51761
2008-05-30 06:47:04 +00:00
Mikhail Glushenkov
de53ad5a62 Add a --save-temps option.
llvm-svn: 51760
2008-05-30 06:29:17 +00:00
Mikhail Glushenkov
fd530e8c6a Add a check for side effect-free options (specified only in the OptionList).
llvm-svn: 51759
2008-05-30 06:28:37 +00:00
Mikhail Glushenkov
c90efd29e5 Documentation update.
llvm-svn: 51758
2008-05-30 06:28:00 +00:00
Mikhail Glushenkov
8d77c1749d Refactoring: remove code duplication introduced in the previous patch.
llvm-svn: 51757
2008-05-30 06:27:29 +00:00
Mikhail Glushenkov
95fc013fc8 Refactoring: split CollectProperties into two separate function objects.
llvm-svn: 51756
2008-05-30 06:27:02 +00:00
Mikhail Glushenkov
77e32bbe23 Show argv[0] in error messages (like gcc).
llvm-svn: 51755
2008-05-30 06:26:35 +00:00
Mikhail Glushenkov
3cc06cc83a 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.

llvm-svn: 51754
2008-05-30 06:26:08 +00:00
Mikhail Glushenkov
46e4310766 Documentation update.
llvm-svn: 51753
2008-05-30 06:25:24 +00:00
Mikhail Glushenkov
6d853110ba A small optimization: use static char* array instead of StrVector.
llvm-svn: 51752
2008-05-30 06:24:49 +00:00
Mikhail Glushenkov
85844e2353 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.

llvm-svn: 51751
2008-05-30 06:24:07 +00:00
Mikhail Glushenkov
4d71bea2c9 Fix: 'sink' handling was broken.
llvm-svn: 51750
2008-05-30 06:23:29 +00:00
Mikhail Glushenkov
471d982643 Add support for option aliases.
llvm-svn: 51749
2008-05-30 06:22:52 +00:00
Mikhail Glushenkov
9c0a984b65 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")

llvm-svn: 51748
2008-05-30 06:22:15 +00:00
Mikhail Glushenkov
8b0a6430e6 Small error message improvement.
llvm-svn: 51747
2008-05-30 06:21:48 +00:00
Mikhail Glushenkov
1ba3b7e1fa Remove RequireDefault parameter from EmitCaseConstructHandler.
There are now no situations when 'default' is required.

llvm-svn: 51746
2008-05-30 06:21:21 +00:00
Mikhail Glushenkov
64ec622f1d Fix some headers.
llvm-svn: 51745
2008-05-30 06:20:54 +00:00
Mikhail Glushenkov
9f66c06b4e New tests for the 'case' expression: not_empty, in_language.
llvm-svn: 51744
2008-05-30 06:19:52 +00:00
Mikhail Glushenkov
9d884b6cfb -E should print to stdout.
llvm-svn: 51743
2008-05-30 06:18:50 +00:00
Mikhail Glushenkov
1abbaf5299 Make it possible to have multiple input languages for a single tool.
llvm-svn: 51742
2008-05-30 06:18:16 +00:00
Mikhail Glushenkov
9cc41e71af Rename StringVector to StrVector (to be consistent with LLVMCConfigurationEmitter.cpp).
llvm-svn: 51741
2008-05-30 06:17:29 +00:00
Mikhail Glushenkov
419acffb7c Minor error message fixes.
llvm-svn: 51740
2008-05-30 06:16:59 +00:00
Mikhail Glushenkov
2b1ce739f3 Documentation and examples improvements
llvm-svn: 51739
2008-05-30 06:16:32 +00:00