Commit Graph

18148 Commits

Author SHA1 Message Date
Chris Lattner
5c6e2db0c4 simplify (x+c)^signbit as (x+c+signbit), pointed out by PR1288. This implements
test/Transforms/InstCombine/xor.ll:test28


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35584 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 05:36:22 +00:00
Chris Lattner
c995123182 reduce use of std::set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35576 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:44:59 +00:00
Chris Lattner
d9c3a0d7cc Various passes before isel split edges and do other CFG-restructuring changes.
isel has its own particular features that it wants in the CFG, in order to
reduce the number of times a constant is computed, etc.  Make sure that we
clean up the CFG before doing any other things for isel.  Doing so can
dramatically reduce the number of split edges and reduce the number of
places that constants get computed.  For example, this shrinks
CodeGen/Generic/phi-immediate-factoring.ll from 44 to 37 instructions on X86,
and from 21 to 17 MBB's in the output.  This is primarily a code size win,
not a performance win.

This implements CodeGen/Generic/phi-immediate-factoring.ll and PR1296.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35575 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:35:34 +00:00
Lauro Ramos Venancio
9996663fc6 - Divides the comparisons in two types: comparisons that only use N and Z
flags (ARMISD::CMPNZ) and comparisons that use all flags (ARMISD::CMP).
- Defines the instructions: TST, TEQ (ARM) and TST (Thumb).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35573 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:30:03 +00:00
Reid Spencer
dc1966e6ba For PR1297:
Make sure that the CTPOP result is casted to i32 as the bit counting
intrinsics all return i32 now (this affects CTLZ and CTTZ as well).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35567 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-02 01:01:49 +00:00
Chris Lattner
fe35555d09 print the type of an inserted IV in -debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35563 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 22:21:39 +00:00
Chris Lattner
55fc8c4c39 simplify this code, make it work for ap ints
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35561 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 20:57:36 +00:00
Chris Lattner
3e9f1d09c0 fix breakage from last night, simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 20:49:36 +00:00
Reid Spencer
e613555fd9 The bit counting intrinsics return i32 not the operand type. This fixes
last night's regression in SingleSource/UnitTests/2005-05-11-Popcount-ffs-fls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35556 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 18:42:20 +00:00
Zhou Sheng
3a507fda84 Avoid unnecessary APInt construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 17:13:37 +00:00
Evan Cheng
3074d9df96 Add i16 address mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35551 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 08:06:46 +00:00
Reid Spencer
e9391fd9b5 For PR1297:
Support overloaded intrinsics bswap, ctpop, cttz, ctlz.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35547 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:35:23 +00:00
Reid Spencer
a4f9c4d29a For PR1297:
Adjust for changes in the bit counting intrinsics. They all return i32
now so we have to trunc/zext the DAG node accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35546 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:34:11 +00:00
Reid Spencer
577cc32d9a For PR1297:
Change getOperationName to return std::string instead of const char*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35545 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:32:19 +00:00
Reid Spencer
1437a09765 For PR1297:
Implement "actual" argument types for the Intrinsic member functions. This
involves changing the getName, getType, and getDeclaration methods to have
optional parameters for the actual types. These are necessary in order for
the type/name to be constructed properly for overloaded intrinsics. Only
the caller knows the actual argument types desired.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35541 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:25:33 +00:00
Reid Spencer
559d77afb3 For PR1297:
1. Clear up confusion between "GotBits" and "ExpectBits". GotBits is the
   type actually provided. ExpectedBits is the type expected for the
   intrinsics. Before this patch, it was reversed!
2. Implement checks for overloaded intrinsics. This involves computing the
   suffix expected and making sure the suffix matches the function name. It
   also includes some intrinsic-specific checks such as ensuring that the
   bswap parameter and result are the same width and an even number of bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 07:22:57 +00:00
