Commit Graph

17016 Commits

Author SHA1 Message Date
Reid Spencer
a42c7fd0ca 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 20:12:29 +00:00
Evan Cheng
515674c7b6 Round up stack to multiple of alignment only if it's a leaf function without alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33401 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 10:22:33 +00:00
Evan Cheng
2bd7b2b41f One more try...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33400 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 10:17:53 +00:00
Evan Cheng
5ad334fbda Last check-in was bogus. There is no need to align the stack if the function is a leaf function (and without alloca).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33399 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 10:11:56 +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
Owen Anderson
f4d5de4080 Correct a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33397 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 10:07:23 +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
Reid Spencer
c00a43092e Implement bit-accurate sext instruction.
This patch fixes test/Integer/2007-01-17-TruncSext.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 08:32:52 +00:00
Evan Cheng
c1c7283047 Prologue and epilogue bugs for non-Darwin targets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 03:24:07 +00:00
Evan Cheng
75e18c403e Clean up ARM PEI code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33389 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 02:09:25 +00:00
Evan Cheng
0327863a73 Backend is reponsible for aligning the stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33388 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-20 02:08:16 +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
a867cf0265 Unbreak Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33375 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 22:04:24 +00:00
Reid Spencer
02f20d3d9b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33374 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:41:04 +00:00
Reid Spencer
81e3954dc9 Handle each of stderr/stdin/stdout separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33373 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:30:39 +00:00
Reid Spencer
ab60be7a00 Remove dead methods in the ValTypes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33372 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:25:12 +00:00
Reid Spencer
55af2b59bb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33371 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 21:20:31 +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
34b12d24a0 Code clean up. Use def : pat instead of defining new instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33368 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 20:27:35 +00:00
Andrew Lenharth
a9ebd2b91f fix build on amd64
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 20:17:59 +00:00
Evan Cheng
970a419633 isDarwin -> isTargetDarwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33366 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 19:28:01 +00:00
Evan Cheng
5be54b00bd Restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 19:25:36 +00:00
Evan Cheng
e433ea9dce Darwin doesn't support .bss, but it does have .zerofill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33364 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 19:23:47 +00:00
Evan Cheng
1a3771e30e Introduce TargetType's ELF and Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33363 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 19:22:40 +00:00
Evan Cheng
8e1185bd5c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33362 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 18:59: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
Lauro Ramos Venancio
471ffaffd8 Fix section definition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 17:33:22 +00:00
Anton Korobeynikov
8cd4c3e653 Adding disassembler interface and external hook to udis86 library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33358 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 17:25:17 +00:00
Evan Cheng
a8e2989ece ARM backend contribution from Apple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33353 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 07:51:42 +00:00
Nick Lewycky
bd92d81d22 Needed to build on PPC Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33352 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 04:36:02 +00:00
Reid Spencer
021830bb03 Back out last changes for dataLayout. Much more work is needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33347 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-19 00:07:16 +00:00
Reid Spencer
4b70161b69 For PR761:
Implement reading and writing of the Module's data layout string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33346 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 23:24:24 +00:00
Evan Cheng
ae19abc2cc - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33345 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 22:27:12 +00:00
Chris Lattner
696ee0ab15 Fix InstCombine/2007-01-18-VectorInfLoop.ll, a case where instcombine
infinitely loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33343 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 22:16:33 +00:00
Reid Spencer
7515396096 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33337 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 18:54:33 +00:00
Reid Spencer
b5f378e11b Use a cheaper computation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33336 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 18:14:49 +00:00
Reid Spencer
8205972a5a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33335 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 18:01:32 +00:00
Chris Lattner
afd7a08a76 move contents of PR587 to here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33333 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 07:34:57 +00:00
Reid Spencer
7808dcba05 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33328 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:59:54 +00:00
Bill Wendling
39e9c09763 The zerofill directive needs a newline after it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33327 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:30:19 +00:00
Reid Spencer
65367b26bf Use the new maskToBitWidth function to ensure that the results of
computations do not overflow the intended bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:12:51 +00:00
Reid Spencer
90935f608d Add an inline helper function that masks a GenericValue to a specified
bit width.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33325 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 02:12:10 +00:00
Evan Cheng
071b9d5d7c Minor code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33323 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:49:58 +00:00
Reid Spencer
547dcf2467 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33321 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:32:46 +00:00
Reid Spencer
23e28836ed 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33318 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:25:42 +00:00
Reid Spencer
f89aec655f Make sure we truncate stored values to their bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33317 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:24:02 +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
b266ccd0f4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33315 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-18 01:15:58 +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
Devang Patel
75f9abf517 Add CGPassManager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33309 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 21:45:01 +00:00
Devang Patel
44b0d29802 Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 21:19:23 +00:00
Devang Patel
26426949f3 s/PassDebugging_New/PassDebugging/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:33:36 +00:00
Devang Patel
be1ffc6b8d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 20:30:17 +00:00
Chris Lattner
8e13e90052 restructure code a bit to make use of continue (simplifying things). Generalize
the .zerofill directive emission to not be darwin-specific


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33304 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 17:44:25 +00:00
Chris Lattner
42ca450a57 darwin doesn't support .bss, but it does have .zerofill
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33303 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 17:43:33 +00:00
Chris Lattner
6f198dfb38 add new directive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33302 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 17:42:42 +00:00
Anton Korobeynikov
5032e5a613 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33299 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 10:33:08 +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
22fb30231b Create the specified TargetObjInfo and use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33291 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 03:51:37 +00:00
Bill Wendling
cc91f5862c Create/store/and delete the TargetObjInfo object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33290 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 03:50:41 +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
Bill Wendling
34f03fff2d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33286 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 03:46:30 +00:00
Reid Spencer
b0fcf8fe8f Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:48:45 +00:00
Reid Spencer
93947c3985 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:47:33 +00:00
Reid Spencer
0a11af1f73 For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33282 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:46:11 +00:00
Reid Spencer
7af9a13f3a For PR1094:
Adjust the use of SetVector for changes in SetVector's interface.
Patch by Gordon Henriksen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33280 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:23:37 +00:00
Devang Patel
8df87095fc Pass manager may require certain analysis. In such cases, initially
pass manager is last user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33273 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 22:38:10 +00:00
Devang Patel
9d133e150f Undo last check-in.
Remove setupPassManager() and its use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33270 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 21:43:18 +00:00
Anton Korobeynikov
b93a7c9b66 Missed "<" :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 20:22:18 +00:00
Devang Patel
531f01f878 Setup pass manager before scheduling required analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33262 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 19:46:09 +00:00
Anton Korobeynikov
1e0f33873b Cleanup. Comments added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33260 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 18:23:09 +00:00
Chris Lattner
a80cc93f10 Fix SMG2000 with the CBE: opaque types need names too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33258 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 18:02:45 +00:00
Chris Lattner
26aa785942 document some subtlety
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33257 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 17:51:40 +00:00
Anton Korobeynikov
d05ca657da Emit symbol type information for ELF/COFF targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33256 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 16:41:57 +00:00
Bill Wendling
cb9009993b Instead of yet another enum indicating the "assembly language flavor",
just use the one that's in the subtarget.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33255 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 09:29:17 +00:00
Chris Lattner
19e8b0c1f5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33254 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 07:22:23 +00:00
Chris Lattner
03a6d96d32 add a note: we need whole-function selectiondags :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33252 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 06:39:48 +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
11502860c1 Make inline ASM the INTEL one if it's in that emission mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 04:13:03 +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
Devang Patel
8f3f3d103a Code refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33245 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-16 02:00:38 +00:00
Devang Patel
66eeb49d8f Remove extra white spaces. Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33244 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 23:06:56 +00:00
Devang Patel
3f5ecd7eb5 Do not record last users of Pass Manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33243 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 20:31:54 +00:00
Jeff Cohen
1b30754ba9 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33242 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 20:27:18 +00:00
Chris Lattner
9a40c023cc make this more efficient in release builds (time and space)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33239 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 18:28:18 +00:00
Chris Lattner
0d880c38ce 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33237 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 17:55:20 +00:00
Nick Lewycky
dd402588b5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 14:30:07 +00:00
Chris Lattner
ff9f13a4b2 Implement InstCombine/phi.ll:test7, deletion of trivial value loops for
induction variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33234 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 07:30:06 +00:00
Chris Lattner
76b7a06a75 simplify some code now that types are signless
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33232 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 07:02:54 +00:00
Chris Lattner
836692dd8a delete stores to allocas with one use. This is a trivial form of DSE which
often kicks in for ?: expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 06:51:56 +00:00
Chris Lattner
b5282dcf47 Constant fold llvm.powi.*. This speeds up tramp3d--v4 by 9.5%
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33229 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 06:27:37 +00:00
Chris Lattner
7ace299bdc add some notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33228 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 06:25:39 +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
b25c4ca9d8 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33224 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:12:07 +00:00
Chris Lattner
b9d8b97f4a teach VMCore to accept i1 add's and shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:05:34 +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
Chris Lattner
3fa0ba7b32 allow i1 to operators like shift and add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:00:29 +00:00
Chris Lattner
b2f3e703bc Update code to eliminate calls to isInteger, calling isIntegral instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33220 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 01:58:56 +00:00
Chris Lattner
4d5f508318 Eliminate calls to isInteger, generalizing code and tightening checks as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 01:55:30 +00:00
Chris Lattner
9e1b1cf3aa Make use of isInteger vs isIntegral more explicit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 01:48:11 +00:00
Chris Lattner
0762705087 Fix correlated exprs regressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 01:02:34 +00:00
Chris Lattner
bbd528d832 don't discriminate against i1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 00:45:50 +00:00
Chris Lattner
caed0e3d71 Fix Analysis/Dominators/2006-10-02-BreakCritEdges.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33210 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 00:15:09 +00:00
Chris Lattner
58e9746ef3 instcombine has always been miscompiling fcmp x, x, disregarding possible
NANs.  This fixes PR1111 and Transforms/InstCombine/2007-01-14-FcmpSelf.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 19:42:17 +00:00
Chris Lattner
9fa58b5f66 Fix PR1110 and Analysis/Dominators/2007-01-14-BreakCritEdges.ll by being
more careful about unreachable code when updating dominator info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33204 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 18:33:35 +00:00
Anton Korobeynikov
1a85645d46 No hidden visiblity on Mingw32/Cygwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 11:49:39 +00:00
Chris Lattner
70d4107a45 add support for hidden visibility to darwin/ppc and linux/ppc targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33200 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 06:37:54 +00:00
Chris Lattner
43bbc5c38f add support for hidden visibility to darwin/x86
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 06:29:53 +00:00
Chris Lattner
9784bc73c3 add a new HiddenDirective member for handling visibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 06:27:21 +00:00
Chris Lattner
5b3a48d853 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33196 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 06:08:14 +00:00
Chris Lattner
241607d016 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 05:57:53 +00:00
Chris Lattner
192e403744 Fix PR1101 and Analysis/ScalarEvolution/trip-count.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 01:24:47 +00:00
Chris Lattner
fd92ec40a9 darwin doesn't use .hidden. Disable this until we fix it right.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 00:50:56 +00:00
Chris Lattner
32c9a4527d Fix PR1103 and Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 00:13:07 +00:00
Chris Lattner
ae77c7b47a remove dead code, frameindices must be resolve before the asmprinter runs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33187 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 23:59:03 +00:00
Chris Lattner
a5c5e7715c Fix Transforms/InstCombine/2007-01-13-ExtCompareMiscompile.ll, which is part
of PR1107


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33185 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 23:11:38 +00:00
Reid Spencer
ac3e76ca8f Fix indentation to prior level for easier diffs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33184 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:10:53 +00:00
Reid Spencer
6f40790252 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:00:46 +00:00
Reid Spencer
8088e9dfb4 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33181 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:00:20 +00:00
Nick Lewycky
0be7f47735 "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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 02:05:28 +00:00
Reid Spencer
a1fed2d1c0 Fix a FIXME. 1 bit integer types are now printed as i1 not bool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33176 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 01:09:33 +00:00
Chris Lattner
54a525d7ae Fix a minor bug handling constant exprs, introduced by a recent patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33175 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:42:58 +00:00
Reid Spencer
062f0360ed Make sure the IntegerValType has enough space for 2^23 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33168 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:12:29 +00:00
Reid Spencer
790366be6d Make sure that GEP indices are only 32 or 64 bits. We're not ready for
indices with other bit sizes yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33167 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:10:02 +00:00
Reid Spencer
b61c1cefb2 Get rid of some useless distinction between bool and integer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33166 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:09:12 +00:00
Chris Lattner
c08b56f6a0 fix a bug in a recent patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 00:02:49 +00:00
Reid Spencer
31b8568baa Remove this file. It was inadvertently added because I could not find
TargetLowering.cpp in CodeGen/SelectionDAG (location makes no sense to me)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:32:11 +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
Chris Lattner
286bf46a23 remove over-general code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:28:32 +00:00
Chris Lattner
fb93931939 remove unneeded special case for bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:26:17 +00:00
Chris Lattner
a55866f2cc Eliminate a log(n) lookup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:23:08 +00:00
Reid Spencer
7aa8a45922 Adjust #includes to compensate for lost of DerivedTypes.h in
TargetLowering.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33154 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:22:14 +00:00
Reid Spencer
a214cbbc80 Add a new home for TargetLowering member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 23:18:18 +00:00
Chris Lattner
c09b52faff remove obsolete fixme
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33151 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:52:50 +00:00
Chris Lattner
ef60b2c4ed simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33150 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:51:20 +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
720922fe27 Remove over-general comparisons
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:49:11 +00:00
Jim Laskey
fa30182eb8 Allow isAllOnesValue testing on packed constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 22:39:14 +00:00
Lauro Ramos Venancio
5293e7d5d6 Don't add or sub zero to sp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33142 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 20:52:27 +00:00
Lauro Ramos Venancio
a38bbf7dd3 Build constants using instructions mov/orr or mvn/eor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33141 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 20:35:49 +00:00
Devang Patel
e24e0e1244 s/addPassToManager/add/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33138 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
178a352079 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33137 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:22:51 +00:00
Anton Korobeynikov
7f70559bc4 * 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:20:47 +00:00
Devang Patel
ab7752c149 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33135 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:52:44 +00:00
Chris Lattner
d333d90673 Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33134 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:42:52 +00:00
Chris Lattner
e9d4fa7a92 eliminate redundant check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33132 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:35:11 +00:00
Chris Lattner
0fab59c7af regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:33:30 +00:00
Chris Lattner
89282b8fe7 This production is dead, the lexer can never return 'NOT'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:32:39 +00:00
Chris Lattner
97d1fad3d2 Branch conditions must be i1
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33129 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:30:11 +00:00
Chris Lattner
ef3baf0979 don't discriminate against bool
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33128 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:28:58 +00:00
Chris Lattner
05b30d840a remove unneeded special cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33127 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:23:49 +00:00
Chris Lattner
0bb38313ae GEP operands can't be bools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:20:48 +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
Devang Patel
a0dd987916 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33121 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 17:23:48 +00:00
Reid Spencer
4db2063eee Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:28:27 +00:00
Reid Spencer
c25a9b9102 Integer type names need 1 or more digits, not zero or more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:27:59 +00:00
Reid Spencer
15ee935fc5 Always write 1 bit integers as i1 not "bool".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33115 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:25:20 +00:00
Evan Cheng
e77d10df41 Comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33114 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:25:16 +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
Nick Lewycky
28c5b1544a 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33104 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 01:23:53 +00:00
Nick Lewycky
c2a7d097f9 Clean up logic after ConstantBool removal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 00:02:12 +00:00
Devang Patel
36bcb82c3f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 22:15:30 +00:00
Devang Patel
6b9420e943 Use getPassManagerType() instead of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33078 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 19:59:06 +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
34dceb4757 Remove unnecessary boolean type check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33075 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 14:38:17 +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
Zhou Sheng
057809ac1c Fixed indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 10:33:26 +00:00
Reid Spencer
11b910c71f Shut up a warning about signed/unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33071 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 07:58:19 +00:00
Chris Lattner
ac618e6a9d simplify some logic further
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33069 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 04:30:21 +00:00
Chris Lattner
22379bc7bb Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33068 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 03:54:27 +00:00
Nick Lewycky
bc00fec835 Quiet compiler warning. The only reason the function is marked virtual
is so that it can be called from inside a debugger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33067 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 02:38:21 +00:00
Nick Lewycky
419c6f5ac8 New predicate simplifier!
Please do not enable, there is still some known miscompile problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33066 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 02:32:38 +00:00
Devang Patel
25919cb780 Add PassManagerType enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 01:10:25 +00:00
Reid Spencer
65de742b8a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33064 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:35:10 +00:00
Reid Spencer
5305478511 Implement better constant folding of unordered FCMP predicates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33063 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:25:45 +00:00
Devang Patel
97149737f2 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 00:19:00 +00:00
Reid Spencer
11f457aad3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 19:50:43 +00:00
Reid Spencer
162b02e327 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33054 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 09:18:16 +00:00
Chris Lattner
b2b442f06d Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 07:01:46 +00:00
Chris Lattner
55e73a5493 eliminate some iterator gymnastics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33052 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 06:43:26 +00:00
Reid Spencer
7679693fdf Change the file header name as this file was renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 04:17:32 +00:00
Reid Spencer
93a0962e08 Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33050 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-10 04:16:17 +00:00
Chris Lattner
39ff1e2afc Fix a bug in heap-sra that caused compilation failure of office-ispell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33043 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 23:29:37 +00:00
Reid Spencer
251f21492e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33039 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 17:09:09 +00:00
Chris Lattner
cf8790aaff Inline insertValue into CreateModuleSlot/CreateFunctionSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33038 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 08:04:59 +00:00
Chris Lattner
22990aae5c Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33037 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:58:11 +00:00
Chris Lattner
9446bbe7d4 Split CreateSlot into two versions, one for globals and one for function-local
values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33036 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:55:49 +00:00
Chris Lattner
3a4621c5f6 Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 07:46:21 +00:00
Reid Spencer
30f9e27f64 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33034 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-09 06:38:06 +00:00
Evan Cheng
c8edc64188 Naming consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33026 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:55:53 +00:00
Evan Cheng
c62d4bb695 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33025 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:50:38 +00:00
Chris Lattner
ddae4bd683 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33024 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 23:04:05 +00:00
Jim Laskey
6488a078ba Need to handle static declarations properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33022 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 22:15:18 +00:00
Jeff Cohen
dfc12993b9 Unbreak VC++ build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33021 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 20:17:17 +00:00