Commit Graph

21957 Commits

Author SHA1 Message Date
Devang Patel
d9d99ff8e8 Update bitcode reader and writer to handle multiple return values.
Take 2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 01:29:32 +00:00
Devang Patel
aaeb60ae40 Pass const vectors by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:12:13 +00:00
Dan Gohman
545914311a Revert the assert for MUL_LOHI with an unused high result; Chris
pointed out that this isn't correct at -O0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:43:48 +00:00
Dale Johannesen
14e2ea9a55 Revise previous patch per review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47573 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:29:22 +00:00
Dan Gohman
c2d9b5fcdf Add an assert to verify that we don't see an
{S,U}MUL_LOHI with an unused high value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 22:15:55 +00:00
Dan Gohman
fcf81db600 Remove the hack that turned an {S,U}MUL_LOHI with an unused high
result into a MUL late in the X86 codegen process. ISD::MUL is
once again Legal on X86, so this is no longer needed. And, the
hack was suboptimal; see PR1874 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:57:04 +00:00
Dan Gohman
f6283fd27b Make some static variables const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47566 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:39:34 +00:00
Dan Gohman
2e68b6f52d Convert MaskedValueIsZero and all its users to use APInt. Also add
a SignBitIsZero function to simplify a common use case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 21:11:39 +00:00
Evan Cheng
e83a27516c All remat'ed loads cannot be folded into two-address code. Not just argument loads. This change doesn't really have any impact on codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:24:01 +00:00
Dale Johannesen
079f2a66ae Expand removal of MMX memory copies to allow 1 level
of TokenFactor underneath chain (seems to be enough)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:20:14 +00:00
Duncan Sands
1a9c9df1db In debug builds check that the key property holds: all
result and operand types are legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 16:21:21 +00:00
Evan Cheng
79a0c1e46c Correctly determine whether a argument load can be folded into its uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47545 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 08:50:41 +00:00
Owen Anderson
c0808a7e1d Fix an issue where GVN was performing the return slot optimization when it was
not safe.  This is fixed by more aggressively checking that the return slot is
not used elsewhere in the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 04:08:09 +00:00
Evan Cheng
b9a905781e Temporarily reverting 46959.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47542 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 03:57:32 +00:00
Owen Anderson
0f7ea1ab10 Fix an issue where GVN would try to use an instruction before its definition when performing return slot optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 00:40:41 +00:00
Duncan Sands
14fd63cae8 Add support to LegalizeTypes for building legal vectors
out of illegal elements (BUILD_VECTOR).  Uses and beefs
up BUILD_PAIR, though it didn't really have to.  Like
most of LegalizeTypes, does not support soft-float.
This cures all "make check" vector building failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 07:36:03 +00:00
Bill Wendling
181eb737b2 Some platforms use the same name for 32-bit and 64-bit registers (like
%r3 on PPC) in their ASM files. However, it's hard for humans to read
during debugging. Adding a new field to the register data that lets you
specify a different name to be printed than the one that goes into the
ASM file -- %x3 instead of %r3, for instance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-24 00:56:13 +00:00
Evan Cheng
1df439773c Backing out r47521 for now. This has broken a number of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 19:32:32 +00:00
Scott Michel
a59d469e9b Merge current work back to tree to minimize diffs and drift. Major highlights
for CellSPU modifications:

- SPUInstrInfo.td refactoring: "multiclass" really is _your_ friend.
- Other improvements based on refactoring effort in SPUISelLowering.cpp,
  esp. in SPUISelLowering::PerformDAGCombine(), where zero amount shifts and
  rotates are now eliminiated, other scalar-to-vector-to-scalar silliness
  is also eliminated.
- 64-bit operations are being implemented, _muldi3.c gcc runtime now
  compiles and generates the right code. More work still needs to be done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 18:41:37 +00:00
