Commit Graph

16796 Commits

Author SHA1 Message Date
Evan Cheng ca5fb6e4fc Double and long preferred alignment is 8 byte.
llvm-svn: 33446
2007-01-22 23:09:50 +00:00
Evan Cheng 1efe904cd7 - getTypeAlignmentShift() should be returning preferred alignment, not ABI
alignment.
- getPreferredAlignmentLog(): remove Double special case.

llvm-svn: 33445
2007-01-22 23:08:19 +00:00
Evan Cheng 1281dc32ef Linux GOT indirect reference is only necessary in PIC mode.
llvm-svn: 33441
2007-01-22 21:34:25 +00:00
Evan Cheng 4abf2e7bcc Double and Long preferred alignment is 4 for Darwin, 8 for Linux.
llvm-svn: 33440
2007-01-22 21:24:13 +00:00
Evan Cheng 52189b5805 Use bl to call Thumb fuctions directly.
llvm-svn: 33433
2007-01-22 19:40:10 +00:00
Reid Spencer 31a4ef4dc1 Cleanup checks in the load and store of casted pointer transforms. Two
changes: (1) don't special case for i1 any more, (2) use the new
TargetData::getTypeSizeInBits method to ensure source and dest are the
same bit width.

llvm-svn: 33427
2007-01-22 05:51:25 +00:00
Jeff Cohen 5d956e4234 Fix this error:
llvm[2]: Compiling llvmAsmParser.cpp for Debug build
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y: In function 'int llvmAsmparse()':
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y:1846: error: expected `;' before '}' token

llvm-svn: 33425
2007-01-21 19:19:31 +00:00
Chris Lattner 71e123229c add a note
llvm-svn: 33423
2007-01-21 07:03:37 +00:00
Reid Spencer 6598ca8ab1 Whoops, fix typo in last commit.
llvm-svn: 33417
2007-01-21 02:29:10 +00:00
Reid Spencer 2eadb5310d For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!

llvm-svn: 33415
2007-01-21 00:29:26 +00:00
Reid Spencer 9a4bed06dd Revise the store V, (cast P) -> store (cast V) -> P transform.
We only want to do this if the src and destination types have the same
bit width. This patch uses TargetData::getTypeSizeInBits() instead of
making a special case for integer types and avoiding the transform if
they don't match.

llvm-svn: 33414
2007-01-20 23:35:48 +00:00
Reid Spencer 2239163496 Implement a getTypeSizeInBits method. This helps in transforms that want
to ensure the bit size of a type is identical before proceeding.

llvm-svn: 33413
2007-01-20 23:32:04 +00:00
Owen Anderson e52a235e99 TargetData assumes (and some regression tests depend on it) that the size of
an unspecified datatype in the datalayout is capped by the size of a pointer.

llvm-svn: 33411
2007-01-20 23:07:13 +00:00
Chris Lattner 6e38094235 trivial cleanup
llvm-svn: 33410
2007-01-20 22:39:15 +00:00
Chris Lattner 50ee0e40e5 Teach TargetData to handle 'preferred' alignment for each target, and use
these alignment amounts to align scalars when we can.  Patch by Scott Michel!

llvm-svn: 33409
2007-01-20 22:35:55 +00:00
Chris Lattner 7476fa4456 DOUT still evaluates side effects, even though it doesn't print. This means
that disassembleBuffer will be called even if NDEBUG, but the result will
be ignored.

llvm-svn: 33408
2007-01-20 20:51:43 +00:00
Reid Spencer 181fe4ad09 For PR808:
NetBSD also doesn't have pthread_mutexattr_setpshared

llvm-svn: 33406
2007-01-20 20:44:38 +00:00
Reid Spencer fff2797349 Implement the signed icmp instructions properly. To do this we introduce
a small inline function to sign extend a uint64_t value based on its
type's bitwidth. This function is then used in both executeSExtInst and
the various executeICMP_S** functions.

llvm-svn: 33403
2007-01-20 20:12:29 +00:00
Evan Cheng e3d8e42e27 Round up stack to multiple of alignment only if it's a leaf function without alloca.
llvm-svn: 33401
2007-01-20 10:22:33 +00:00
Evan Cheng 706b6797a0 One more try...
llvm-svn: 33400
2007-01-20 10:17:53 +00:00
Evan Cheng b268184363 Last check-in was bogus. There is no need to align the stack if the function is a leaf function (and without alloca).
llvm-svn: 33399
2007-01-20 10:11:56 +00:00
Evan Cheng 00a640dbe0 Fix for PR1108: type of insert_vector_elt index operand is PtrVT, not MVT::i32.
llvm-svn: 33398
2007-01-20 10:10:26 +00:00
Owen Anderson dfd79ad319 Correct a comment.
llvm-svn: 33397
2007-01-20 10:07:23 +00:00
Evan Cheng 887f75ac0a Remove an unused variable.
llvm-svn: 33396
2007-01-20 09:21:54 +00:00
Reid Spencer 3615cdf957 Implement bit-accurate sext instruction.
This patch fixes test/Integer/2007-01-17-TruncSext.ll

llvm-svn: 33394
2007-01-20 08:32:52 +00:00
Evan Cheng a9af4be5ac Prologue and epilogue bugs for non-Darwin targets.
llvm-svn: 33390
2007-01-20 03:24:07 +00:00
Evan Cheng aa24f08926 Clean up ARM PEI code.
llvm-svn: 33389
2007-01-20 02:09:25 +00:00
Evan Cheng 86468ccaf3 Backend is reponsible for aligning the stack.
llvm-svn: 33388
2007-01-20 02:08:16 +00:00
Evan Cheng 7ab6fa3a67 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.
llvm-svn: 33387
2007-01-20 02:07:13 +00:00
Evan Cheng fc74e2de26 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 ...

llvm-svn: 33382
2007-01-19 22:40:14 +00:00
Reid Spencer 9f900c1f92 Unbreak Darwin.
llvm-svn: 33375
2007-01-19 22:04:24 +00:00
Reid Spencer a96084901c Help the lli interpreter find the stderr/stdin/stdout symbols. These are
needed for output to be generated. On Linux these are both global vars and
macro definitions so we have to special case Linux.

llvm-svn: 33374
2007-01-19 21:41:04 +00:00
Reid Spencer dcf6f90033 Handle each of stderr/stdin/stdout separately.
llvm-svn: 33373
2007-01-19 21:30:39 +00:00
Reid Spencer adf4118a36 Remove dead methods in the ValTypes.
llvm-svn: 33372
2007-01-19 21:25:12 +00:00
Reid Spencer e928a15c9e For this transform: store V, (cast P) -> store (cast V), P
don't allow the transform if V and the pointer's element type are different
width integer types.

llvm-svn: 33371
2007-01-19 21:20:31 +00:00
Reid Spencer a94d394ad2 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.

llvm-svn: 33370
2007-01-19 21:13:56 +00:00
Evan Cheng 77c15ded10 Code clean up. Use def : pat instead of defining new instructions.
llvm-svn: 33368
2007-01-19 20:27:35 +00:00
Andrew Lenharth e082e2ac7f fix build on amd64
llvm-svn: 33367
2007-01-19 20:17:59 +00:00
Evan Cheng bf216c364f isDarwin -> isTargetDarwin
llvm-svn: 33366
2007-01-19 19:28:01 +00:00
Evan Cheng 1199c2d653 Restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific.

llvm-svn: 33365
2007-01-19 19:25:36 +00:00
Evan Cheng 023c7d667d Darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33364
2007-01-19 19:23:47 +00:00
Evan Cheng 181fe36d6c Introduce TargetType's ELF and Darwin.
llvm-svn: 33363
2007-01-19 19:22:40 +00:00
Evan Cheng df62250cee Modify emission of jump tables on darwin to emit an extra "l" label that
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.

llvm-svn: 33362
2007-01-19 18:59:56 +00:00
Evan Cheng 9201100b29 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

llvm-svn: 33361
2007-01-19 17:51:44 +00:00
Lauro Ramos Venancio 75aaf1fa6a Fix section definition.
llvm-svn: 33359
2007-01-19 17:33:22 +00:00
Anton Korobeynikov 3e956974b3 Adding disassembler interface and external hook to udis86 library.
llvm-svn: 33358
2007-01-19 17:25:17 +00:00
Evan Cheng 10043e215b ARM backend contribution from Apple.
llvm-svn: 33353
2007-01-19 07:51:42 +00:00
Nick Lewycky 28c5b8618a Needed to build on PPC Linux.
llvm-svn: 33352
2007-01-19 04:36:02 +00:00
Reid Spencer c043b437b3 Back out last changes for dataLayout. Much more work is needed.
llvm-svn: 33347
2007-01-19 00:07:16 +00:00
Reid Spencer 650d292f89 For PR761:
Implement reading and writing of the Module's data layout string.

llvm-svn: 33346
2007-01-18 23:24:24 +00:00