Commit Graph

16796 Commits

Author SHA1 Message Date
Evan Cheng 97057f37a5 - 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 120ab038eb 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 c050af9126 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 f15cd5637b Use a cheaper computation.
llvm-svn: 33336
2007-01-18 18:14:49 +00:00
Reid Spencer 726b68bc6e 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 889d934d00 move contents of PR587 to here.
llvm-svn: 33333
2007-01-18 07:34:57 +00:00
Reid Spencer 2867a1d466 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 a341fab0af The zerofill directive needs a newline after it.
llvm-svn: 33327
2007-01-18 02:30:19 +00:00
Reid Spencer f854f95a17 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 10fe0e0d48 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 4b8d03e084 Minor code clean up.
llvm-svn: 33323
2007-01-18 01:49:58 +00:00
Reid Spencer 300e7fcb55 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 fab44b682e 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 01f7e06d8f Make sure we truncate stored values to their bit width.
llvm-svn: 33317
2007-01-18 01:24:02 +00:00
Bill Wendling e750f61ac5 Have the OutputBuffer take the is64Bit and isLittleEndian booleans.
llvm-svn: 33316
2007-01-18 01:23:11 +00:00
Chris Lattner c1ea85b4c4 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 0ee2d46cfe add new JumpTableSpecialLabelPrefix hook to asmprinter for jumptable emission.
llvm-svn: 33314
2007-01-18 01:12:56 +00:00
Bill Wendling cd9c1f035a 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 48537a046c Add CGPassManager.
llvm-svn: 33309
2007-01-17 21:45:01 +00:00
Devang Patel 23f8aa921e Update ModulePass::assignPassManager() to take into account Preferred
Pass Manager Type.

llvm-svn: 33308
2007-01-17 21:19:23 +00:00
Devang Patel fd41843243 s/PassDebugging_New/PassDebugging/g
llvm-svn: 33307
2007-01-17 20:33:36 +00:00
Devang Patel dffca63396 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 f64cc9edd1 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 88b45f9a2c darwin doesn't support .bss, but it does have .zerofill
llvm-svn: 33303
2007-01-17 17:43:33 +00:00
Chris Lattner 1ceb643f31 add new directive
llvm-svn: 33302
2007-01-17 17:42:42 +00:00
Anton Korobeynikov 3f6d52834b * 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 38ee6519b7 Revert patch.
llvm-svn: 33298
2007-01-17 09:06:13 +00:00
Bill Wendling 05e5a5ee6c Create the specified TargetObjInfo and use it.
llvm-svn: 33291
2007-01-17 03:51:37 +00:00
Bill Wendling a967e9c9a9 Create/store/and delete the TargetObjInfo object.
llvm-svn: 33290
2007-01-17 03:50:41 +00:00
Bill Wendling dcc324b15b Use the methods in the TargetObjInfo object instead of internal methods.
llvm-svn: 33289
2007-01-17 03:49:21 +00:00
Bill Wendling f758157385 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 ceb8459f1d Regenerate.
llvm-svn: 33284
2007-01-17 02:48:45 +00:00
Reid Spencer 082a77f1c9 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 00e5e0ea8f For PR1117:
Expose the previously hidden checkCast function as CastInst::castIsValid.

llvm-svn: 33282
2007-01-17 02:46:11 +00:00
Reid Spencer a8a1547370 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 d85662f67d 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 3312f75071 Undo last check-in.
Remove setupPassManager() and its use.

