Commit Graph

18122 Commits

Author SHA1 Message Date
Evan Cheng
a8a155e77f More flexible TargetLowering LSR hooks for testing whether an immediate is
a legal target address immediate or scale.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 23:28:50 +00:00
Evan Cheng
5eef2d21a0 Use new TargetLowering addressing modes hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 23:27:37 +00:00
Evan Cheng
37e8856f74 Stupid bug: SSE2 supports v2i64 add / sub.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35070 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 22:58:52 +00:00
Reid Spencer
4fd8606791 Revert the last patch as it violates the conditions of sext/zext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 18:37:25 +00:00
Jeff Cohen
2b7d7b57ae Unbreak C++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 17:57:00 +00:00
Jeff Cohen
c4558fde76 Unbreak VC++ build. Do not use identifiers starting with _ as they are reserved and
can collide with system defined names.  Windows defines _BB, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 17:56:27 +00:00
Zhou Sheng
7d820f57e2 For APInt::z/sext(width), if width == BitWidth, just return *this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 17:47:45 +00:00
Reid Spencer
8cb6834ccf Add an APInt version of SimplifyDemandedBits.
Patch by Zhou Sheng.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35064 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 17:25:59 +00:00
Reid Spencer
6b79e2d202 Add an APInt version of ShrinkDemandedConstant.
Patch by Zhou Sheng.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 17:15:10 +00:00
Zhou Sheng
edd089c86a Avoid to assert on "(KnownZero & KnownOne) == 0".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 16:54:56 +00:00
Zhou Sheng
430f626937 In function ComputeMaskedBits():
1. Replace getSignedMinValue() with getSignBit() for better code readability.
  2. Replace APIntOps::shl() with operator<<= for convenience.
  3. Make APInt construction more effective.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35060 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-12 05:44:52 +00:00
