Commit Graph

23393 Commits

Author SHA1 Message Date
Duncan Sands
3b3adbb745 Tighten up the abstraction slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52045 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:49:32 +00:00
Duncan Sands
83ec4b6711 Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:08:01 +00:00
Zhou Sheng
cc41940dff As Chris suggested, handle the situation if ShAmt larger than BitWidth,
otherwise, opt might crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 08:32:05 +00:00
Evan Cheng
9c3c221364 Refine stack slot interval weight computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52040 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 07:54:39 +00:00
Anton Korobeynikov
b0a882f540 Turn stdout into binary mode during bitcode emission.
This is necessary on windows targets, since stdout is in text mode there.
Patch by Julien Lerouge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52038 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 07:24:01 +00:00
Anton Korobeynikov
232a4ab77a Provide hooks for libgcc symbols' address resolution inside lli on mingw32.
Patch by Julien Lerouge!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52037 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 07:20:07 +00:00
Bruno Cardoso Lopes
0af5e095ad Added custom isel for MUL, SDIVREM, UDIVREM, SMUL_LOHI and UMUL_LOHI nodes
MUL is not anymore directly matched because its a pseudoinstruction.
LogicI class fixed to zero-extend immediates. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 06:37:31 +00:00
Bruno Cardoso Lopes
07cec75913 Added custom SELECT_CC lowering
Added special isel for ADDE,SUBE and new patterns to match SUBC,ADDC


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 00:58:26 +00:00
Dan Gohman
836bfcd689 Revert 52002.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:57:06 +00:00
Chris Lattner
5c490610a1 Expose a public interface to this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52029 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:45:18 +00:00
Chris Lattner
15ccbf59a9 Let libcall semantics decide whether it knows about functions
with definitions or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:38:34 +00:00
Evan Cheng
1b022cf688 Don't break strict aliasing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 22:59:21 +00:00
Owen Anderson
417dc2f595 Remove debugging code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 18:43:34 +00:00
Owen Anderson
a9efb264b0 Use the newly created helper on LiveIntervals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 17:22:53 +00:00
Owen Anderson
c4dc132c8a Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 17:15:43 +00:00
Zhou Sheng
17183ab973 If BitWidth equals to ShtAmt, the RHSKnownZero[BitWidth-ShiftAmt-1] will
crash the opt. Just fix this.

Test case in llvm/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52003 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 14:23:44 +00:00
Matthijs Kooijman
411e6a5efb Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 14:00:36 +00:00
Zhou Sheng
bfde7d6b9e As comments said, for negative value, the arithmetic
over-shift-right should return -1. So here it should be signed-extended,
when bitwidth larger than 64.

test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 13:27:38 +00:00
Matthijs Kooijman
02518140ac Learn ScalarReplAggregrates how stores and loads of first class aggregrates
work and how to replace them into individual values. Also, when trying to
replace an aggregrate that is used by load or store with a single (large)
integer, don't crash (but don't replace the aggregrate either).

