Commit Graph

16831 Commits

Author SHA1 Message Date
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