1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

17058 Commits

Author SHA1 Message Date
Evan Cheng
5f947e4e2f - Reorg Thumb load / store instructions. Combine each rr and ri pair of
instructions into one (e.g. tLDRrr, tLDRri -> tLDR).
- Thumb ldrsb and ldrsh only have the [reg, reg] address format. If the
  address is not an add, materialize a 0 immediate into a register and use
  it as the offset field.

llvm-svn: 33470
2007-01-23 22:59:13 +00:00
Devang Patel
f8db9e212e Fix typo.
llvm-svn: 33467
2007-01-23 21:55:17 +00:00
Devang Patel
cfd7cfeccd Add CallGraphSCCPass::assignPassManager().
This enables CalLGraphPassManager.

llvm-svn: 33466
2007-01-23 21:52:35 +00:00
Evan Cheng
dc97533dd3 Darwin HiddenDirective is .private_extern.
llvm-svn: 33465
2007-01-23 19:06:03 +00:00
Anton Korobeynikov
2079992c16 Moved disassembler to libSystem
llvm-svn: 33461
2007-01-23 10:26:08 +00:00
Evan Cheng
b6a4a7f72a PEI is now responsible for adding MaxCallFrameSize to frame size and align the stack. Each target can further adjust the frame size if necessary.
llvm-svn: 33460
2007-01-23 09:38:11 +00:00
Chris Lattner
c2b21d2900 Switch this to use SmallSet to avoid mallocs in the common case.
llvm-svn: 33457
2007-01-23 00:59:48 +00:00
Evan Cheng
d9d93832b0 hasFP() is now a virtual method of MRegisterInfo.
llvm-svn: 33455
2007-01-23 00:57:47 +00:00
Chris Lattner
f830aab43a Fix a bunch of inline asm failures
llvm-svn: 33454
2007-01-23 00:36:17 +00:00
Evan Cheng
cea1d1c5f8 Remove the DoubleTy special case.
llvm-svn: 33449
2007-01-22 23:13:55 +00:00
Evan Cheng
25584afca7 ARM AAPCS abi (Linux, etc.) requires 8-byte double / long alignment; Mac
requires 4-bytes alignment.

llvm-svn: 33448
2007-01-22 23:13:01 +00:00
Evan Cheng
c76a2c6c18 Double and long preferred alignment set to 8 bytes.
llvm-svn: 33447
2007-01-22 23:11:06 +00:00
Evan Cheng
8de7964067 Double and long preferred alignment is 8 byte.
llvm-svn: 33446
2007-01-22 23:09:50 +00:00
Evan Cheng
ab307e2180 - 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
818c6bdfa2 Linux GOT indirect reference is only necessary in PIC mode.
llvm-svn: 33441
2007-01-22 21:34:25 +00:00
Evan Cheng
b55dabdc80 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
30ef170ddf Use bl to call Thumb fuctions directly.
llvm-svn: 33433
2007-01-22 19:40:10 +00:00
Reid Spencer
7811139c74 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
e1e3a83b49 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
601692407e add a note
llvm-svn: 33423
2007-01-21 07:03:37 +00:00
Reid Spencer
82909e607c Whoops, fix typo in last commit.
llvm-svn: 33417
2007-01-21 02:29:10 +00:00
Reid Spencer
e33c18f4d2 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
71e0eb3771 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
c5140714bc 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
4de8fa6334 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
86af1504b4 trivial cleanup
llvm-svn: 33410
2007-01-20 22:39:15 +00:00
Chris Lattner
9df9e3e57b 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
dde5663eea 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
826ff3f805 For PR808:
NetBSD also doesn't have pthread_mutexattr_setpshared

llvm-svn: 33406
2007-01-20 20:44:38 +00:00
Reid Spencer
16f559f465 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
6271410520 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
174826c1b9 One more try...
llvm-svn: 33400
2007-01-20 10:17:53 +00:00
Evan Cheng
672910d722 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
ae02dfb090 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
906c09f205 Correct a comment.
llvm-svn: 33397
2007-01-20 10:07:23 +00:00
Evan Cheng
4e647ad333 Remove an unused variable.
llvm-svn: 33396
2007-01-20 09:21:54 +00:00
Reid Spencer
14d12fbaa6 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
5ea6a8d9e4 Prologue and epilogue bugs for non-Darwin targets.
llvm-svn: 33390
2007-01-20 03:24:07 +00:00
Evan Cheng
a6803554ab Clean up ARM PEI code.
llvm-svn: 33389
2007-01-20 02:09:25 +00:00
Evan Cheng
5807fbc934 Backend is reponsible for aligning the stack.
llvm-svn: 33388
2007-01-20 02:08:16 +00:00
Evan Cheng
7e02b3a690 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
60dd79e443 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
b2b35908d6 Unbreak Darwin.
llvm-svn: 33375
2007-01-19 22:04:24 +00:00
Reid Spencer
2b799d8208 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
5d29c5a81b Handle each of stderr/stdin/stdout separately.
llvm-svn: 33373
2007-01-19 21:30:39 +00:00
Reid Spencer
4bcddb2f04 Remove dead methods in the ValTypes.
llvm-svn: 33372
2007-01-19 21:25:12 +00:00
Reid Spencer
af3564823f 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
14b42c0040 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
5d0be572b5 Code clean up. Use def : pat instead of defining new instructions.
llvm-svn: 33368
2007-01-19 20:27:35 +00:00
Andrew Lenharth
0014d1c74b fix build on amd64
llvm-svn: 33367
2007-01-19 20:17:59 +00:00
Evan Cheng
51292f4863 isDarwin -> isTargetDarwin
llvm-svn: 33366
2007-01-19 19:28:01 +00:00
Evan Cheng
99725bd310 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
025816f18c Darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33364
2007-01-19 19:23:47 +00:00
Evan Cheng
b1a4190523 Introduce TargetType's ELF and Darwin.
llvm-svn: 33363
2007-01-19 19:22:40 +00:00
Evan Cheng
9203bd4339 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
ced4fcb608 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
f53f62b91d Fix section definition.
llvm-svn: 33359
2007-01-19 17:33:22 +00:00
Anton Korobeynikov
944088f221 Adding disassembler interface and external hook to udis86 library.
llvm-svn: 33358
2007-01-19 17:25:17 +00:00
Evan Cheng
c6e1d453d3 ARM backend contribution from Apple.
llvm-svn: 33353
2007-01-19 07:51:42 +00:00
Nick Lewycky
b8c2b60bb5 Needed to build on PPC Linux.
llvm-svn: 33352
2007-01-19 04:36:02 +00:00
Reid Spencer
d331480e5b Back out last changes for dataLayout. Much more work is needed.
llvm-svn: 33347
2007-01-19 00:07:16 +00:00
Reid Spencer
de679f8779 For PR761:
Implement reading and writing of the Module's data layout string.