Also adds a testcase for both structs and arrays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 12:51:53 +00:00
Matthijs Kooijman
47c6fd7317 Let StructRetPromotion check if all if its users are really calls or invokesn,
not other instructions. This fixes a crash with the added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:57:20 +00:00
Matthijs Kooijman
257da0a7fc Let StructRetPromotion check if it's users are really calling it and not
passing its pointer. Fixes test with added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:48:32 +00:00
Matthijs Kooijman
41335411a8 Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if a
function is passed as an argument instead of called. Also do this check a bit
earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51990 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:34:25 +00:00
Matthijs Kooijman
045b3f7bf1 * Make CallSite::hasArgument const and let it take a const parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
845f524c25 Update comments and documentation to reflect that GCSE and ValueNumbering are
deprecated by the GVN and GVNPRE passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 07:55:49 +00:00
Evan Cheng
fb4db316d8 Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 23:37:54 +00:00
Owen Anderson
10a05bfff0 Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51955 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 18:28:10 +00:00
Evan Cheng
75bb734f1d Oops. Should not be enabled by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51953 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 18:09:20 +00:00
Chris Lattner
67f631dfd5 Rewrite a bunch of the CBE's inline asm code, giving it the
ability to handle indirect input operands.  This fixes PR2407.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 18:03:28 +00:00
Owen Anderson
38b425020b Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 17:55:58 +00:00
Evan Cheng
7a315e865a Revert this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51949 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 17:21:44 +00:00
Matthijs Kooijman
227c27dd06 Replace two manual loops with calls to CallSite::hasArguments (no functional changes).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:57:50 +00:00
Matthijs Kooijman
9515a8f88a Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
338169ddc9 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
444099f615 Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 14:40:55 +00:00
Evan Cheng
3f32d65912 Add a stack slot coloring pass. Not yet enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51934 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:18:41 +00:00
Evan Cheng
d8a46e3a74 LowerSubregs should not clobber any analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:17:16 +00:00
Evan Cheng
cb74266cdb Move #include to right place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51932 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:16:33 +00:00
Evan Cheng
b3dd264f9d Register if-converter pass for -debug-pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51931 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:15:51 +00:00
Evan Cheng
7c9b65207e More pass manager debugging outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:13:31 +00:00
Duncan Sands
a0fcc08e65 Change packed struct layout so that field sizes
are the same as in unpacked structs, only field
positions differ.  This only matters for structs
containing x86 long double or an apint; it may
cause backwards compatibility problems if someone
has bitcode containing a packed struct with a
field of one of those types.
The issue is that only 10 bytes are needed to
hold an x86 long double: the store size is 10
bytes, but the ABI size is 12 or 16 bytes (linux/
darwin) which comes from rounding the store size
up by the alignment.  Because it seemed silly not
to pack an x86 long double into 10 bytes in a
packed struct, this is what was done.  I now
think this was a mistake.  Reserving the ABI size
for an x86 long double field even in a packed
struct makes things more uniform: the ABI size is
now always used when reserving space for a type.
This means that developers are less likely to
make mistakes.  It also makes life easier for the
CBE which otherwise could not represent all LLVM
packed structs (PR2402).
Front-end people might need to adjust the way
they create LLVM structs - see following change
to llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51928 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 08:21:45 +00:00
Chris Lattner
32a9e7a265 Add #includes required by GCC 4.3, thanks for Zhongxing Xu
for reporting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51926 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 04:46:14 +00:00
Bruno Cardoso Lopes
d2947ee33e Some Mips minor fixes
Added support for mips little endian arch => mipsel



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 01:45:25 +00:00
Owen Anderson
3094a4c97a We need to subtract one from this index because live ranges are open at the end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 00:38:56 +00:00
Scott Michel
ba12f57ebe Fix spellnig error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 19:13:20 +00:00
Owen Anderson
269db29bdb LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51915 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:29:48 +00:00
Dale Johannesen
24f07dc6e4 Prevent a crash in debug dumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:14:29 +00:00
Dale Johannesen
428ac54894 Add StringConstantPrefix to control what the
assembler names of string constants look like.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:09:06 +00:00
Scott Michel
eefc845b5f Find a better place to output hex constants corresponding to integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51904 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 15:39:51 +00:00
Bruno Cardoso Lopes
a8c63f0fc9 Fixed bug in bad behavior in calculateFrameObjectOffsets,
the solution commited is different from the previous patch to
avoid int and unsigned comparison


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 08:46:59 +00:00
Evan Cheng
f73ff3aaf6 Do not run loop-aligner at -fast (e.g. -O0).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51898 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 06:56:08 +00:00
Scott Michel
4315eee376 Revert this patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 06:18:19 +00:00
Devang Patel
c0c33f5e2c "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:20:02 +00:00
Devang Patel
e62f750784 Add debugging aid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:02:16 +00:00
Dan Gohman
c702a9ed1c Fix whitespace in whitespace-significant pseudocode in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 00:57:21 +00:00
Dan Gohman
6e68f59b78 Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 00:15:20 +00:00
Devang Patel
2f170997b5 Update dom tree. Fix PR 2372.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 22:52:56 +00:00
Dan Gohman
33b625bee4 Fold adds and subtracts of zero immediately, instead of waiting
for dagcombine to do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 22:27:05 +00:00
Scott Michel
83ccc0a50c Minor cosmetic patch so that the hex equivalent of a decimal
constant shows up in the assembly language output. Helps with
debugging without a HP calculator having to be handy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 22:19:12 +00:00
Scott Michel
8bf61e8c2a Add necessary 64-bit support so that gcc frontend compiles (mostly). Current
issue is operand promotion for setcc/select... but looks like the fundamental
stuff is implemented for CellSPU.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 22:18:03 +00:00
Dan Gohman
193c235850 Implement CBE support for first-class structs and array values,
and insertvalue and extractvalue instructions.