Nick Lewycky
e677a0b099 Add value ranges. Currently inefficient in both execution time and
optimization power.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-10 18:12:48 +00:00
Anton Korobeynikov
e2ff29c17c Use range tests in LowerSwitch, where possible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35057 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-10 16:46:28 +00:00
Nick Lewycky
3400e6af6b Add getter methods for the extremes of a ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35056 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-10 15:54:12 +00:00
Bill Wendling
c1fb0473ed Adding more arithmetic operators to MMX. This is an almost exact copy of
the addition. Please let me know if you have suggestions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35055 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-10 09:57:05 +00:00
Devang Patel
f7543fe35a Remove dead comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 23:41:03 +00:00
Devang Patel
a5b7dc5ef8 Avoid recursion. Use iterative algorithm for RenamePass().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35052 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 23:39:14 +00:00
Devang Patel
4fe26582c0 Increment iterator now because IVUseShouldUsePostIncValue may remove
User from the list of I users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 21:19:53 +00:00
Reid Spencer
afc378201d Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35050 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 21:19:09 +00:00
Evan Cheng
1a9da0d66c Minor stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35049 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 19:46:06 +00:00
Evan Cheng
44f4fca3c0 Add comments about LSR / ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35048 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 19:35:33 +00:00
Evan Cheng
2265b49193 Unfinished work and ideas related to register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35047 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 19:34:51 +00:00
Reid Spencer
87707b90b1 For PR1245:
Account for the sign bit when computing the number of bits required for
a negative integer literal constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35046 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 19:26:52 +00:00
Dale Johannesen
818c085232 apply comments from review of last patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35045 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 19:18:59 +00:00
Dale Johannesen
a6bc6fc170 Add some observations from CoreGraphics benchmark. Remove register
scavenging todo item, since it is now implemented.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35044 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 17:58:17 +00:00
Anton Korobeynikov
349ec1c11b Unbreak mingw32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35042 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 11:53:34 +00:00
Evan Cheng
e2ee99620f If a virtual register is already marked alive in this block, that means it is
alive in one of the successor block. Do not add it to the kill list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35041 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 09:48:56 +00:00
Evan Cheng
219705131d Print preds / succs BB numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35040 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 08:29:08 +00:00
Evan Cheng
f0e3bb1333 Avoid variable shadowing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-09 06:02:17 +00:00
Bill Wendling
47992ea4be Don't use std::hex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 23:37:24 +00:00
Bill Wendling
3bae2e97d9 Don't use a cast. It causes an error on some platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 23:26:50 +00:00
Evan Cheng
23a9570494 Implement inline asm modifier c.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 22:42:46 +00:00
Chris Lattner
6dfc6806bf implement support for floating point constants used as inline asm memory operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 22:29:47 +00:00
Bill Wendling
2f88dcdfb3 Added "padd*" support for MMX. Added MMX move stuff to X86InstrInfo so that
moves, loads, etc. are recognized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35031 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 22:09:11 +00:00
Evan Cheng
b582b1b1fc Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35030 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 21:59:30 +00:00
Devang Patel
d46825c6a1 Speed Up Pass Manager.
- Check Immutableness before searching PreservedSet.
- Avoid unnecessary traversal while setting Last User.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35028 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 19:05:01 +00:00
Zhou Sheng
a47f60bfaf Fix a bug in function ComputeMaskedBits().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35027 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 15:15:18 +00:00
Evan Cheng
032953d747 Putting more constants which do not contain relocations into .literal{4|8|16}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 08:31:54 +00:00
Chris Lattner
b4ddac9bf7 make this fail even in non-assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 07:07:03 +00:00
Chris Lattner
97f9df1cd1 This appears correct, enable it so we can see perf changes on testers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 07:03:55 +00:00
Chris Lattner
c14d3cac4b Second half of PR1226. This is currently still disabled, until I have a chance to
do the correctness/performance analysis testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35023 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 06:36:54 +00:00
Zhou Sheng
9a28daa864 Fix a bug in APIntified ComputeMaskedBits().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 05:42:00 +00:00
Evan Cheng
bf822eb6a3 Change register allocation order to Dale's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 02:56:40 +00:00
Evan Cheng
11788fde93 Bug fix. Not advancing the register scavenger iterator correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35020 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 02:55:08 +00:00
Reid Spencer
e7816b5c9e For PR1205:
Provide an APIntified version of MaskedValueIsZero. This will (temporarily)
cause a "defined but not used" message from the compiler. It will be used
in the next patch in this series.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35019 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 01:52:58 +00:00
Reid Spencer
3e7594f187 For PR1205:
Add a new ComputeMaskedBits function that is APIntified. We'll slowly
convert things over to use this version. When its all done, we'll remove
the existing version.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35018 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 01:46:38 +00:00
Evan Cheng
98ded765c2 For Darwin, put constant data into .const, .const_data, .literal{4|8|16}
sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35017 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 01:25:25 +00:00
Evan Cheng
f0b5d56efd Put constant data to .const, .const_data, .literal{4|8|16} sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35016 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 01:07:07 +00:00
Evan Cheng
be346c9476 Add ReadOnlySection directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 01:00:38 +00:00
Evan Cheng
afe1581557 Added ContainsRelocations() to check if a constant might only be resolvable at load time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35014 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-08 00:59:12 +00:00
Evan Cheng
603b83ebcd Only safe to use a call-clobbered or spilled callee-saved register as scratch register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35010 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 20:30:36 +00:00
Bill Wendling
c32a7f98ab Remove useless pattern fragments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35009 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 18:23:09 +00:00
Anton Korobeynikov
d0b82b301d Refactoring of formal parameter flags. Enable properly use of
zext/sext/aext stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35008 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 16:25:09 +00:00
Anton Korobeynikov
6a143590b3 Cleanup: make SetCounter an instance variable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35007 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 08:25:02 +00:00
Evan Cheng
83060c544b Avoid combining indexed load further.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35005 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 08:07:03 +00:00
Devang Patel
5ee9997906 Now IndVarSimplify is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35003 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 06:39:01 +00:00
Bill Wendling
bc9bffa27b Properly support v8i8 and v4i16 types. It now converts them to v2i32 for
load and stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35002 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 05:43:18 +00:00
Devang Patel
54959d6cf6 Now LICM is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35001 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 04:41:30 +00:00
Anton Korobeynikov
a6199c87c2 Fix DWARF debugging information on x86/Linux and (hopefully)
Mingw32/Cygwin targets. This fixes PR978


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35000 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 02:47:57 +00:00
Evan Cheng
cb20998b3f ARM always use register scavenger. No longer reserves R12.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34999 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 02:46:23 +00:00
Evan Cheng
0ea12ec848 Fix some brittle code. Watch out for cases where register scavenger is pointing to deleted instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34998 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 02:38:05 +00:00
Devang Patel
3f1a1e0366 Now LoopUnroll is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34996 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 01:38:05 +00:00
Devang Patel
1bc89361c2 Now LoopUnswitch is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 00:26:10 +00:00
Evan Cheng
3d06cf4584 Fix one more Thumb eliminateFrameIndex bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34990 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-07 00:12:18 +00:00
Reid Spencer
bce30f1887 Fix all of last night's JIT failures in Prolangs-C++ by finishing the
implementation of getConstantValue().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34988 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 22:23:15 +00:00
Evan Cheng
e6257632fc Register scavenging is now on by default for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34987 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 22:02:53 +00:00
Evan Cheng
a90f3408b3 Make load / store optimizer use register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34986 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 21:59:20 +00:00
Evan Cheng
caddd590f7 Minor bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34985 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 21:58:15 +00:00
Devang Patel
0f54dcbf07 Now LoopStrengthReduce is a LoopPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34984 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 21:14:09 +00:00
Chris Lattner
edf2e8da25 big endian 32-bit systems (e.g. ppc32) want to return the high reg first, not
the lo-reg first.  This is fallout from my ppc calling conv change yesterday,
it fixes test/ExecutionEngine/2003-05-06-LivenessClobber.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 20:01:06 +00:00
Devang Patel
622adea47f Insert loop into LQ before visiting children.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34982 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 19:50:49 +00:00
Anton Korobeynikov
fb269cf3e7 Small eye-candy: use asciz directive everywhere, where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34981 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 19:25:02 +00:00
Devang Patel
c37177eb72 Use schedulePass() instead of assignPassManager() to add new LPPassManager.
This ensures that require analysis info is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34980 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 19:11:25 +00:00
Devang Patel
a885c06bdf Add LPPassManager::insertLoop().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34979 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 19:00:02 +00:00
Bill Wendling
a31bd27f12 Add LOAD/STORE support for MMX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34978 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 18:53:42 +00:00
Devang Patel
7a9a0695f2 LPPassManager::deleteLoopFromQueue() add meat. Cut-n-paste code from
LoopUnswitch pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34977 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 18:38:33 +00:00
Evan Cheng
cc1c427266 Code clean up. Prepare to use register scavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34976 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 18:02:41 +00:00
Devang Patel
22033be445 LPPassManager. Implement preparePassManager() hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34975 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 17:59:37 +00:00
Devang Patel
7b65dd91c1 Keep track of higher level analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 17:52:53 +00:00
Devang Patel
a5057d02c0 LPPassManager : Add initialization and finalizatino hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 16:59:03 +00:00
Evan Cheng
28b3c45109 Minor interface change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:05:14 +00:00
Evan Cheng
140e33cfd1 Scavenge a register using the register scavenger when needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34966 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:03:56 +00:00
Evan Cheng
87f8bf65dd If target decides to create an emergency spill slot, make sure it's closest to SP or frame pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34965 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:02:38 +00:00
Evan Cheng
b74a3e6fda Register scavenger is now capable of scavenging. It spills a register whose use of furthest away to make it available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34964 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 10:01:25 +00:00
Anton Korobeynikov
1d9baccc9b Use new SDIselParamAttr enumeration. This removes "magick" constants
from formal attributes' flags processing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34963 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 08:12:33 +00:00
Anton Korobeynikov
0db79d86de Enumerate SDISel formal parameter attributes. Make use of new
enumeration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34960 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 06:10:33 +00:00
Anton Korobeynikov
c6551ffdd5 Implement PR1240
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34959 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 05:32:48 +00:00
Reid Spencer
415c1f7438 1. Make StoreValueToMemory a little more efficient by not requiring caller
to make a copy of the GenericValue.
2. Fix a copy & paste bug in StoreValueToMemory where 64-bit values were
   truncated to 32


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34958 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 05:03:16 +00:00
Reid Spencer
5763105121 Fix some thinko's in the last patch. PtrSize has to be in bits and we
might need to zext not just trunc the value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34955 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:46:41 +00:00
Reid Spencer
7553c34135 Fix a bug in IntToPtr. Truncating to 64-bits only works if the integer
is larger. Adjust so that it truncates to pointer width, only if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:41:50 +00:00
Reid Spencer
38f6a15df6 Simplify code as a result of the change in GenericValue to have a single
integer field of type APInt instead of different sized integer fields.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34952 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:11:31 +00:00
Reid Spencer
f9536330d6 Radically simplify execution. This patch gets rid of all the special
handling for integer of various sizes. GenericValue now has just a single
integer field of type APInt. We use its facilities directly in the
execution of all instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34951 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:09:31 +00:00
Reid Spencer
bfcd5992d8 Adjust and simplify external function processing now that GenericValue has
a single integer field of type APInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:08:12 +00:00
Reid Spencer
d08050bd1e APInt's are no longer allocated on the heap because they are direct
members of GenericValue. Consequently the code to clean them up isn't
needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34948 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:06:48 +00:00
Reid Spencer
deca08d93d Remove the insufficient code in Interpreter::create that computed the
Target DataLayout incorrectly. For now, we'll trust that the module has
got the correct DataLayout. In the future, this needs to be changed to
tell the TargetData to be "current host".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34947 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:05:57 +00:00
Reid Spencer
8fb0f190a9 Simplify things significantly because GenericValue now has a single integer
field, of type APInt, instead of multiple integer fields. Also, get rid of
the special endianness code in StoreValueToMemory and LoadValueToMemory.
ExecutionEngine is always used to execute on the host platform so this is
now unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 03:04:04 +00:00
Devang Patel
30159729ad Use std::deque to manage loop queue inside LPPassManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34943 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 02:30:46 +00:00
Devang Patel
fe613905b3 Keep track of inherited analysis. For example, if a loop pass does not
preserve dominator info then it should update parent FPPassManager's
available analysis info to reflect this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34942 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 01:55:46 +00:00
Devang Patel
22a1cf9d3a Add preparePassManager() hook. This allows each pass to check whether
current active pass manager is appropriate or not.