llvm-svn: 33346
2007-01-18 23:24:24 +00:00
Evan Cheng
f6b1a88a1a - Target PIC style is no longer affected by relocation model.
- In x86-64 mode, symbols with external linkage (not just symbols which are
  defined externally) requires GOT indirect reference.
- Stylistic code clean up.

llvm-svn: 33345
2007-01-18 22:27:12 +00:00
Chris Lattner
ef4715a124 Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombine
infinitely loops.

llvm-svn: 33343
2007-01-18 22:16:33 +00:00
Reid Spencer
7ba10cda74 Clean up some code around the store V, (cast P) -> store (cast V), P
transform. Change some variable names so it is clear what is source and
what is dest of the cast. Also, add an assert to ensure that the integer
to integer case is asserting if the bitwidths are different. This prevents
illegal casts from being formed and catches bitwidth bugs sooner.

llvm-svn: 33337
2007-01-18 18:54:33 +00:00
Reid Spencer
b52af65aaa Use a cheaper computation.
llvm-svn: 33336
2007-01-18 18:14:49 +00:00
Reid Spencer
08e261a5f6 Fix a regression in the last patch. When constructing a BitMask, be careful
not to overflow 64-bits and end up with a 0 mask. This caused i64 values to
always be stored as 0 with lots of consequential damage to nightly test.

llvm-svn: 33335
2007-01-18 18:01:32 +00:00
Chris Lattner
54dac5f09e move contents of PR587 to here.
llvm-svn: 33333
2007-01-18 07:34:57 +00:00
Reid Spencer
80bf052680 Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.

llvm-svn: 33328
2007-01-18 02:59:54 +00:00
Bill Wendling
62dff8125a The zerofill directive needs a newline after it.
llvm-svn: 33327
2007-01-18 02:30:19 +00:00
Reid Spencer
e242773c58 Use the new maskToBitWidth function to ensure that the results of
computations do not overflow the intended bit width.

llvm-svn: 33326
2007-01-18 02:12:51 +00:00
Reid Spencer
bff2bccb7c Add an inline helper function that masks a GenericValue to a specified
bit width.

llvm-svn: 33325
2007-01-18 02:12:10 +00:00
Evan Cheng
7ff918163b Minor code clean up.
llvm-svn: 33323
2007-01-18 01:49:58 +00:00
Reid Spencer
539c40505b Make shl instruction mask its result to the correct bitsize. This is
sufficient to get llvm-test/SingleSource/UnitTests/Integer/general-test.ll
working with lli in interpreter mode.

llvm-svn: 33321
2007-01-18 01:32:46 +00:00
Reid Spencer
0524da8d3d Two changes:
1. Fix logic for executeGEP. Only 32-bit and 64-bit integer types are
   acceptable as indices.
2. Ensure that all integer cast operations truncate their result to the
   integer size of the operand.

llvm-svn: 33318
2007-01-18 01:25:42 +00:00
Reid Spencer
de3db66983 Make sure we truncate stored values to their bit width.
llvm-svn: 33317
2007-01-18 01:24:02 +00:00
Bill Wendling
af4f1b8791 Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
llvm-svn: 33316
2007-01-18 01:23:11 +00:00
Chris Lattner
770735e1ca 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: 33315
2007-01-18 01:15:58 +00:00
Chris Lattner
e0c1ba6269 add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
llvm-svn: 33314
2007-01-18 01:12:56 +00:00
Bill Wendling
9306626c66 Changed to use the OutputBuffer instead of the methods in MachO and ELF
writers.

llvm-svn: 33311
2007-01-17 22:22:31 +00:00
Devang Patel
756af73d3a Add CGPassManager.
llvm-svn: 33309
2007-01-17 21:45:01 +00:00
Devang Patel
cda3b4d76f Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.

llvm-svn: 33308
2007-01-17 21:19:23 +00:00
Devang Patel
b40f9ee72e s/PassDebugging_New/PassDebugging/g
llvm-svn: 33307
2007-01-17 20:33:36 +00:00
Devang Patel
866ecabe21 Update assignPassManager() signature to allow selection of preferred
pass manager type. This allows new FPPassManager to select Call Graph
Pass Manager (if available) as its parent.

llvm-svn: 33306
2007-01-17 20:30:17 +00:00
Chris Lattner
cea9f391af restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific

llvm-svn: 33304
2007-01-17 17:44:25 +00:00
Chris Lattner
5f4435800e darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33303
2007-01-17 17:43:33 +00:00
Chris Lattner
1a2c170bc4 add new directive
llvm-svn: 33302
2007-01-17 17:42:42 +00:00
Anton Korobeynikov
2509765bef * Fix one more bug in PIC codegen: extra load is needed for *all*
non-statics.
* Introduce new option to output zero-initialized data to .bss section.
This can reduce size of binaries. Enable it by default for ELF &
Cygwin/Mingw targets. Probably, Darwin should be also added.