First-class array values are not trivial because C doesn't
support them. The approach I took here is to wrap all arrays
in structs. Feedback is welcome.

The 2007-01-15-NamedArrayType.ll test needed to be modified
because it has a "not grep" for a string that now exists,
because array types now have associated struct types, and
those struct types have names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 21:30:49 +00:00
Chris Lattner
d82e511aec Remove unneeded code I added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 18:39:07 +00:00
Owen Anderson
e3abb0a858 Correctly handle removed instructions at the beginning of MBBs when renumbering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 17:36:36 +00:00
Wojciech Matyjewicz
98e3a6829a Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP
is longer than the second one) should stop after finding one. Added break 
instruction guarantees it. It also changes difference between offsets to 
absolute value of this difference in the condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 17:26:12 +00:00
Rafael Espindola
da5860fa8b Don't use the GOT for symbols that are not externally visible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 07:52:43 +00:00
Chris Lattner
833f25d79e move CannotBeNegativeZero to ValueTracking. Simplify some signbit comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51864 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 01:29:46 +00:00
Chris Lattner
173234a68f move ComputeMaskedBits, MaskedValueIsZero, and ComputeNumSignBits
out of instcombine into a new file in libanalysis.  This also teaches
ComputeNumSignBits about the number of sign bits in a constantint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 01:18:21 +00:00
Owen Anderson
009e4f7609 Fix two issues that Eli Friedman pointed out, where would misoptimized code like:
char a[200];
init(a, a+200);

OR

int a[200];
char* b = (char*)a;
char* c = (char*)a;
foo(b, c);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 22:26:26 +00:00
Owen Anderson
12cb36c115 Don't remove the memcpy when call slot substitution fails.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 21:52:16 +00:00
Owen Anderson
6bd15ce03f Remember to update the reverse non-local cache when cleaning up dirty entries. This fixes PR2397.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51846 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 21:03:52 +00:00
Owen Anderson
d8f34fa3d6 Make ping more aggressive in finding nonlocal caching errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 20:51:41 +00:00
Duncan Sands
f413cdfb0b When simplifying a call to a bitcast function, tighten up
the conditions for performing the transform when only the
function declaration is available: no longer allow turning
i32 into i64 for example.  Only allow changing between
pointer types, and between pointer types and integers of
the same size.  For return values ptr -> intptr was already
allowed; I added ptr -> ptr and intptr -> ptr while there.
As shown by a recent objc testcase, changing the way
parameters/return values are passed can be fatal when calling
code written in assembler that directly manipulates call
arguments and return values unless the transform has no
impact on the way they are passed at the codegen level.
While it is possible to imagine an ABI that treats integers
of pointer size differently to pointers, I don't think LLVM
supports any so the transform should now be safe while still
being useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 07:38:42 +00:00
Bruno Cardoso Lopes
bdbb750afe Fixed flag issue that was generating infinite loop while in list scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51833 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-01 03:49:39 +00:00
Dan Gohman
995be7d07a AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:12:39 +00:00
Dan Gohman
0aab28bf4c Improved bitcode support for insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:11:15 +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
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
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
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
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
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
Dan Gohman
493e03851d Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51721 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:56:36 +00:00
Dan Gohman
5bd91232c3 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51718 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:08:18 +00:00
Dan Gohman
5a56bf631e Fix a copy+paste error in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 00:02:02 +00:00
Owen Anderson
7eec0c2433 Make the renumbering correct in the face of deleted instructions that have been removed from the LiveIntervals maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 23:01:22 +00:00
Bill Wendling
6445537c84 Unbreak build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51709 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 22:02:08 +00:00
Dan Gohman
b4106170dd Add patterns for CALL32m and CALL64m. They aren't matched in most
cases due to an isel deficiency already noted in
lib/Target/X86/README.txt, but they can be matched in this fold-call.ll
testcase, for example.

This is interesting mainly because it exposes a tricky tblgen bug;
tblgen was incorrectly computing the starting index for variable_ops
in the case of a complex pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 21:50:34 +00:00