Commit Graph

3315 Commits

Author SHA1 Message Date
Reid Spencer
6addf2ceeb Use TargetData to obtain the correct size of the "size_t" argument for
functions like memcpy, memmove and memset. Ensure only one prototype is
used for these functions and that it matches the system definition by
using the appropriate type for the size argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33618 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-29 17:42:06 +00:00
Reid Spencer
1e9126b3c4 For PR1138:
Force memcpy to be the 32-bit variant. Since this is only used with
CBE and lli which both target 32-bit machines, this should be okay.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33608 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 22:28:00 +00:00
Anton Korobeynikov
6aa279dc8b Arguments are counting from 1. not from 0. Maybe we should change
numbering somehow? E.g. make return argument the last?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33606 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 18:01:49 +00:00
Anton Korobeynikov
ac2b2cf88c More cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33605 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 16:04:40 +00:00
Anton Korobeynikov
b10308e440 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 13:31:35 +00:00
Bill Wendling
5d73a2a156 Use TargetELFWriterInfo class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33573 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-27 02:55:44 +00:00
Nate Begeman
6635f35cae Handle multiple functions, properly mangle symbols, and fix support for
scattered relocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 22:39:48 +00:00
Jim Laskey
6da186480b rename files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33552 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 21:38:26 +00:00
Jim Laskey
44c3b9fdd4 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 21:22:28 +00:00
Jim Laskey
1ee2925742 Make LABEL a builtin opcode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33537 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 14:34:52 +00:00
Jim Laskey
2b935d55b0 Clarify some constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33536 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 14:19:17 +00:00
Evan Cheng
02a2029141 Added a MRegisterInfo hook that tells PEI the target is responsible for
rounding the stack frame to a multiple of stack alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-25 22:12:41 +00:00
Jim Laskey
1a4a83ca39 1. Remove dwarf-verbose option (now asm-verbose.)
2. Clean up end of lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33499 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-25 15:45:58 +00:00
Jim Laskey
f1cdea1d02 Migrate print routines to asm to be shared by exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-25 15:12:02 +00:00
Jim Laskey
5e73d5bd2e Repair debug frames as a prelude to eh_frames. Switched to using MachineMoves
by value so that clean up is less confusing (these vectors tend to be small.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33488 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-24 18:45:13 +00:00
Jim Laskey
f9e56198a3 Use asm printer to emit alignment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33485 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-24 13:12:32 +00:00
Bill Wendling
2b7218218f Make ivars private and use getters. Have the MachOWriter return "Mach-O
Writer" for the pass name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33483 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-24 07:13:56 +00:00
Evan Cheng
de268f7dcf Renamed getTypeAlignmentShift() to getPreferredTypeAlignmentShift().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33482 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-24 07:03:39 +00:00
Bill Wendling
a4b7324fa0 Use the TargetMachOWriterInfo class to get this information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33478 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-24 03:38:47 +00:00
Evan Cheng
367372a30c PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33460 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-23 09:38:11 +00:00
Chris Lattner
08a4d5a343 Switch this to use SmallSet to avoid mallocs in the common case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33457 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-23 00:59:48 +00:00
Chris Lattner
fad2912522 Fix a bunch of inline asm failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-23 00:36:17 +00:00
Evan Cheng
f6d039a039 Remove the DoubleTy special case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-22 23:13:55 +00:00
Reid Spencer
24d6da5fed For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-21 00:29:26 +00:00
Chris Lattner
58092e35a3 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 22:35:55 +00:00
Evan Cheng
597a3bde35 Fix for PR1108: type of insert_vector_elt index operand is PtrVT, not MVT::i32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 10:10:26 +00:00
Evan Cheng
70cfa88944 Remove an unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33396 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 09:21:54 +00:00
Evan Cheng
57a2306074 We not align the final stack slot but instead let the target do so in emitPrologue(). Each target can make adjustments to the stack frame and re-align the stack as it deem appropriate. Do not align it twice which can end up wasting stack space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 02:07:13 +00:00
Evan Cheng
3c82cab9aa GetRegForReload() now keeps track which registers have been considered and rejected during its quest to find a suitable reload register. This avoids an infinite loop in case like this:
t1 := op t2, t3
  t2 <- assigned r0 for use by the reload but ended up reuse r1
  t3 <- assigned r1 for use by the reload but ended up reuse r0
  t1 <- desires r1
        sees r1 is taken by t2, tries t2's reload register r0
        sees r0 is taken by t3, tries t3's reload register r1
        sees r1 is taken by t2, tries t2's reload register r0 ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33382 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 22:40:14 +00:00
Reid Spencer
c10305743c For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:13:56 +00:00
Evan Cheng
42d7ccfd8e Remove this xform:
(shl (add x, c1), c2) -> (add (shl x, c2), c1<<c2)
Replace it with:
(add (shl (add x, c1), c2), ) -> (add (add (shl x, c2), c1<<c2), )

This fixes test/CodeGen/ARM/smul.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33361 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 17:51:44 +00:00
Bill Wendling
c904a5b925 Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33316 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:23:11 +00:00
Chris Lattner
393a8eea3c add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33314 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:12:56 +00:00
Bill Wendling
203d3e4386 Changed to use the OutputBuffer instead of the methods in MachO and ELF
writers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 22:22:31 +00:00
Bill Wendling
e911615c47 Revert patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33298 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 09:06:13 +00:00
Bill Wendling
157c4eeb4d Use the methods in the TargetObjInfo object instead of internal methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 03:49:21 +00:00
Chris Lattner
c4e664bb9d Fix PR1114 and CodeGen/Generic/2007-01-15-LoadSelectCycle.ll by being
careful when folding "c ? load p : load q" that C doesn't reach either load.
If so, folding this into load (c ? p : q) will induce a cycle in the graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33251 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 05:59:59 +00:00
Chris Lattner
938ab02256 add options to view the dags before the first or second pass of dag combine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33249 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 04:55:25 +00:00
Bill Wendling
eb9a42c90b Fix for PR1095:
LLVM would miscompile ASM dialects when compiling for PPC. Added dialects for
the X86 and PPC backends. It defaults to "0", the first variant of a compound
inline asm expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33246 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 03:42:04 +00:00
Chris Lattner
42a7551725 rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Chris Lattner
0ee69bbd33 eliminate calls to Type::isInteger, preferring isIntegral instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:03:16 +00:00
Reid Spencer
e5530da208 Compensate for loss of DerivedTypes.h in TargetLowering.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:31:12 +00:00
Reid Spencer
02114aa0e5 Move a function out of line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:30:31 +00:00
Evan Cheng
79cca507fe Minor fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33149 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:51:10 +00:00
Chris Lattner
a875df3aaa Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:15:09 +00:00
Reid Spencer
a54b7cbd45 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
579dca12c2 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 04:24:46 +00:00
Evan Cheng
56966225d1 Store default libgcc routine names and allow them to be redefined by target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33105 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 02:11:51 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00