llvm-svn: 33299
2007-01-17 10:33:08 +00:00
Bill Wendling
6cf6bb2d24 Revert patch.
llvm-svn: 33298
2007-01-17 09:06:13 +00:00
Bill Wendling
60dcce11c7 Create the specified TargetObjInfo and use it.
llvm-svn: 33291
2007-01-17 03:51:37 +00:00
Bill Wendling
dafa644e4d Create/store/and delete the TargetObjInfo object.
llvm-svn: 33290
2007-01-17 03:50:41 +00:00
Bill Wendling
ad6ddaa316 Use the methods in the TargetObjInfo object instead of internal methods.
llvm-svn: 33289
2007-01-17 03:49:21 +00:00
Bill Wendling
5789edd7f5 New "TargetObjInfo" class. This holds information that the object writers will
use to write things to the file. It's abstract so each target should implement
its own version for each writer type.

llvm-svn: 33286
2007-01-17 03:46:30 +00:00
Reid Spencer
0ef35f9e8f Regenerate.
llvm-svn: 33284
2007-01-17 02:48:45 +00:00
Reid Spencer
9dc290a59b For PR1117:
Make the assembler generate a nice error message if a bad cast instruction
is attempted instead of asserting out. This is made possible by the
recently exposed method CastInst::castIsValid() which checks the validity
of any cast instruction.

llvm-svn: 33283
2007-01-17 02:47:33 +00:00
Reid Spencer
d98055f3fe For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.

llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Reid Spencer
9423a82dc3 For PR1094:
Adjust the use of SetVector for changes in SetVector's interface.
Patch by Gordon Henriksen.

llvm-svn: 33280
2007-01-17 02:23:37 +00:00
Devang Patel
c65137140c Pass manager may require certain analysis. In such cases, initially
pass manager is last user.

llvm-svn: 33273
2007-01-16 22:38:10 +00:00
Devang Patel
e3e4fcb70f Undo last check-in.
Remove setupPassManager() and its use.

llvm-svn: 33270
2007-01-16 21:43:18 +00:00
Anton Korobeynikov
47f343edc3 Missed "<" :)
llvm-svn: 33265
2007-01-16 20:22:18 +00:00
Devang Patel
afc2e45d40 Setup pass manager before scheduling required analysis.
llvm-svn: 33262
2007-01-16 19:46:09 +00:00
Anton Korobeynikov
9b380c56f2 Cleanup. Comments added.
llvm-svn: 33260
2007-01-16 18:23:09 +00:00
Chris Lattner
c102e8919b Fix SMG2000 with the CBE: opaque types need names too.
llvm-svn: 33258
2007-01-16 18:02:45 +00:00
Chris Lattner
30cef1024d document some subtlety
llvm-svn: 33257
2007-01-16 17:51:40 +00:00
Anton Korobeynikov
8fbc09843e Emit symbol type information for ELF/COFF targets
llvm-svn: 33256
2007-01-16 16:41:57 +00:00
Bill Wendling
efde03bbf6 Instead of yet another enum indicating the "assembly language flavor",
just use the one that's in the subtarget.

llvm-svn: 33255
2007-01-16 09:29:17 +00:00
Chris Lattner
de9ba0fdb4 Fix PR918 by only using typedefs to name struct types. This makes the later
type ordering stuff work better.  This fixes PR918 and
CodeGen/CBackend/2007-01-15-NamedArrayType.ll

Patch by Gordon Henriksen.

llvm-svn: 33254
2007-01-16 07:22:23 +00:00
Chris Lattner
06f52d3e1e add a note: we need whole-function selectiondags :)
llvm-svn: 33252
2007-01-16 06:39:48 +00:00
Chris Lattner
3af776359d 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.

llvm-svn: 33251
2007-01-16 05:59:59 +00:00
Chris Lattner
7560c5f913 add options to view the dags before the first or second pass of dag combine.
llvm-svn: 33249
2007-01-16 04:55:25 +00:00
Bill Wendling
08272a2fa6 Make inline ASM the INTEL one if it's in that emission mode.
llvm-svn: 33247
2007-01-16 04:13:03 +00:00
Bill Wendling
cfdd717db5 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.

llvm-svn: 33246
2007-01-16 03:42:04 +00:00
Devang Patel
2d421d58d6 Code refactoring.
llvm-svn: 33245
2007-01-16 02:00:38 +00:00
Devang Patel
b61a40bc5a Remove extra white spaces. Fix comments.
llvm-svn: 33244
2007-01-15 23:06:56 +00:00
Devang Patel
67c975490d Do not record last users of Pass Manager.
llvm-svn: 33243
2007-01-15 20:31:54 +00:00
Jeff Cohen
c4ab4ae3e1 Unbreak VC++ build.
llvm-svn: 33242
2007-01-15 20:27:18 +00:00
Chris Lattner
b0a126d212 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner
946ceae164 Fix a regression in my isIntegral patch that broke 471.omnetpp. This is
because TargetData::getTypeSize() returns the same for i1 and i8.  This fix
is not right for the full generality of bitwise types, but it fixes the
regression.

llvm-svn: 33237
2007-01-15 17:55:20 +00:00
Nick Lewycky
36110b8456 Don't print address of ETNode. Print the DFSNumIn which uniquely identifies
the basic block and is stable across runs in gdb or valgrind.

Make Node::update handle edges which dominate and are tighter than
existing edges.

Replace makeEqual's "squeeze theorem" code. Fixes miscompilation.

Gate the calls to defToOps and opsToDef. Before this, we were getting IG
edges about values which weren't even defined in the dominated area. This
reduces the size of the IG by about half.