Chris Lattner
6abbdf90dd Fix InstCombine/2007-03-31-InfiniteLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 05:36:37 +00:00
Nick Lewycky
9babd0e0f2 Implement union of wrapped sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35534 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-01 03:47:44 +00:00
Andrew Lenharth
a697b8d83d Readme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35533 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 15:05:44 +00:00
Anton Korobeynikov
ad7baee241 Consistency with native compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35532 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 13:11:52 +00:00
Bill Wendling
577c7d9dca Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35531 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 09:36:12 +00:00
Chris Lattner
fcb1e61a43 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35530 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 07:06:25 +00:00
Chris Lattner
c8d288f8fa move a bunch of code out of the sdisel pass into its own opt pass "codegenprepare".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35529 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:18:03 +00:00
Chris Lattner
dbe0deca33 Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35528 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:06:36 +00:00
Chris Lattner
d2f340b746 switch TL::getValueType to use MVT::getValueType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35527 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:05:24 +00:00
Chris Lattner
2df6dc579c add a method to turn a type into a VT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35526 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 04:03:02 +00:00
Zhou Sheng
1c5d163634 Delete dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 02:50:26 +00:00
Zhou Sheng
b9cb95f8e3 Use APInt operators to calculate the carry bits, remove this loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35524 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 02:38:39 +00:00
Bill Wendling
db5c993121 Match GCC's MMX calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35523 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 01:03:53 +00:00
Chris Lattner
31442f9dc5 Add a -print-lsr-output option to LLC, to print the output of the LSR pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35522 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-31 00:24:43 +00:00
Chris Lattner
c9addb7488 implement the new addressing mode description hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35521 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 23:15:24 +00:00
Chris Lattner
1436bb657d add one addressing mode description hook to rule them all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35520 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 23:14:50 +00:00
Dale Johannesen
2041a0ef75 Fix incorrect combination of different loads. Reenable zext-over-truncate
combination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35517 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 21:38:07 +00:00
Evan Cheng
7cb33c8652 Don't add the same MI to register reuse "last def/use" twice if it reads the
register more than once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35513 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 20:21:35 +00:00
Evan Cheng
2f52457539 Bug fix for PR1279. When isDead is propagate by copy coalescing, we keep length
of dead def live interval at 1 to avoid multiple def's targeting the same
register. The previous patch missed a case where the source operand is live-in.
In that case, remove the whole interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 20:18:35 +00:00
Zhou Sheng
302748dd30 Make sure the use of ConstantInt::getZExtValue() for shift amount safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 17:20:39 +00:00
Reid Spencer
97e0c22330 For PR1293:
* Rename the FunctionType* parameter from M to FT on all the functions.
* Implement a fix for PR1293 by just asserting that library functions that
  must return pointers should have pointer typed results. This just makes
  sure that we don't attempt to use an uninitialized integer or something
  later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 16:41:50 +00:00
Zhou Sheng
0e2d3ac0f8 1. Make sure the use of ConstantInt::getZExtValue() for getting shift
amount is safe.
2. Use new method on ConstantInt instead of (? :) operator.
3. Use new method uge() on ConstantInt to simplify codes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35505 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 09:29:48 +00:00
Zhou Sheng
90b9681886 Use APInt operation instead of ConstantExpr::getXX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 05:45:18 +00:00
Reid Spencer
0d60b5a543 For PR1289: Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35500 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 01:37:39 +00:00
Reid Spencer
cd5bd90a7b For PR1289:
Check at the end of the parse that there are no unresolved types and no
undefined values. Issue errors if there are. This gets rid of the need
for implementation or checkpoint by ensuring you can't finish a parse with
undefined things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 01:37:13 +00:00
Bill Wendling
e2501b303c Add MMX calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35489 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-30 00:35:22 +00:00
Evan Cheng
87c6c9abb3 New entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35480 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 21:40:13 +00:00
Evan Cheng
5e3c203cfd Can't re-materialize mov r, imm in thumb since mov would clobber the condition code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35479 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 21:38:31 +00:00
Reid Spencer
1ea733db9d Use the stat information in the Path object, if it is already obtained. This
avoids a call to ::fstat by MappedFile when the file size information was
already obtained by the Path object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:11:22 +00:00
Reid Spencer
8475ec068c For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 19:05:44 +00:00
Chris Lattner
f735f7b3ac the bytecode reader supports dematerializeFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 18:58:08 +00:00
Reid Spencer
3025dfd5b5 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 18:50:01 +00:00
Reid Spencer
a5005c077b Give users a grace period on the implementation keyword. This *will* get
removed in a few days.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 18:49:28 +00:00
Jeff Cohen
e2cd2a0b4b MS C does have inlining after all, just uses _inline instead of inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35467 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-29 17:42:21 +00:00