Commit Graph

5938 Commits

Author SHA1 Message Date
Bill Wendling
d0ab34bf8f Temporarily revert r58979 and related patch. It's causing a failure in X86 bootstrap:
Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1obj-checksum.o differs
warning: ./cc1objplus-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./alias.o differs
./alloc-pool.o differs
./attribs.o differs
./bb-reorder.o differs
./bitmap.o differs
./build/errors.o differs
./build/genattrtab.o differs
./build/genautomata.o differs
./build/genemit.o differs
./build/genextract.o differs
...

-bw


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59003 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 21:22:06 +00:00
Devang Patel
d4e7f44319 If the sign of exit condition and split condition does not match
then do not split loop index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 19:48:34 +00:00
Duncan Sands
f509224510 Fix PR2667: add soft float support for sint_to_fp/uint_to_fp
where the argument is an apint, or smaller than the minimum
size for which there is a libcall (i32). 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:36:26 +00:00
Duncan Sands
a29c13086a When promoting the result of fp_to_uint/fp_to_sint,
inform the optimizers that the result must be zero/
sign extended from the smaller type.  For example,
if a fp to unsigned i16 is promoted to fp to i32,
then we are allowed to assume that the extra 16 bits
are zero (because the result of fp to i16 is undefined
if the result does not fit in an i16).  This is
quite aggressive, but should help the optimizers
produce better code.  This requires correcting a
test which thought that fp_to_uint is some kind
of truncation, which it is not: in the testcase
(which does fp to i1), either the fp value converts
to 0 or 1 or the result is undefined, which is
quite different to truncation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58991 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 17:28:30 +00:00
Dale Johannesen
22a8e9e511 Reenable test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-10 07:30:32 +00:00
Bill Wendling
1fb43c32ed The method of doing the matching with a 'select' instruction was wrong. The
original code was matching like this:

	if (match(A, m_Not(m_Value(B))))

B was already matched as a 'select' instruction. However, this isn't matching
what we think it's matching. It would match B as a 'Value', so basically
anything would match to it. In this case, a Constant matched. B was replaced
with a constant representation. And then the wrong value would be used in the
SelectInst::Create statement, causing a crash.

After thinking on this for a moment, and after Nick L. told me how the pattern
matching stuff was supposed to work, the solution was to match NOT an m_Value,
but an m_Select.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 23:17:42 +00:00
Duncan Sands
4d16a0aa58 XFAIL this while waiting for a fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58934 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 13:07:47 +00:00
Bill Wendling
c143bcf9ac If the LHS of the FCMP is coming from a UIToFP instruction, then we don't want
to generate signed ICMP instructions to replace the FCMP. This would violate
the following:

define i1 @test1(i32 %val) {
  %1 = uitofp i32 %val to double
  %2 = fcmp ole double %1, 0.000000e+00
  ret i1 %2
}

would be transformed into:

define i1 @test1(i32 %val) {
  %1 = icmp slt i33 %val, 1
  ret i1 %1
}