llvm-svn: 33236
2007-01-15 14:30:07 +00:00
Chris Lattner
1a96e01743 Implement InstCombine/phi.ll:test7, deletion of trivial value loops for
induction variables.

llvm-svn: 33234
2007-01-15 07:30:06 +00:00
Chris Lattner
d4a0c800f4 simplify some code now that types are signless
llvm-svn: 33232
2007-01-15 07:02:54 +00:00
Chris Lattner
bc687c27d7 delete stores to allocas with one use. This is a trivial form of DSE which
often kicks in for ?: expressions.

llvm-svn: 33231
2007-01-15 06:51:56 +00:00
Chris Lattner
64205203a5 Constant fold llvm.powi.*. This speeds up tramp3d--v4 by 9.5%
llvm-svn: 33229
2007-01-15 06:27:37 +00:00
Chris Lattner
851b9e93a2 add some notes
llvm-svn: 33228
2007-01-15 06:25:39 +00:00
Chris Lattner
c5e1611848 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! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Chris Lattner
ad283250fa regenerate
llvm-svn: 33224
2007-01-15 02:12:07 +00:00
Chris Lattner
f1797fe8bf teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Chris Lattner
f48900e322 eliminate calls to Type::isInteger, preferring isIntegral instead.
llvm-svn: 33222
2007-01-15 02:03:16 +00:00
Chris Lattner
0903f7f832 allow i1 to operators like shift and add.
llvm-svn: 33221
2007-01-15 02:00:29 +00:00
Chris Lattner
4d7eed35ae Update code to eliminate calls to isInteger, calling isIntegral instead.
llvm-svn: 33220
2007-01-15 01:58:56 +00:00
Chris Lattner
8fbcb083aa Eliminate calls to isInteger, generalizing code and tightening checks as needed.
llvm-svn: 33218
2007-01-15 01:55:30 +00:00
Chris Lattner
bf132d8342 Make use of isInteger vs isIntegral more explicit
llvm-svn: 33216
2007-01-15 01:48:11 +00:00
Chris Lattner
32e75c19b5 Fix correlated exprs regressions
llvm-svn: 33214
2007-01-15 01:02:34 +00:00
Chris Lattner
9bda331dc3 don't discriminate against i1
llvm-svn: 33213
2007-01-15 00:45:50 +00:00
Chris Lattner
e7c5d04b53 Fix Analysis/Dominators/2006-10-02-BreakCritEdges.ll
llvm-svn: 33210
2007-01-15 00:15:09 +00:00
Chris Lattner
34dd9c63b6 instcombine has always been miscompiling fcmp x, x, disregarding possible
NANs.  This fixes PR1111 and Transforms/InstCombine/2007-01-14-FcmpSelf.ll

llvm-svn: 33208
2007-01-14 19:42:17 +00:00
Chris Lattner
9801f36d97 Fix PR1110 and Analysis/Dominators/2007-01-14-BreakCritEdges.ll by being
more careful about unreachable code when updating dominator info.

llvm-svn: 33204
2007-01-14 18:33:35 +00:00
Anton Korobeynikov
9398ef2167 No hidden visiblity on Mingw32/Cygwin
llvm-svn: 33202
2007-01-14 11:49:39 +00:00
Chris Lattner
69b1c31416 add support for hidden visibility to darwin/ppc and linux/ppc targets
llvm-svn: 33200
2007-01-14 06:37:54 +00:00
Chris Lattner
f43ad084b8 add support for hidden visibility to darwin/x86
llvm-svn: 33198
2007-01-14 06:29:53 +00:00
Chris Lattner
a8f6e90cac add a new HiddenDirective member for handling visibility.
llvm-svn: 33197
2007-01-14 06:27:21 +00:00
Chris Lattner
716c76605c add a missing else. This caused globals to be printed as:
movq ___dso_handle@GOTPCREL(%rip)(%rip), %rsi

instead of:
        movq ___dso_handle@GOTPCREL(%rip), %rsi

llvm-svn: 33196
2007-01-14 06:08:14 +00:00
Chris Lattner
b1b258fd1e fit to 80 cols.
Remove now-extraneous checks for ptr->ptr bitcasts.

Fix PR1109 and Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll.  We
need to consider arbitrary sized objects when checking for nested GEP offsets.

llvm-svn: 33195
2007-01-14 05:57:53 +00:00
Chris Lattner
5ddfa77636 Fix PR1101 and Analysis/ScalarEvolution/trip-count.ll
llvm-svn: 33193
2007-01-14 01:24:47 +00:00
Chris Lattner
3560a9f595 darwin doesn't use .hidden. Disable this until we fix it right.
llvm-svn: 33191
2007-01-14 00:50:56 +00:00
Chris Lattner
a4d48724af Fix PR1103 and Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll
llvm-svn: 33189
2007-01-14 00:13:07 +00:00
Chris Lattner
937b09c54a remove dead code, frameindices must be resolve before the asmprinter runs.
llvm-svn: 33187
2007-01-13 23:59:03 +00:00
Chris Lattner
8b316c71e2 Fix Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll, which is part
of PR1107

llvm-svn: 33185
2007-01-13 23:11:38 +00:00
Reid Spencer
2a25084316 Fix indentation to prior level for easier diffs.
llvm-svn: 33184
2007-01-13 05:10:53 +00:00
Reid Spencer
ff6664c461 Regenerate.
llvm-svn: 33182
2007-01-13 05:00:46 +00:00
Reid Spencer
99b79bdde3 Bye bye bool. AsmWriter doesn't generate it any more so AsmParser shouldn't
read it any more. This is consistent with the new IR as well.