Evan Cheng
249ded3fa8 Rematerialization logic was overly conservative when it comes to loads from fixed stack slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47529 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 03:38:34 +00:00
Evan Cheng
298bbe82cb If remating a machine instr with virtual register operand, make sure the vr is avaliable at all uses regardless of whether it would be folded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47526 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 02:14:42 +00:00
Evan Cheng
c19eca38ef Turning on remat of pic loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 02:07:42 +00:00
Dan Gohman
61e015fe74 Fix a bug that caused opt and other tools to silently ignore
invalid command-line options.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:55:25 +00:00
Evan Cheng
b2a0abce1e No need recognize load from a fixed argument slot as re-materializable. LiveIntervalAnalysis already handles it as a special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47522 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:47:44 +00:00
Devang Patel
e9fabd94ab Properly read and write bitcodes for multiple return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:44:55 +00:00
Evan Cheng
dd3465eed1 Recognize loads of arguments as re-materializable first. Therefore if isReallyTriviallyReMaterializable() returns true it doesn't confuse it as a "normal" re-materializable instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:44:27 +00:00
Devang Patel
2007173203 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:17:37 +00:00
Devang Patel
155b8746ba Use isa check instead of getTypeID() check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47518 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:17:17 +00:00
Ted Kremenek
57daefa187 Fixed buffer overflow reported by Argiris Kirtzidis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:11:40 +00:00
Devang Patel
377e04b926 print getresult operand and its type directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:04:26 +00:00
Devang Patel
d7313c5608 Use dyn_cast instead of isa + cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:47:00 +00:00
Devang Patel
6bfc63bef9 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47509 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:38:56 +00:00
Devang Patel
57ef4f46c1 To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:35:18 +00:00
Evan Cheng
313d4b8093 Fix spill weight updating bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47507 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:33:04 +00:00
Dale Johannesen
22c3979fca Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 22:17:59 +00:00
Evan Cheng
672e550601 Same isPhysRegAvailable bug as local register allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 20:31:32 +00:00
Evan Cheng
bcfa1ca976 Really really bad local register allocator bug. On X86, it was never using ESI, EDI, and EBP because of a bug in RALocal::isPhysRegAvailable(). For example, when
it checks if ESI is available, it then looks at registers aliases to ESI. SIL is marked -2 (not allocatable) but isPhysRegAvailable() incorrectly assumes it is in use and returns false for ESI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 20:30:53 +00:00
Evan Cheng
9af7090392 Add debugging printfs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 19:57:06 +00:00
Devang Patel
bd41a064ed Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 19:31:30 +00:00
Devang Patel
1b76c759ac Use SymbolicValueRef to parse getresult operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47494 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 19:31:15 +00:00
Evan Cheng
b2fd65f936 Make sure reload of implicit uses are issued before remat's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47492 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 19:22:06 +00:00
Dale Johannesen
dc6c0f151b Generated files for 47484.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47485 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:50:51 +00:00
Dale Johannesen
08e78b18b8 Pass alignment on ByVal parameters, from FE, all
the way through.  It is now used for codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:49:45 +00:00
Dale Johannesen
3edd6dcf82 MMX vectors are passed 4-byte aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:47:28 +00:00
Anton Korobeynikov
47ccf1af3a Provide __main hooks for cygwin & mingw32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 10:08:31 +00:00
Zhou Sheng
58d13af6f0 Fixed a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47478 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 10:00:35 +00:00
Evan Cheng
d8850a512e Allow re-materialization of pic load (controlled by -remat-pic-load for now).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 09:25:47 +00:00
Evan Cheng
d70dbb5d62 Enable re-materialization of instructions which have virtual register operands if
the definition of the operand also reaches its uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47475 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 09:24:50 +00:00
Chris Lattner
d2b1fb27df copy mmx values from/to memory with GPRs on x86-32
instead of with mmx registers.  This horribleness is apparently
done by gcc to avoid having to insert emms in places that really 
should have it.  This is the second half of rdar://5741668.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 05:18:04 +00:00
Devang Patel
452743e5e4 Print getresult instruction properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47473 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 03:10:23 +00:00