which is obviously wrong. This patch modifes InstCombiner::FoldFCmp_IntToFP_Cst
to handle when the LHS comes from UIToFP.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58929 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 04:26:50 +00:00
Scott Michel
4691cd9558 CellSPU: Update expected counts on expected patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58927 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-09 01:03:41 +00:00
Daniel Dunbar
77e0c85dcc Add LLVMC2 tool definitions for Objective-C and Objective-C++.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58885 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 03:25:47 +00:00
Dale Johannesen
3dd42cfe12 Generated code for generic expansion of SETUGT etc.
is noticeably worse than previous PPC-specific code.
Since the latter was also wrong in some cases and
correctness is more important than efficiency, I'm
disabling this test temporarily while I fix it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 00:49:19 +00:00
Dale Johannesen
c4c7a6a3fb Xfail an incorrect test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 00:40:24 +00:00
Richard Osborne
b7ee8c4c1f Add basic test for XCore backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58841 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 11:24:12 +00:00
Dale Johannesen
815fb57226 Testcase for testb optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:30:18 +00:00
Devang Patel
180ffaef18 Handle (delete) dbg intrinsics while promoting alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:30:07 +00:00
Devang Patel
e75808cf3d Emit label for llvm.dbg.func.start of the inlined function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 21:28:20 +00:00
Devang Patel
20dd0460a1 Emit label for llvm.dbg.func.start of the inlined function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58786 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 00:30:09 +00:00
Dan Gohman
33a9cb4f40 Make ISel ignore dead nodes. The DAGCombiner normally eliminates
dead nodes, but in this case its missing one. Fixing the DAGCombiner
is desirable, but it's somewhat involved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 22:56:47 +00:00
Devang Patel
60886066bf Add PR number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58765 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 18:41:15 +00:00
Evan Cheng
b35ed9247a Add more vector move low and zero-extend patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58752 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 06:04:51 +00:00
Devang Patel
c9eaef0bf2 New test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 01:40:30 +00:00
Dan Gohman
8f027c7fea Add a new pass to simplify specific half_powr function calls. This is
a specialized pass that it not likely to be generally useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58732 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 23:41:45 +00:00
Anton Korobeynikov
879b1ac22e Fix tests not to emit IR output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58729 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 23:02:39 +00:00
Evan Cheng
3eb22e835f Actually ARM / Mac OS X does have UINTTOFP_I64_F{64|32} libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 22:19:55 +00:00
Evan Cheng
c7c77297e2 Custom lower bit_convert i64 -> f64 into FMDRR. This is now happening with legalizetypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 19:57:48 +00:00
Duncan Sands
e59416efb8 Fix PR3011: LegalizeTypes support for scalarizing
SELECT_CC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-04 17:31:08 +00:00
Dan Gohman
f6503a031e The ANDMask node folds to a constant, and isn't the node that needs to
have its node id set. The new and and shift nodes are the nodes that need
the IDs. This fixes PR2982.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58655 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 23:43:55 +00:00
Devang Patel
265ca5dff5 Ignore conditions that are outside the loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58631 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 19:38:07 +00:00
Devang Patel
58d43d4a41 Turn floating point IVs into integer IVs where possible.
This allows SCEV users to effectively calculate trip count.
LSR later on transforms back integer IVs to floating point IVs
later on to avoid int-to-float casts inside the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 18:32:19 +00:00
Dan Gohman
3a5797d946 Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 17:56:27 +00:00
Anton Korobeynikov
d1000d9927 Testcase for recent llvm-gcc fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 14:43:31 +00:00
Duncan Sands
5c58a3168f Make VAARG work with x86 long double (which is
10 bytes long, but is passed in 12/16 bytes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 11:51:11 +00:00
Nick Lewycky
8f4d5eb9e5 Don't crash analyzing certain quadratics (addrec of {X,+,Y,+,1}).
We're still waiting on code that actually analyzes them properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 02:43:49 +00:00
Nick Lewycky
6feb333695 Changes from Duncan's review:
* merge two weak functions by making them both alias a third non-weak fn
 * don't reimplement CallSite::hasArgument
 * whitelist the safe linkage types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 16:46:26 +00:00
Anton Korobeynikov
e491515730 Testcase for PR2691
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 16:46:17 +00:00
Nick Lewycky
579a024661 Add a new MergeFunctions pass. It finds identical functions and merges them.
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 05:52:50 +00:00
Nick Lewycky
8e39432ea9 Fix demanded bits analysis with srem by negative number. Based on a patch
by Richard Osborne.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58555 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 02:41:50 +00:00
Dan Gohman
21440acc06 Fix this recently moved code to use the correct type. CI is now a
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-02 00:17:33 +00:00
Anton Korobeynikov
3d2c131592 Testcase for PR2613
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 20:10:49 +00:00
Duncan Sands
06f0aff69e Add a bunch of libcalls for ppcf128 that were somehow
completely forgotten about when writing LegalizeTypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 14:06:52 +00:00
Dan Gohman
d17cfbe1ca Use MOVSSmr instead of EXTRACTPSmr in the case of extracting
vector element 0 for a store, as it's smaller and faster.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 00:57:24 +00:00
Duncan Sands
557291c544 Testcase for PR2987.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58459 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 21:13:11 +00:00
Dan Gohman
1975d03183 Canonicalize sext(i1) to i1?-1:0, and update various instcombine
optimizations accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 20:40:10 +00:00
Duncan Sands
d383ff313b Testcase for PR2986.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 20:34:30 +00:00
Daniel Dunbar
c5e1ec47c7 Add InlineCost class for represent the estimated cost of inlining a
function.
 - This explicitly models the costs for functions which should
   "always" or "never" be inlined. This fixes bugs where such costs
   were not previously respected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58450 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 19:26:59 +00:00
Scott Michel
d976c21241 Resolve bug 2947: vararg-marked functions must spill registers R3-R79 to stack
so that va_start/va_arg/et.al. will walk arguments correctly for Cell SPU.

N.B.: Because neither clang nor llvm-gcc-4.2 can be built for CellSPU, this is
still unexorcised code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-30 01:51:48 +00:00
Chris Lattner
db97348400 add testcase for PR2964
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 18:42:22 +00:00
Duncan Sands
492f04c203 Testcase for PR2917.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 18:06:20 +00:00
Chris Lattner
f8131c99de Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 17:46:26 +00:00
Duncan Sands
f258b02abe Make the declaration of bzero match size_t on
x86-64-linux.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 15:57:37 +00:00