llvm-svn: 33181
2007-01-13 05:00:20 +00:00
Nick Lewycky
fa95bfe36f "Default context" blocks can occur after a non-default one. This meant
that properties were being applied where they didn't belong. Fixes crash
in new MiBench testcase.

Also mark debugging code as such in #ifdef.

llvm-svn: 33177
2007-01-13 02:05:28 +00:00
Reid Spencer
40be764463 Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
llvm-svn: 33176
2007-01-13 01:09:33 +00:00
Chris Lattner
8b6e091a62 Fix a minor bug handling constant exprs, introduced by a recent patch.
llvm-svn: 33175
2007-01-13 00:42:58 +00:00
Reid Spencer
42cb213bc9 Make sure the IntegerValType has enough space for 2^23 bits.
llvm-svn: 33168
2007-01-13 00:12:29 +00:00
Reid Spencer
305bc13c03 Make sure that GEP indices are only 32 or 64 bits. We're not ready for
indices with other bit sizes yet.

llvm-svn: 33167
2007-01-13 00:10:02 +00:00
Reid Spencer
1cc6fb36b2 Get rid of some useless distinction between bool and integer.
llvm-svn: 33166
2007-01-13 00:09:12 +00:00
Chris Lattner
ec0b2f5e29 fix a bug in a recent patch
llvm-svn: 33164
2007-01-13 00:02:49 +00:00
Reid Spencer
5a42897aca Remove this file. It was inadvertently added because I could not find
TargetLowering.cpp in CodeGen/SelectionDAG (location makes no sense to me)

llvm-svn: 33160
2007-01-12 23:32:11 +00:00
Reid Spencer
6d0992dc3d Compensate for loss of DerivedTypes.h in TargetLowering.h
llvm-svn: 33159
2007-01-12 23:31:12 +00:00
Reid Spencer
6468d49755 Move a function out of line.
llvm-svn: 33158
2007-01-12 23:30:31 +00:00
Chris Lattner
657e08b994 remove over-general code.
llvm-svn: 33157
2007-01-12 23:28:32 +00:00
Chris Lattner
5011520dda remove unneeded special case for bool
llvm-svn: 33156
2007-01-12 23:26:17 +00:00
Chris Lattner
996f22b99b Eliminate a log(n) lookup
llvm-svn: 33155
2007-01-12 23:23:08 +00:00
Reid Spencer
09efdecc2d Adjust #includes to compensate for lost of DerivedTypes.h in
TargetLowering.h

llvm-svn: 33154
2007-01-12 23:22:14 +00:00
Reid Spencer
baff834435 Add a new home for TargetLowering member functions.
llvm-svn: 33152
2007-01-12 23:18:18 +00:00
Chris Lattner
bc884d406d remove obsolete fixme
llvm-svn: 33151
2007-01-12 22:52:50 +00:00
Chris Lattner
7cfcfbb801 simplify some code
llvm-svn: 33150
2007-01-12 22:51:20 +00:00
Evan Cheng
e2a6d79cad Minor fix.
llvm-svn: 33149
2007-01-12 22:51:10 +00:00
Chris Lattner
48ec71f551 Remove over-general comparisons
llvm-svn: 33147
2007-01-12 22:49:11 +00:00
Jim Laskey
ee29cc6016 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Lauro Ramos Venancio
14cf9f2c03 Don't add or sub zero to sp.
llvm-svn: 33142
2007-01-12 20:52:27 +00:00
Lauro Ramos Venancio
97e120a71c Build constants using instructions mov/orr or mvn/eor.
llvm-svn: 33141
2007-01-12 20:35:49 +00:00
Devang Patel
347efe4ce7 s/addPassToManager/add/g
llvm-svn: 33138
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
ea90b2409f Regenerate
llvm-svn: 33137
2007-01-12 19:22:51 +00:00
Anton Korobeynikov
548b9af9c2 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Devang Patel
9afb283500 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.

llvm-svn: 33135
2007-01-12 18:52:44 +00:00
Chris Lattner
cb66b7721a Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.

llvm-svn: 33134
2007-01-12 18:42:52 +00:00
Chris Lattner
18fa0e53fa eliminate redundant check
llvm-svn: 33132
2007-01-12 18:35:11 +00:00
Chris Lattner
cee2f2e618 regenerate
llvm-svn: 33131
2007-01-12 18:33:30 +00:00
Chris Lattner
b2fb78205f This production is dead, the lexer can never return 'NOT'
llvm-svn: 33130
2007-01-12 18:32:39 +00:00
Chris Lattner
115b9b1a2b Branch conditions must be i1
llvm-svn: 33129
2007-01-12 18:30:11 +00:00
Chris Lattner
39030b8d42 don't discriminate against bool
llvm-svn: 33128
2007-01-12 18:28:58 +00:00
Chris Lattner
be3dff7815 remove unneeded special cases
llvm-svn: 33127
2007-01-12 18:23:49 +00:00
Chris Lattner
c5a3d1064e GEP operands can't be bools
llvm-svn: 33125
2007-01-12 18:20:48 +00:00
Chris Lattner
e0b9a74157 Simplify code
llvm-svn: 33123
2007-01-12 18:15:09 +00:00
Devang Patel
dc1430cb98 Remove dead code.
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer
6a286c69bd Regenerate.
llvm-svn: 33117
2007-01-12 07:28:27 +00:00
Reid Spencer
93f4aedbbb Integer type names need 1 or more digits, not zero or more.
llvm-svn: 33116
2007-01-12 07:27:59 +00:00
Reid Spencer
eeb33c0716 Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Evan Cheng
0241c4a0b5 Comment.
llvm-svn: 33114
2007-01-12 07:25:16 +00:00
Reid Spencer
373d2bccea 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.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Reid Spencer
3d986f6487 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.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Evan Cheng
032a597692 Store default libgcc routine names and allow them to be redefined by target.
llvm-svn: 33105
2007-01-12 02:11:51 +00:00
Nick Lewycky
8229bc7c80 If we know that it's a constant being casted, propagate through the cast
instruction. Doesn't work the other way though (can't recover bits that
have been truncated).