A loop pass may consider current LPPassManager in appropraite if loop
pass is not preserving analysis information that is used by other
passes managed by current LPPassManager. In such situation, loop pass
can pop current LPPassManager from the PMStack using this  hook
and use new LPPassManager for itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 01:06:16 +00:00
Chris Lattner
b9a7bea99c Switch PPC return lower to use an autogenerated CC description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-06 00:59:59 +00:00
Reid Spencer
baf1e4b914 Remove an unnecessary if statement and adjust indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34939 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 23:36:13 +00:00
Bill Wendling
229baffc4e Add the emms intrinsic for MMX support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 23:09:45 +00:00
Devang Patel
cf5fb2b614 Current pass manager, not the parent pass manager, assumes the role of
last user when one of the managed pass uses info provided by parent pass
manager.

This was exposed by LPPassManager work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34936 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 22:57:49 +00:00
Devang Patel
7f99761143 Avoid constructing std::strings unless pass debugging is ON.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 20:01:30 +00:00
Devang Patel
55d5ac7b5b Account for time consumed by releaseMemory() properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34932 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 18:20:51 +00:00
Lauro Ramos Venancio
6d7dd8ef46 Use init_array/fini_array sections for static contructors/destructors when the ABI is AAPCS.
Fix SingleSource/Regression/C/ConstructorDestructorAttributes test on arm-linux-gnueabi.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34931 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 17:59:58 +00:00
Chris Lattner
372dda8881 This is the first major step of implementing PR1226. We now successfully
scalarrepl things down to elements, but mem2reg can't promote elements that
are memset/memcpy'd.  Until then, the code is disabled "0 &&".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34924 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 07:52:57 +00:00
Jeff Cohen
413bc8262e Ensure 64-bit correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:45:08 +00:00
Jeff Cohen
0a18267248 Implement memoryLimit on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34922 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 05:22:08 +00:00
Chris Lattner
3c69849696 fix a subtle bug that caused an MSVC warning. Thanks to Jeffc for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:11:19 +00:00
Chris Lattner
783ccdb5c4 Add some simplifications for demanded bits, this allows instcombine to turn:
define i64 @test(i64 %A, i32 %B) {
        %tmp12 = zext i32 %B to i64             ; <i64> [#uses=1]
        %tmp3 = shl i64 %tmp12, 32              ; <i64> [#uses=1]
        %tmp5 = add i64 %tmp3, %A               ; <i64> [#uses=1]
        %tmp6 = and i64 %tmp5, 123              ; <i64> [#uses=1]
        ret i64 %tmp6
}

into:

define i64 @test(i64 %A, i32 %B) {
        %tmp6 = and i64 %A, 123         ; <i64> [#uses=1]
        ret i64 %tmp6
}

This implements Transforms/InstCombine/add2.ll:test1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34919 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:02:29 +00:00
Jeff Cohen
ca5183d445 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-05 00:00:42 +00:00
Chris Lattner
d5fa214729 simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34914 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 23:16:36 +00:00
Chris Lattner
b654176cb4 fold away addc nodes when we know there cannot be a carry-out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34913 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:40:38 +00:00
Chris Lattner
bcf2484450 generalize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34910 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:08:45 +00:00
Chris Lattner
91153686f0 canonicalize constants to the RHS of addc/adde. If nothing uses the carry out of
addc, turn it into add.

This allows us to compile:

long long test(long long A, unsigned B) {
  return (A + ((long long)B << 32)) & 123;
}

into:

_test:
        movl $123, %eax
        andl 4(%esp), %eax
        xorl %edx, %edx
        ret

instead of:
_test:
        xorl %edx, %edx
        movl %edx, %eax
        addl 4(%esp), %eax   ;; add of zero
        andl $123, %eax
        ret


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34909 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:03:15 +00:00
Chris Lattner
175415e116 eliminate some ops if they have an undef RHS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34908 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 20:01:46 +00:00
Chris Lattner
8f3acf87a2 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 06:36:24 +00:00
Chris Lattner
569bdc7bb7 add missing braces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 06:13:52 +00:00
Chris Lattner
57939df2eb minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:50:21 +00:00
Reid Spencer
d7f3de655b Remove unneeded header file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34903 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:41:04 +00:00
Chris Lattner
f964f321eb Speed up -instcombine by 20% by avoiding a particularly expensive passmgr call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34902 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:27:24 +00:00
Chris Lattner
55091782c1 switch MarkAliveBlocks over to using SmallPtrSet instead of std::set, speeding
up simplifycfg by 20%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34901 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:20:48 +00:00
Chris Lattner
b1f5d8bf6f Speed up Loop::isLCSSAForm by using a hash table instead of a sorted vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34900 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 04:06:39 +00:00
Chris Lattner
9f3d738866 make better use of LCSSA information in RewriteLoopExitValues. Before, we
would scan the entire loop body, then scan all users of instructions in the
loop, looking for users outside the loop.  Now, since we know that the
loop is in LCSSA form, we know that any users outside the loop will be LCSSA
phi nodes.  Just scan them.

This speeds up indvars significantly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34898 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 03:43:23 +00:00
Reid Spencer
0797605204 Guard further against APInt operations with operands of unequal bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34897 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 01:25:35 +00:00
Chris Lattner
9caed5440d Implement PR1179/PR1232 and test/Transforms/IndVarsSimplify/loop_evaluate_[234].ll
This makes -indvars require and use LCSSA, updating it as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34896 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-04 01:00:28 +00:00
Chris Lattner
8b2d42c949 Fix CodeGen/Generic/fpowi-promote.ll and PR1239
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 23:43:21 +00:00
Chris Lattner
c9838f25d5 Make RewriteLoopExitValues far less nested by using continue in the loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34891 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 22:48:48 +00:00
Chris Lattner
a9569f10de Add an expand action for ISD label which just deletes the label.
This "fixes" PR1238.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34890 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 19:21:38 +00:00
Reid Spencer
b90fc7ed21 Remove unnecessary #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34889 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 18:29:16 +00:00
Reid Spencer
d4c0e62413 Deal with error handling better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 18:19:18 +00:00
Reid Spencer
bdc75089ab Make sure that when we store a value it is masked to its correct bit
width. This helps CBE work with non-standard integer bit widths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34885 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 16:33:33 +00:00
Reid Spencer
e0929364e8 Complete the APIntification of the interpreter. All asserts for > 64 bits
have been removed and dealt with. The interpreter should now be able to
execute any LLVM program using any bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 08:38:04 +00:00
Reid Spencer
f0f09a96f3 Avoid memory leakage by having caller construct the APInt for the
destination value of LoadValueFromMemory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34883 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 08:36:29 +00:00
Reid Spencer
a188bbe7ac Fix constant folding of fp->int bitcast for vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34880 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 08:32:46 +00:00
Evan Cheng
a7288df62d Only propagate IsKill if the last use is a kill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:32:37 +00:00
Reid Spencer
e1aa066216 Implement APInt support for the binary operators.
Move the getConstantExpr function towards the end of the file so we don't
need a dozen forward declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34877 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:22:22 +00:00
Reid Spencer
dea7ef1f17 1. Have the ExecutionContext keep track of the APInt's allocated and
ensure they are cleaned up when the stack frame exits.
2. Move a function to the Execution.cpp file where it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34876 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:19:55 +00:00
Nate Begeman
af80638869 http://llvm.org/bugs/show_bug.cgi?id=1237
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34875 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:18:18 +00:00
Reid Spencer
93a2875456 Implement loading and storing of APInt values from memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34874 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 06:18:03 +00:00
Nick Lewycky
f54949dc49 Emit low/high immediate loads properly for Linux/PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34871 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 05:29:51 +00:00
Chris Lattner
c739cd6d07 my recent change caused a failure in a bswap testcase, because it changed
the order that instcombine processed instructions in the testcase.  The end
result is that instcombine finished with:

define i16 @test1(i16 %a) {
        %tmp = zext i16 %a to i32               ; <i32> [#uses=2]
        %tmp21 = lshr i32 %tmp, 8               ; <i32> [#uses=1]
        %tmp5 = shl i32 %tmp, 8         ; <i32> [#uses=1]
        %tmp.upgrd.32 = or i32 %tmp21, %tmp5            ; <i32> [#uses=1]
        %tmp.upgrd.3 = trunc i32 %tmp.upgrd.32 to i16           ; <i16> [#uses=1]
        ret i16 %tmp.upgrd.3
}

which can't get matched as a bswap.

This patch makes instcombine more sophisticated about removing truncating
casts, allowing it to turn this into:

define i16 @test2(i16 %a) {
        %tmp211 = lshr i16 %a, 8
        %tmp52 = shl i16 %a, 8
        %tmp.upgrd.323 = or i16 %tmp211, %tmp52
        ret i16 %tmp.upgrd.323
}

which then matches as bswap.  This fixes bswap.ll and implements
InstCombine/cast2.ll:test[12].  This also implements cast elimination of
add/sub.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34870 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 05:27:34 +00:00
Nick Lewycky
b6431da7be Translate bit operations to English.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34868 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 03:14:40 +00:00
Evan Cheng
a16d4429e4 Watch out for cases like this:
entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0):
Live Ins: %r0 %r1 %r2 %r3
        %reg1032 = tMOVrr %r3<kill>
        %reg1033 = tMOVri8 1
        %reg1034 = tMOVri8 0
        tCMPi8 %reg1029<kill>, 0
        tBcc mbb<entry,0x8b06a10>, 0
    Successors according to CFG: 0x8b06980 0x8b06a10

entry (0x8b06980, LLVM BB @0x8b01b30, ID#12):
    Predecessors according to CFG: 0x8b056f0
        %reg1036 = tMOVrr %reg1034<kill>
    Successors according to CFG: 0x8b06a10

entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13):
    Predecessors according to CFG: 0x8b056f0 0x8b06980
        %reg1024<dead> = tMOVrr %reg1030<kill>
        ...

reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined,
r1 live range from function entry to the tMOVrr instruction are dead. Eliminate
r1 from the livein set of the entry BB, not the BB where the copy is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 02:18:00 +00:00
Chris Lattner
ec9c35826d add a top-level iteration loop to instcombine. This means that it will never
finish without combining something it is capable of.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34865 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 02:04:50 +00:00
Reid Spencer
af3e9468dc APIntify this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34863 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-03 00:48:31 +00:00
Reid Spencer
bee0f663d8 Finally get this patch right :)
Replace expensive getZExtValue() == 0 calls with isZero() calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:51:25 +00:00
Reid Spencer
502db93a8a Dang, I've done that twice now! Undo previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34860 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:37:53 +00:00
Reid Spencer
a5dae0cac0 Use more efficient test for one value in a ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34859 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:35:28 +00:00
Reid Spencer
4e69f48a0a Guard against huge loop trip counts in an APInt safe way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:31:34 +00:00
Evan Cheng
ae6421935b X86-64 VACOPY needs custom expansion. va_list is a struct { i32, i32, i8*, i8* }.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34857 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:16:35 +00:00
Reid Spencer
e8391e039e Make sure debug code is not evaluated in non-debug case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:15:21 +00:00
Reid Spencer
f1bed4c720 1. Sort switch cases using APInt safe comparison.
2. Make sure debug output of APInt values is safe for all bit widths.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:05:28 +00:00
Reid Spencer
4cf735b47e Use APInt safe isOne() method on ConstantInt instead of getZExtValue()==1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34854 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:03:17 +00:00
Reid Spencer
e1c99d4c69 Make sorting of ConstantInt be APInt clean through use of ult function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 23:01:14 +00:00
Reid Spencer
46f9c94bdd Fix ashr for bitwidths > 64. This is now validated up to 1024 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 22:39:11 +00:00
Anton Korobeynikov
f7dcfa81c5 Simplify things
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 21:50:27 +00:00
Chris Lattner
dbab386e23 Fix a significant algorithm problem with the instcombine worklist. removing
a value from the worklist required scanning the entire worklist to remove all
entries.  We now use a combination map+vector to prevent duplicates from
happening and prevent the scan.  This speeds up instcombine on a large file
from the llvm-gcc bootstrap from 189.7s to 4.84s in a debug build and from
5.04s to 1.37s in a release build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34848 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 21:28:56 +00:00
Chris Lattner
f22a5c6e9e minor cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34846 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 19:59:19 +00:00
Evan Cheng
5de3b7f351 Mark dead def as unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34844 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 10:43:16 +00:00
Evan Cheng
7b466d0481 Dead live-in detection bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34843 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 10:41:15 +00:00
Evan Cheng
6b448092bf - Keep track all def and uses of stack slot available in register.
- Available value use may be deleted (e.g. noop move).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34841 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 08:52:00 +00:00
Evan Cheng
c3dd314b78 Invalidate last use of a reused register if the use is a deleted noop copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 05:41:42 +00:00
Chris Lattner
82932a5e4a argument lowering should copy from the vreg shadows of live-in arguments
passed in registers, not directly from the pregs themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 05:12:29 +00:00
Chris Lattner
9b6f57c303 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 05:04:52 +00:00
Reid Spencer
f09aef7698 Use a better algorithm for rounding sqrt results. Change the FIXME about
this to a NOTE: because pari/gp results start to get rounded incorrectly
after 192 bits of precision. APInt and pari/gp never differ by more than
1, but APInt is more accurate because it does not lose precision after 192
bits as does pari/gp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34834 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 04:21:55 +00:00
Nick Lewycky
c6a28fcf5d Implement unionWith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34833 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 03:33:05 +00:00
Chris Lattner
67ef241f45 switch the inliner from being recursive to being iterative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34832 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 03:11:20 +00:00
Reid Spencer
9b4aeb3cc1 Fix an unequal bitwidth issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34831 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 02:59:25 +00:00
Reid Spencer
9bf94a4a9f Add a FIXME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34828 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 02:01:34 +00:00
Reid Spencer
36184ed4cd Fix a problem where shifting by 64-bits leads to incorrect results on PPC
but not on X86 becuase shift by word size is "undefined".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 01:19:42 +00:00
Dale Johannesen
9f8e50d4ed eliminate unnecessary reset of SP in epilog on darwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 01:17:17 +00:00
Reid Spencer
513d0f25ed Reverse a premature commital.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34822 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 00:31:39 +00:00
Reid Spencer
cae5754619 Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-02 00:28:52 +00:00
Reid Spencer
295e40aa5c Combine two lines that can be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 23:30:25 +00:00
Reid Spencer
35fa43907e Make it possible to create an SCEVUnknown from an APInt as well as an int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34816 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 22:28:51 +00:00
Reid Spencer
a3507ebd33 Although probably not necessary, guard against a potential assertion by
using isNullValue() instead of getZExtValue() == 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 21:54:37 +00:00
Reid Spencer
4da0451821 Use isUnitValue() instead of getZExtValue() == 1 which will prevent an
assert if the ConstantInt's value is large.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 21:51:23 +00:00
Reid Spencer
a0e0129e3f Use APInt conversion to string so the result is correct regardless of the
bit width of the ConstantInt being converted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 21:00:32 +00:00
Reid Spencer
0d54b7df4f Use the APInt versions of the bit-wise conversions of float/double to int
and back. While this is not strictly necessary, it does pave the way for
future changes in casting. It should now be possible to improve vector
casting to deal with un-equal fp/int sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34808 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:44:23 +00:00
Reid Spencer
bb9723bd98 Use modern variable name. ConstantUnsignedInt is long since dead. No
functional change with this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34806 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:27:41 +00:00
Jim Laskey
0102ca8f5a Emit eh filter info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:26:43 +00:00
Jim Laskey
59e8434a85 Collect eh filter info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34804 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:25:32 +00:00
Reid Spencer
e2a6acd13f Use a simpler constructor for ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:25:31 +00:00
Jim Laskey
0b4711bd94 Lower eh filter intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 20:24:30 +00:00
Reid Spencer
1ede29c951 Wrap a long line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34799 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:48:16 +00:00
Reid Spencer
4d050d7321 Avoid a potential assert out if the loop increment is > 64 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34798 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:45:00 +00:00
Reid Spencer
10794272f1 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:41:47 +00:00
Reid Spencer
62aa905595 The 64-bit constructor for ConstantInt changes from int64_t to uint64_t.
This caused a warning for construction with -1. Avoid the warning by using
-1ULL instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:33:52 +00:00
Reid Spencer
c7cd7a0bb1 Construct ConstantInt with simpler constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34795 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:32:33 +00:00
Reid Spencer
af1aacd91a Use a simpler constructor when constructing ConstantInt. Also, replace
verbose code to sext/trunc or zext/trunc and APInt with new methods on
that class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:32:01 +00:00
Reid Spencer
ef2185b4d2 Use a simpler constructor when constructing ConstantInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:31:12 +00:00
Reid Spencer
0050c737c5 Drop the ConstantInt(const Type&, const APInt&) constructor. It is
redundant and more verbose than the ConstantInt(const APInt&) constructor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 19:30:34 +00:00
Reid Spencer
4e1e87f09c Make the static table of results in sqrt const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 17:47:31 +00:00
Reid Spencer
e479ef0b41 Fix last night's 445.gobmk breakage which was caused by comparison of
APInt's of unequal bitwidth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34790 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 17:17:21 +00:00
Reid Spencer
68e2300ad9 Add methods for bit width modification: sextOrTrunc, zextOrTrunc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34789 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 17:15:32 +00:00
Anton Korobeynikov
9dd9abd87f Ensure that fastcall'ed function is correctly mangled & stack is
properly aligned


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34788 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 16:29:22 +00:00
Nicolas Geoffray
43c6e7cd9b Implemented the frameaddress intrinsic for PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34787 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 13:11:38 +00:00
Evan Cheng
a81a5ab357 Delete register scavenger when done with it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 10:23:33 +00:00
Evan Cheng
c1c2de0ae7 Use a spilled free callee-saved register as scratch register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 08:57:52 +00:00
Evan Cheng
5196b3680c Add a version of FindUnusedReg that restrict search to a specific set of registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34784 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 08:56:24 +00:00
Evan Cheng
f49407b790 - Track which callee-saved registers are spilled.
- Some code clean up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34783 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 08:26:31 +00:00
Reid Spencer
a6e8a955d6 Remove the "isSigned" parameters from ConstantRange. It turns out they
are not needed as the results are the same with or without it.

Patch by Nicholas Lewycky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34782 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 07:54:15 +00:00
Evan Cheng
cda067bad9 Switch from std::vector<bool> to BitVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34781 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 07:52:44 +00:00
Reid Spencer
e8019bb1fc APIntify various computations in ScalarEvolution
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 07:25:48 +00:00
Reid Spencer
b5ca2cd509 Use a real table in sqrt to shorten and quicken the code.
Thanks for the idea Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 06:23:32 +00:00
Bill Wendling
f1d6006ad6 Get rid of verboten <iostream> include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34777 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 06:05:39 +00:00
Reid Spencer
af8fb19846 Add a square root function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 05:39:56 +00:00
Reid Spencer
9e57414e69 Reduce #includage by taking a method out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 04:02:06 +00:00
Evan Cheng
c0ba1bc49b A restore is promoted to copy (or deleted entirely), remove the kill from the last use of the targetted register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34773 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:27:30 +00:00
Evan Cheng
23322d1427 Interface clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34772 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:25:51 +00:00
Evan Cheng
a3756ee7fe Interface clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34770 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:19:39 +00:00
Evan Cheng
8e92b4bae2 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34768 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:05:35 +00:00
Evan Cheng
88d1f587d2 Track all joined registers and eliminate unneeded kills after all joining are done.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34767 91177308-0d34-0410-b5e6-96231b3b80d8
2007-03-01 02:03:03 +00:00
Reid Spencer
6263cbada2 For PR1205:
Make GetConstantFactor compute its result using an APInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34765 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 23:31:17 +00:00
Dale Johannesen
b71aa2b6ca Changes requested in review of last pass. Also pulled isThumb into a
member, instead of resetting in every function that uses it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34764 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 23:20:38 +00:00
Evan Cheng
ad78ef2154 Doh. ARM::PC is obvious a reserved register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34763 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 23:12:34 +00:00
Reid Spencer
c6aedf70b3 For PR1205:
Adjust to changes in ConstantRange interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34762 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 22:03:51 +00:00
Reid Spencer
bb626a6751 Move ConstantRange class to lib/Support from lib/Analysis and make its
interface not depend on Type or ICmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34761 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 22:02:48 +00:00
Reid Spencer
3da43849f2 Provide an ICmpInst::makeConstantRange to generate a ConstantRange value
from a predicate and an APInt. This is removed from ConstantRange class
so that ConstantRange doesn't have to depend on lib/VMCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 22:00:54 +00:00
Jim Laskey
8782d481a3 Chain is on second operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34759 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 20:43:58 +00:00
Reid Spencer
581b0d453a For PR1205:
Remove ConstantInt from ConstantRange interface and adjust its users to
compensate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 19:57:34 +00:00
Reid Spencer
f57fc81fae Implement a convenience method to construct a ConstantInt directly from an
APInt. The implied type is the integer type that corresponds to the bit
width of the APInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 19:50:21 +00:00
Reid Spencer
dc5c159701 For PR1205:
First round of ConstantRange changes. This makes all CR constructors use
only APInt and not use ConstantInt. Clients are adjusted accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:57:32 +00:00
Dale Johannesen
f1b214d3ca Add intelligence about where to break large blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:41:23 +00:00
Chris Lattner
eac6607d7c remove dead option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:39:53 +00:00
Jim Laskey
3f09fc2ff8 Handle mix of personalities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34752 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:38:31 +00:00
Jim Laskey
63f3e3fa1d Provide a more meaningful name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34751 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:37:50 +00:00
Jim Laskey
64ce0ca90d MERGE_VALUES unnecessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34750 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:37:04 +00:00
Chris Lattner
70500805d5 bugfix: fastcall does not require the first two params to be marked 'inreg',
they always get registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34748 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 18:35:11 +00:00
Reid Spencer
663e711dc2 For PR1205:
Convert ConstantRange class to use APInt internally as its value type for
the constant range, instead of ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 17:36:23 +00:00
Reid Spencer
94900774ad Make the trunc/sext/zext methods return APInt& so that these operations
can be chained together with other operations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34743 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 17:34:32 +00:00
Nate Begeman
a0a6278c7c Fix a typo, thanks Bill!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 09:16:38 +00:00
Nate Begeman
fec910c3b9 More Mach-O writer improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:40:50 +00:00
Chris Lattner
e32bbf61c0 use high-level functions in CCState
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34739 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:09:55 +00:00
Chris Lattner
66baf26fe0 add methods for analysis of call results and return nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:09:40 +00:00
Chris Lattner
638402b253 make use of helper functions in CCState for analyzing formals and calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 07:00:42 +00:00
Chris Lattner
fb39f99fa4 add methods to analyze calls and formals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34736 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:56:37 +00:00
Chris Lattner
e5876ce21a add a newline at end of file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34735 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:42:11 +00:00
Chris Lattner
f5d280a0a6 switch LowerFastCCCallTo over to using the new fastcall description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34734 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:26:33 +00:00
Chris Lattner
fc664c1bc0 switch LowerFastCCArguments over to using the autogenerated Fastcall description.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:21:19 +00:00
Chris Lattner
011bcc8cdd add new CC_X86_32_FastCall calling conv, which describes fastcall on win32.
Factor out a CC_X86_32_Common convention, which is the part shared between
ccc, stdcall and fastcall


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:20:01 +00:00
Chris Lattner
fcf1a3de7a rearrange code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34731 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:10:12 +00:00
Chris Lattner
2db39b865e remove fastcc (not fastcall) support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34730 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 06:05:16 +00:00
Chris Lattner
f39f771b02 switch LowerCCCArguments over to using autogenerated CC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34729 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 05:46:49 +00:00
Chris Lattner
c0bdf3460c simplify sret handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 05:39:26 +00:00
Chris Lattner
423c5f44f8 switch LowerCCCCallTo over to using an autogenerated callingconv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 05:31:48 +00:00
Chris Lattner
370bdda526 rename stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 05:30:29 +00:00
Chris Lattner
62247f62ce rename some CCActions, add CCIfInReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34725 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 05:29:33 +00:00
Chris Lattner
59ed56b9ee switch return value passing and the x86-64 calling convention information
over to being autogenerated from the X86CallingConv.td file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34722 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 04:55:35 +00:00
Chris Lattner
3d5591038a make subtarget references work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34721 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 04:51:41 +00:00
Reid Spencer
fa1353ca52 Implement reading of arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:25:48 +00:00
Reid Spencer
9abd138a30 Implement writing of arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34717 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:25:20 +00:00
Reid Spencer
38c91a9927 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34716 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:24:54 +00:00
Reid Spencer
c34ebfbcfd Implement arbitrary integer constants through the use of APInt values.
Positive, negative, and hexadecimal integer constants will now return an
APInt for values having > 64 bits of precision.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34715 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:24:27 +00:00
Reid Spencer
f231004a1c Implement support for aribrary precision integers by creating two new
tokens: ESAPINTVAL and EUAPINTVAL and adding an APInt* as a semantic value.
This allows us to extend the definition of an integer constant to allow
arbitrary precision integer constant values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34714 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 02:23:44 +00:00
Reid Spencer
ff60576646 Fix a bug in RoundDoubleToAPInt where it would force the size to 64 bits
instead of honoring the client's requested bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 01:30:08 +00:00
Evan Cheng
36230cdda4 Make requiresRegisterScavenging determination on a per MachineFunction basis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:59:19 +00:00
Evan Cheng
41a4d562f7 Temporary: make R12 available in ARM mode if RegScavenger is being used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34709 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:22:44 +00:00
Evan Cheng
1b051fc6a4 Start making use of RegScavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34708 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:21:58 +00:00
Evan Cheng
5e6df4647e PEI now passes a RegScavenger ptr to eliminateFrameIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34707 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:21:17 +00:00
Evan Cheng
37f15a6d48 MRegisterInfo disowns RegScavenger. It's immutable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34706 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-28 00:17:36 +00:00
Reid Spencer
f5c0fd9e16 Join two lines that can be joined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34705 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 23:49:07 +00:00
Reid Spencer
012d50b851 Pull out the stops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 23:33:03 +00:00
Reid Spencer
80f8481ef0 Remove some redundancy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34702 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 23:27:26 +00:00
Evan Cheng
15991bf775 Minor tweak. Allocate r0 to r3 in reverse order, r3 is least likely to be livein to a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34701 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 23:03:55 +00:00
Evan Cheng
898218cc5e Some more code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34700 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:58:43 +00:00
Chris Lattner
3e8a541bf4 reenable generation of CC info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34699 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:12:19 +00:00
Evan Cheng
8cab162e03 Oops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34698 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 22:10:52 +00:00
Reid Spencer
681dcd14e9 Implement countLeadingOnes() and getMinSignedBits(). This helps to minimize
the bit width of negative numbers by computing the minimum bit width for a
negative value. E.g. 0x1800000000000000 could be just 0x8000000000000000


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:59:26 +00:00
Evan Cheng
3fae29acef Back out previous commit temporarily.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34694 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:47:22 +00:00
Evan Cheng
5ef9226f30 Let MRegisterInfo now owns RegScavenger; eliminateFrameIndex must preserve register kill info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:12:35 +00:00
Evan Cheng
3f6fd87473 Let MRegisterInfo now owns RegScavenger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34691 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:10:33 +00:00
Evan Cheng
bb6fb3357d RegScavenger interface change to make it more flexible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34690 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 21:09:48 +00:00
Chris Lattner
f45803012c implement CCMatchIfCC in terms of CCMatchIf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34685 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 20:45:02 +00:00
Chris Lattner
8bcc4aea47 build cc info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34684 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 20:44:31 +00:00
Reid Spencer
914c3bca87 Adjust to changes in the APInt interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34681 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 20:25:25 +00:00
Reid Spencer
66ed1099ff Improve APInt interface:
1. Add unsigned and signed versions of methods so a "bool" argument doesn't
   need to be passed in.
2. Make the various getMin/getMax functions all be inline since they are
   so simple.
3. Simplify sdiv and srem code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34680 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 20:24:31 +00:00
Reid Spencer
96d91372fd Conform to single person attribution in file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34678 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 19:31:09 +00:00
Reid Spencer
a5c7472726 For PR1205:
Implement review feedback:
1. Use new APInt::RoundDoubleToAPInt interface to specify the bit width so
   that we don't have to truncate or extend in constant folding.
2. Fix a pasteo in SDiv that prevented a check for overflow.
3. Fix the shift operators: undef happens when the shift amount is equal
   to the bitwidth.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34677 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 19:29:54 +00:00
Reid Spencer
1fa111e8d4 1. Fix three serious bugs in the comparison code.
2. Change RoundDoubleToAPInt to take a bit width parameter. Use that
   parameter to limit the bit width of the result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 18:23:40 +00:00
Chris Lattner
dbec2d9dcf a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34670 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 17:21:09 +00:00
Devang Patel
84da80d10b Make getPassManagerType() const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34669 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 15:00:39 +00:00
Nicolas Geoffray
05c180b347 Fix parenthesis for BCTRL_{ELF|Macho} test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34668 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 13:10:41 +00:00
Nicolas Geoffray
63f8fb1993 Differentiate between the MachO and the ELF ABI the CALL instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34667 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 13:01:19 +00:00
Jim Laskey
d313a9b148 Duplicate use of LR, take 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34666 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 11:55:45 +00:00
Reid Spencer
940685ecf5 Allow the AsmWriter to print out arbitrary precision integers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34664 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 08:34:09 +00:00
Reid Spencer
8374db81a8 Correct the implelmentation of ConstantInt::getAllOnesValue() for bit
widths > 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 07:57:53 +00:00
Reid Spencer
b4d8ae5dfb Get rid of extraneous // in file comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 07:35:18 +00:00
Chris Lattner
d637a8b436 Add calling convention info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34661 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 06:59:52 +00:00
Reid Spencer
9472c373a3 For PR1205:
Implement constant folding via APInt instead of uint64_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34660 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 06:23:51 +00:00
Chris Lattner
00836648ae move target independent calling convention stuff to TargetCallingConv.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34659 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:57:32 +00:00
Chris Lattner
d50110d8dc fill in some holes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34658 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:51:05 +00:00
Chris Lattner
9774c915f1 switch x86-64 return value lowering over to using same mechanism as argument
lowering uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34657 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:28:59 +00:00
Chris Lattner
13513b7a50 Minor refactoring of CC Lowering interfaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34656 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 05:13:54 +00:00
Chris Lattner
362e98a5f5 move CC Lowering stuff to its own public interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34655 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 04:43:02 +00:00
Chris Lattner
9c71ab77cd refactor x86-64 argument lowering yet again, this time eliminating templates,
'clients', etc, and adding CCValAssign instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34654 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 04:18:15 +00:00
Chris Lattner
92f6feaf79 ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion with
lib/Analysis/ConstantFolding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34653 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 03:05:06 +00:00
Evan Cheng
3d3d627513 Backing out Jim's LR spill changes. This was causing llvm-gcc bootstrapping
to infinite loop:
PPCMachineFunctionInfo.h updated: 1.2 -> 1.3
PPCRegisterInfo.cpp updated: 1.110 -> 1.111
PPCRegisterInfo.h updated: 1.28 -> 1.29


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34652 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-27 02:55:29 +00:00