llvm-svn: 33270
2007-01-16 21:43:18 +00:00
Anton Korobeynikov 31fcc2cde9 Missed "<" :)
llvm-svn: 33265
2007-01-16 20:22:18 +00:00
Devang Patel 68dc3d2263 Setup pass manager before scheduling required analysis.
llvm-svn: 33262
2007-01-16 19:46:09 +00:00
Anton Korobeynikov 922965aa29 Cleanup. Comments added.
llvm-svn: 33260
2007-01-16 18:23:09 +00:00
Chris Lattner 4202f37352 Fix SMG2000 with the CBE: opaque types need names too.
llvm-svn: 33258
2007-01-16 18:02:45 +00:00
Chris Lattner 6cc58a0dc5 document some subtlety
llvm-svn: 33257
2007-01-16 17:51:40 +00:00
Anton Korobeynikov 4f01b783a3 Emit symbol type information for ELF/COFF targets
llvm-svn: 33256
2007-01-16 16:41:57 +00:00
Bill Wendling c7b2ab9bdf 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 5488ade154 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 89e5813312 add a note: we need whole-function selectiondags :)
llvm-svn: 33252
2007-01-16 06:39:48 +00:00
Chris Lattner 4dc4489286 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 f70c5cd5db 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 0b3a451e1b 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 e21237e59a 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 4268fc08d3 Code refactoring.
llvm-svn: 33245
2007-01-16 02:00:38 +00:00
Devang Patel 6975b6ec09 Remove extra white spaces. Fix comments.
llvm-svn: 33244
2007-01-15 23:06:56 +00:00
Devang Patel 39786a90d0 Do not record last users of Pass Manager.
llvm-svn: 33243
2007-01-15 20:31:54 +00:00
Jeff Cohen 9431075206 Unbreak VC++ build.
llvm-svn: 33242
2007-01-15 20:27:18 +00:00
Chris Lattner 90d2e426f9 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner 479a9fc492 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 6ce36cff3a 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 c8dcede292 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 27df1db485 simplify some code now that types are signless
llvm-svn: 33232
2007-01-15 07:02:54 +00:00
Chris Lattner a4beeef76c 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 26933ddb10 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 e76908ba81 add some notes
llvm-svn: 33228
2007-01-15 06:25:39 +00:00
Chris Lattner 03c4953cdd 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 c1be5ac420 regenerate
llvm-svn: 33224
2007-01-15 02:12:07 +00:00
Chris Lattner 57eedaca52 teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +00:00
Chris Lattner c69c6c4db2 eliminate calls to Type::isInteger, preferring isIntegral instead.
llvm-svn: 33222
2007-01-15 02:03:16 +00:00
Chris Lattner b02536cadf allow i1 to operators like shift and add.
llvm-svn: 33221
2007-01-15 02:00:29 +00:00
Chris Lattner 4442e4b401 Update code to eliminate calls to isInteger, calling isIntegral instead.
llvm-svn: 33220
2007-01-15 01:58:56 +00:00
Chris Lattner 1942249c5b Eliminate calls to isInteger, generalizing code and tightening checks as needed.
llvm-svn: 33218
2007-01-15 01:55:30 +00:00
Chris Lattner f448a8c8ac Make use of isInteger vs isIntegral more explicit
llvm-svn: 33216
2007-01-15 01:48:11 +00:00
Chris Lattner f9478e757b Fix correlated exprs regressions
llvm-svn: 33214
2007-01-15 01:02:34 +00:00
Chris Lattner 885433b15b don't discriminate against i1
llvm-svn: 33213
2007-01-15 00:45:50 +00:00
Chris Lattner f739d01059 Fix Analysis/Dominators/2006-10-02-BreakCritEdges.ll
llvm-svn: 33210
2007-01-15 00:15:09 +00:00
Chris Lattner 6ee923f3bb 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 9818a6fd76 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 cce06fd277 No hidden visiblity on Mingw32/Cygwin
llvm-svn: 33202
2007-01-14 11:49:39 +00:00
Chris Lattner 3c84b551db 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 8c51bf5bf6 add support for hidden visibility to darwin/x86
llvm-svn: 33198
2007-01-14 06:29:53 +00:00
Chris Lattner 9f6badbc41 add a new HiddenDirective member for handling visibility.
llvm-svn: 33197
2007-01-14 06:27:21 +00:00
Chris Lattner ae5db00419 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 875d7b2b1d 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 5a55476211 Fix PR1101 and Analysis/ScalarEvolution/trip-count.ll
llvm-svn: 33193
2007-01-14 01:24:47 +00:00
Chris Lattner 6bbb29ba40 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 5544e17a08 Fix PR1103 and Regression/CodeGen/X86/2007-01-13-StackPtrIndex.ll
llvm-svn: 33189
2007-01-14 00:13:07 +00:00
Chris Lattner de86991b14 remove dead code, frameindices must be resolve before the asmprinter runs.
llvm-svn: 33187
2007-01-13 23:59:03 +00:00
Chris Lattner 387bf3f700 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 47bb5c996e Fix indentation to prior level for easier diffs.
llvm-svn: 33184
2007-01-13 05:10:53 +00:00
Reid Spencer 58a8db0a3f Regenerate.
llvm-svn: 33182
2007-01-13 05:00:46 +00:00
Reid Spencer 502d64e654 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 4294446fcb "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 91d93de25e 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 ff7434a526 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 ea4374c0d4 Make sure the IntegerValType has enough space for 2^23 bits.
llvm-svn: 33168
2007-01-13 00:12:29 +00:00
Reid Spencer d8d0540d9b 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 bea2e4cf23 Get rid of some useless distinction between bool and integer.
llvm-svn: 33166
2007-01-13 00:09:12 +00:00
Chris Lattner ca82a908e3 fix a bug in a recent patch
llvm-svn: 33164
2007-01-13 00:02:49 +00:00
Reid Spencer 73497b26cd 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 a8a0f2cf68 Compensate for loss of DerivedTypes.h in TargetLowering.h
llvm-svn: 33159
2007-01-12 23:31:12 +00:00
Reid Spencer ddf1421b8e Move a function out of line.
llvm-svn: 33158
2007-01-12 23:30:31 +00:00
Chris Lattner 5699b8e3d0 remove over-general code.
llvm-svn: 33157
2007-01-12 23:28:32 +00:00