llvm-svn: 33104
2007-01-12 01:23:53 +00:00
Nick Lewycky
8f02993e38 Clean up logic after ConstantBool removal.
llvm-svn: 33096
2007-01-12 00:02:12 +00:00
Devang Patel
da5ae651e9 Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.

llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Devang Patel
5f5c0486fb Use getPassManagerType() instead of dynamic_cast.
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
17235b194b Remove unnecessary boolean type check.
llvm-svn: 33075
2007-01-11 14:38:17 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Zhou Sheng
7c83700514 Fixed indentation.
llvm-svn: 33072
2007-01-11 10:33:26 +00:00
Reid Spencer
c511274dc1 Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner
6fee172493 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner
3147621368 Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.

llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Nick Lewycky
fad35ab64a Quiet compiler warning. The only reason the function is marked virtual
is so that it can be called from inside a debugger.

llvm-svn: 33067
2007-01-11 02:38:21 +00:00
Nick Lewycky
7fb0a6d2ab New predicate simplifier!
Please do not enable, there is still some known miscompile problem.

llvm-svn: 33066
2007-01-11 02:32:38 +00:00
Devang Patel
e485c421c1 Add PassManagerType enum.
llvm-svn: 33065
2007-01-11 01:10:25 +00:00
Reid Spencer
0f61503a7e Avoid taking the address of a macro by checking to see if stdin is defined
or not. This allows DynamicLibrary.cpp to compile on Darwin.

llvm-svn: 33064
2007-01-11 00:35:10 +00:00
Reid Spencer
12c2bdcc62 Implement better constant folding of unordered FCMP predicates.
llvm-svn: 33063
2007-01-11 00:25:45 +00:00
Devang Patel
a0b4424ed4 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.

llvm-svn: 33062
2007-01-11 00:19:00 +00:00
Reid Spencer
94ddfbe8b8 Allow LLI, in interpreter mode, to find stdin, stdout, and stderr. This is
a bit of a hack but it lets some of the llvm-test programs run.

llvm-svn: 33058
2007-01-10 19:50:43 +00:00
Reid Spencer
d6ed2499db Back out the last patch which is a nightly test killer. The assertion
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.

llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner
bf6aebe720 Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.

llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner
6ee5a4d0d2 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Reid Spencer
e6d962e729 Change the file header name as this file was renamed.
llvm-svn: 33051
2007-01-10 04:17:32 +00:00
Reid Spencer
b808cbe40b Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.

llvm-svn: 33050
2007-01-10 04:16:17 +00:00
Chris Lattner
441127f582 Fix a bug in heap-sra that caused compilation failure of office-ispell.
llvm-svn: 33043
2007-01-09 23:29:37 +00:00
Reid Spencer
b4f3c47095 For PR1099:
Invert the "isSigned" logic in calls to printType and printPrimitiveType.
We want variables to be declared unsigned by default so that signless
operators like + and - perform the unsigned operation that LLVM expects
by default. Parameters with the sext attribute will be declared signed and
signed instructions will case operand values to signed regardless of the
type of the variable. This passes all tests and fixes PR1099.

llvm-svn: 33039
2007-01-09 17:09:09 +00:00
Chris Lattner
af73545299 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner
ef3e9a5ea1 Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!

llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner
ee67a96b5d Split CreateSlot into two versions, one for globals and one for function-local
values

llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner
88c55c3483 Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.

llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Reid Spencer
76d79c7040 For PR1099:
Partial fix for this PR. Default function parameters to signed integer, just
like everything else in CBE. The bug was caused by incorrectly introducing
parameter attributes feature by choosing "signed" parameter if the
SExtAttribute was specified. Howeer, if no attribute is specified, this
causes it to become unsigned which is incorrect. Reversing the logic so
that signedness is detected by "not ZExtAttribute" set fixes the issue.

This fixes 197.parser but there is more to do. Any comparison and possibly
other operators involving arguments may need to correctly cast the parameter
before its use, depending on the sign of the operator.

llvm-svn: 33034
2007-01-09 06:38:06 +00:00
Evan Cheng
6829d12846 Naming consistency.
llvm-svn: 33026
2007-01-08 23:55:53 +00:00
Evan Cheng
6cba4e114e Fix for PR1075: bottom-up register-reduction scheduling actually increases register pressure.
- Fixed bugs in sethi-ullman number computation and priority queue comparison
functions.
- Separate code that handles priority computation special cases from SU number computation.

llvm-svn: 33025
2007-01-08 23:50:38 +00:00
Chris Lattner
0f765fae89 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll

llvm-svn: 33024
2007-01-08 23:04:05 +00:00
Jim Laskey
8cc5a0d2fe Need to handle static declarations properly.
llvm-svn: 33022
2007-01-08 22:15:18 +00:00
Jeff Cohen
2bfbf6b99c Unbreak VC++ build.
llvm-svn: 33021
2007-01-08 20:17:17 +00:00
Reid Spencer
96ebce2eda Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.

llvm-svn: 33020
2007-01-08 19:41:01 +00:00
Devang Patel
e0b89a869d Add PMStack, a Pass Manager stack.
Eventually, Top level pass managers  will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.

llvm-svn: 33018
2007-01-08 19:29:38 +00:00
Andrew Lenharth
31e7a82bea And asm writing for packed struct initializers
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Andrew Lenharth
55be52f117 Make packed structs use packed initialiers for consistency
llvm-svn: 33015
2007-01-08 18:16:47 +00:00
Reid Spencer
c857bb0b27 Comparison of primitive type sizes should now be done in bits, not bytes.
This patch converts getPrimitiveSize to getPrimitiveSizeInBits where it is
appropriate to do so (comparison of integer primitive types).

llvm-svn: 33012
2007-01-08 16:32:00 +00:00
Reid Spencer
405e204fb3 For PR1097:
Enable complex addressing modes on 64-bit platforms involving two induction
variables by keeping a size and scale in 64-bits not 32.
Patch by Dan Gohman.

llvm-svn: 33011
2007-01-08 16:17:51 +00:00
Reid Spencer
1f80d735e2 For PR1090:
Clean up the definitions of the helper functions per Chris' review
suggestions so they are easier to read.

For PR1091:
Print minimum signed integer values as unsigned so that we get no warnings
from the C compiler about constant ranges and value comparisons.

llvm-svn: 33010
2007-01-08 08:00:00 +00:00
Reid Spencer
1a8a0762a5 Fix PR1090:
Implemented some llvm_fcmp_{pred} functions at the start of the function bodies
and use them for fcmp instructions and constant expressions. These help
implement the ordered and unordered comparisons necessary for correct exectuion
of these comparisons.

llvm-svn: 33007
2007-01-08 06:58:32 +00:00
Reid Spencer
d876f05c66 Fix a bug in an assert that would never trigger.
llvm-svn: 33005
2007-01-08 05:34:39 +00:00
Reid Spencer
372c53dfbf Convert uses of getPrimitiveSize that should be getPrimitiveSizeInBits.
llvm-svn: 33003
2007-01-08 01:26:33 +00:00
Reid Spencer
74e4297a4c Types should be const.
llvm-svn: 33001
2007-01-07 21:45:41 +00:00
Chris Lattner
cd53253271 this pass is unused
llvm-svn: 32998
2007-01-07 18:12:43 +00:00
Chris Lattner
3e42a4147a llvm 2.0 doesn't support llvm.isunordered.*
llvm-svn: 32994
2007-01-07 08:52:43 +00:00
Chris Lattner
b6f6d3a00c remove support for llvm.isunordered
llvm-svn: 32992
2007-01-07 08:37:22 +00:00
Chris Lattner
ce03b9209c remove llvm.isunordered
llvm-svn: 32991
2007-01-07 08:19:47 +00:00
Chris Lattner
aa5051ae7f Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also

llvm-svn: 32989
2007-01-07 08:12:01 +00:00
Chris Lattner
fed811a032 Change the interface to Module::getOrInsertFunction to be easier to use,
to resolve PR1088, and to help PR411.

llvm-svn: 32988
2007-01-07 08:09:25 +00:00
Chris Lattner
a2f5c06174 prepare for adjustment to getOrInsertFunction method
llvm-svn: 32985
2007-01-07 07:54:34 +00:00
Chris Lattner
a62936ee6f relax type
llvm-svn: 32983
2007-01-07 07:24:32 +00:00
Chris Lattner
a966510e59 relax some types
llvm-svn: 32982
2007-01-07 07:22:20 +00:00
Chris Lattner
3e1aa998fb relax types
llvm-svn: 32981
2007-01-07 06:59:47 +00:00
Chris Lattner
e7017c4ccf relax some types
llvm-svn: 32980
2007-01-07 06:58:05 +00:00
Chris Lattner
5786d6f58e remove support for old-style varargs upgrading
llvm-svn: 32979
2007-01-07 06:45:57 +00:00
Reid Spencer
9fae72ee14 For PR1086:
Parameter attributes do have to be specially handled in the CBE. Implement
their handling.

llvm-svn: 32976
2007-01-07 03:24:48 +00:00
Chris Lattner
b76478fd3d Fix PR1015 and Transforms/IndVarsSimplify/2007-01-06-TripCount.ll, a
miscompilation of Qt.

llvm-svn: 32974
2007-01-07 02:24:26 +00:00
Chris Lattner
adc6319e45 cast of int to bool no longer does a compare, rendering this fixme
obsolete

llvm-svn: 32972
2007-01-07 02:05:20 +00:00
Chris Lattner
e7eca26371 add -debug output for -indvars.
llvm-svn: 32971
2007-01-07 01:14:12 +00:00
Anton Korobeynikov
874aaaa34a As PR1085 was fixed, back out workaround
llvm-svn: 32969
2007-01-07 00:41:20 +00:00
Chris Lattner
051f1b7f78 wow, the link was already broken :)
llvm-svn: 32963
2007-01-06 23:20:51 +00:00
Chris Lattner
94f6358ce0 add a note
llvm-svn: 32962
2007-01-06 23:19:38 +00:00
Chris Lattner
a346ea7b29 Disable the macho writer until it is 100% functional. Enabling it when
broken invites bug reports.

llvm-svn: 32961
2007-01-06 22:27:58 +00:00
Chris Lattner
808722cded Fix regressions in InstCombine/call-cast-target.ll and InstCombine/2003-11-13-ConstExprCastCall.ll
llvm-svn: 32959
2007-01-06 19:53:32 +00:00
Anton Korobeynikov
fdd778278f gcc often inserts it's own names for sections (e.g.
gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
otherwise linker won't be able to merge them.

llvm-svn: 32958
2007-01-06 18:24:26 +00:00
Reid Spencer
cdaf88ff9d For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Chris Lattner
7a0046dc65 this final call to canLosslesslyBitCastTo is dead, because ValueRequiresCast
is only called on integers.

llvm-svn: 32949
2007-01-06 02:11:56 +00:00
Chris Lattner
3155b15453 simplify some more code now that there are not multiple different integer
types of the same size

llvm-svn: 32948
2007-01-06 02:09:32 +00:00
Chris Lattner
9691941c37 eliminate some uses of canLosslesslyBitCastTo, this actually makes the code stronger, by nuking
relational pointer comparisons with casts.

llvm-svn: 32947
2007-01-06 01:45:59 +00:00
Chris Lattner
176b690f07 no need to worry about int vs uint any more.
llvm-svn: 32946
2007-01-06 01:37:35 +00:00
Chris Lattner
aed0e0292b new note
llvm-svn: 32945
2007-01-06 01:30:45 +00:00
Evan Cheng
5ba049eabf setSetCCIsExpensive is gone.
llvm-svn: 32941
2007-01-05 23:42:53 +00:00
Evan Cheng
d378a229c5 Expand fcopysign to the bitwise sequence if select is marked as expensive.
llvm-svn: 32940
2007-01-05 23:33:44 +00:00
Devang Patel
c1627f6538 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver

llvm-svn: 32938
2007-01-05 22:47:07 +00:00
Reid Spencer
3e9aba042b Regenerate.
llvm-svn: 32934
2007-01-05 21:51:07 +00:00
Reid Spencer
6cec5bdd1c For PR1077:
Disallow merging of dupliate global variables. It is now illegal to declare
or define two global variables of the same name and same type. llvm-gcc3 is
dead in 2.0 and llvm-gcc4 doesn't have that problem nor need the hack.

llvm-svn: 32933
2007-01-05 21:50:38 +00:00
Evan Cheng
df277336b8 - FCOPYSIGN custom lowering bug. Clear the sign bit of operand 0 first before
or'ing in the sign bit of operand 1.
- Tweaking: rather than left shift the sign bit, fp_extend operand 1 first
  before taking its sign bit if its type is smaller than that of operand 0.

llvm-svn: 32932
2007-01-05 21:37:56 +00:00
Evan Cheng
cb71f273ff Bug in ExpandFCOPYSIGNToBitwiseOps(). Clear the old sign bit of operand 0
before or'ing in the sign bit of operand 1.

llvm-svn: 32930
2007-01-05 21:31:51 +00:00
Evan Cheng
237ec557ae CopyToReg source operand can be a register as well. e.g. Copy from GlobalBaseReg.
llvm-svn: 32929
2007-01-05 20:59:06 +00:00
Devang Patel
c5a284c3c6 Remove PassManagerT.h
llvm-svn: 32928
2007-01-05 20:21:13 +00:00
Devang Patel
fcddd83bfc Remove old pass manager.
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Reid Spencer
a6f1f11d07 Regenerate.
llvm-svn: 32905
2007-01-05 17:07:23 +00:00
Reid Spencer
4f14887126 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.

llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Evan Cheng
c273c9c830 Typo
llvm-svn: 32902
2007-01-05 08:32:24 +00:00
Evan Cheng
bcf3d2bd15 With SSE2, expand FCOPYSIGN to a series of SSE bitwise operations.
llvm-svn: 32900
2007-01-05 07:55:56 +00:00
Chris Lattner
6cef95214b Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles with
undef operands.

llvm-svn: 32899
2007-01-05 07:36:08 +00:00
Chris Lattner
79238a345b fold things like a^b != c^a -> b != c. This implements InstCombine/xor.ll:test27
llvm-svn: 32893
2007-01-05 03:04:57 +00:00
Chris Lattner
f02fdf92a2 Compile X + ~X to -1. This implements Instcombine/add.ll:test34
llvm-svn: 32890
2007-01-05 02:17:46 +00:00
Evan Cheng
8d09e52569 GEP subscript is interpreted as a signed value.
llvm-svn: 32888
2007-01-05 01:46:20 +00:00
Chris Lattner
45c7c69c77 fix PowerPC/2007-01-04-ArgExtension.ll, a bug handling K&R prototypes with
the recent signless changes.

llvm-svn: 32884
2007-01-04 22:22:37 +00:00
Evan Cheng
7674a71585 Expand fcopysign to a series of bitwise of operations when it's profitable to
do so.

llvm-svn: 32881
2007-01-04 21:56:39 +00:00
Lauro Ramos Venancio
078b85bdaa Expand SELECT (f32/f64) and FCOPYSIGN (f32/f64).
llvm-svn: 32870
2007-01-04 14:01:38 +00:00
Reid Spencer
dd9d393e32 Death to useless bitcast instructions!
llvm-svn: 32866
2007-01-04 05:23:51 +00:00
Reid Spencer
4b18100144 Do not allow packed types for icmp and fcmp instructions.
llvm-svn: 32865
2007-01-04 05:22:18 +00:00
Reid Spencer
d74df01f8b Regenerate.
llvm-svn: 32862
2007-01-04 02:57:52 +00:00
Reid Spencer
6d0c49f6bd Disallow packed types in icmp/fcmp instructions. The code generator is
not prepared to handle them yet.

llvm-svn: 32861
2007-01-04 02:57:22 +00:00
Chris Lattner
29a821859e Now that setcondinst has been eliminated, we can mark Value::SubclassID
const and remove the ugly mutator methods.

llvm-svn: 32860
2007-01-04 02:15:37 +00:00
Chris Lattner
5eca81644b fix typo
llvm-svn: 32859
2007-01-04 02:13:20 +00:00
Chris Lattner
06b8d30502 Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
llvm-svn: 32858
2007-01-04 02:12:40 +00:00
Chris Lattner
793a771c59 fix some bugs handling vectors, avoid host-specific handling of undefined shift results.
llvm-svn: 32857
2007-01-04 01:56:39 +00:00
Chris Lattner
d9342d1db3 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer
878c466bf4 Regenerate.
llvm-svn: 32853
2007-01-04 00:06:14 +00:00
Reid Spencer
bde43a8222 Permit icmp and fcmp to have packed operands.
Make an error message a little more useful.

llvm-svn: 32852
2007-01-04 00:05:48 +00:00