Commit Graph

5419 Commits

Author SHA1 Message Date
Chris Lattner a919f6dddc if functiontype is going to have a pointer to a paramattr object, it better
be const.  The only way to get a pointer to these returns a const pointer.

llvm-svn: 36734
2007-05-04 03:39:28 +00:00
Chris Lattner c97d08f702 add a helper
llvm-svn: 36729
2007-05-04 03:13:39 +00:00
Chris Lattner 302dc74536 remove unused code
llvm-svn: 36727
2007-05-04 03:01:46 +00:00
Chris Lattner e796a9eec9 add new codes
llvm-svn: 36725
2007-05-04 03:00:00 +00:00
Chris Lattner 5a800309af add a new code
llvm-svn: 36703
2007-05-03 22:16:11 +00:00
Jeff Cohen ee7bf76342 Unbreak VC++ build.
llvm-svn: 36700
2007-05-03 22:09:21 +00:00
Devang Patel 2acc9769cc Use iterative while loop instead of recursive function call.
llvm-svn: 36694
2007-05-03 20:55:18 +00:00
Dan Gohman ac050d446b Use the explicit keyword for the SCEV class' constructor.
llvm-svn: 36686
2007-05-03 18:45:06 +00:00
Chris Lattner 357882d27c This is a patch to fix a compile error in STLExtras.h, and
a bug in GraphWriter.cpp.

Patch by Florian Brandner

llvm-svn: 36684
2007-05-03 18:32:10 +00:00
Chris Lattner 44e49e8665 remove extraneous type qualifiers
llvm-svn: 36679
2007-05-03 18:14:56 +00:00
Chris Lattner 2b8a4a624b remove extraneous top-level semi's
llvm-svn: 36678
2007-05-03 18:13:15 +00:00
Chris Lattner e33d087d1d remove two useless functions. Just inherit Type's implementation instead.
llvm-svn: 36677
2007-05-03 17:10:20 +00:00
Chris Lattner b86da5adbc remove useless type qualifiers
llvm-svn: 36676
2007-05-03 17:09:36 +00:00
Chris Lattner d0803d2e4e avoid invalid C++ token in #error
llvm-svn: 36674
2007-05-03 16:57:26 +00:00
Devang Patel 8c78a0bff0 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Chris Lattner 6ac3a37fb6 Add a new option.
llvm-svn: 36657
2007-05-03 00:16:07 +00:00
Devang Patel e95c6ad802 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel 0f88f76cfe Re-install patch to enable use of PassID.
I am preparing another patch to address the failure that prompted
Chris to revert this patch earlier.

llvm-svn: 36649
2007-05-02 20:38:25 +00:00
Chris Lattner 7f716a937f update to reflect reality
llvm-svn: 36643
2007-05-02 05:47:22 +00:00
Chris Lattner 11dfd35627 revert enough of devang's recent patches to get the tree basically working again
llvm-svn: 36638
2007-05-02 04:25:31 +00:00
Anton Korobeynikov b538f67b1a Fix couple of bugs connected with eh info:
1. Correct output offsets on Linux
2. Fix "style" of personality function. It shouldn't be indirect.

llvm-svn: 36633
2007-05-01 22:23:12 +00:00
Devang Patel 09f162ca6a Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Evan Cheng 61e237d6a5 Pass call frame setup SP adjustment along to eliminateFrameIndex().
llvm-svn: 36624
2007-05-01 08:59:18 +00:00
Evan Cheng 16827c38c4 Add SPAdj parameter to account for call frame setup SP adjustment.
llvm-svn: 36623
2007-05-01 08:58:27 +00:00
Nate Begeman 27a625a74b llvm bug #1350, parts 1, 2, and 3.
llvm-svn: 36618
2007-05-01 05:57:02 +00:00
Chris Lattner 81c7fc2783 several bitfixes to JumpToBit
llvm-svn: 36616
2007-05-01 05:51:32 +00:00
Chris Lattner 0f9f44a96d add JumpToBit, an explicit init method, and a default ctor.
llvm-svn: 36613
2007-05-01 04:59:06 +00:00
Chris Lattner 20f0d2e290 add missing opcode.
llvm-svn: 36608
2007-05-01 02:12:05 +00:00
Evan Cheng 366feaed91 Added hook hasReservedCallFrame(). It returns true if the call frame is
included as part of the stack frame.

llvm-svn: 36606
2007-05-01 00:47:46 +00:00
Christopher Lamb 7c30c26fcb Implement review feedback.
llvm-svn: 36603
2007-04-30 23:54:10 +00:00
Christopher Lamb 019064279e Header file for ELF relocations.
llvm-svn: 36597
2007-04-30 20:41:08 +00:00
Anton Korobeynikov 16e2c5fec1 Fix comment
llvm-svn: 36596
2007-04-30 19:14:56 +00:00
Reid Spencer 8d4ff90680 If an archive is not recognized as an LLVM bytecode archive then declare
that it is native so that the linker will pass it on downstream. This avoids
a problem where the native link line fails because there is both a .so and
a .a file. The .a file gets processed as bytecode and then dropped from the
command line.

llvm-svn: 36584
2007-04-30 00:29:39 +00:00
Chris Lattner 84e376f669 add some helpers
llvm-svn: 36580
2007-04-29 21:49:05 +00:00
Chris Lattner e2ea46d50b compute this value correctly
llvm-svn: 36575
2007-04-29 19:49:58 +00:00
Dale Johannesen 1ee29dd026 Make ARM-specific version of getInlineAsmLength
llvm-svn: 36572
2007-04-29 19:17:45 +00:00
Chris Lattner b9bf8a8daa add a method
llvm-svn: 36571
2007-04-29 19:17:32 +00:00
Anton Korobeynikov 39f3cffbe3 Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols.

llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Anton Korobeynikov 546ea7ea88 Implement review feedback
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Chris Lattner a05721d340 Jeff's fix was fine
llvm-svn: 36563
2007-04-29 17:44:10 +00:00
Chris Lattner 8f73e83c49 add missing ctor
llvm-svn: 36562
2007-04-29 17:40:50 +00:00
Jeff Cohen 990a58f242 Fix MemoryBuffer breakage correctly.
llvm-svn: 36561
2007-04-29 14:43:31 +00:00
Chris Lattner fc4d7cd1ff make this file self-contained
llvm-svn: 36555
2007-04-29 08:05:07 +00:00
Chris Lattner 6694f60bec Switch the bitcode reader interface to take a MemoryBuffer instead of knowing
anything about disk I/O itself.  This greatly simplifies its interface -
eliminating the need for the ReaderWrappers.cpp file.

This adds a new option to llvm-dis (-bitcode) which instructs it to read
the input file as bitcode.  Until/unless the bytecode reader is taught to
read from MemoryBuffer, there is no way to handle stdin reading without it.

I don't plan to switch the bytecode reader over, I'd rather delete it :),
so the option will stay around temporarily.

llvm-svn: 36554
2007-04-29 07:54:31 +00:00
Chris Lattner ee2d1f1ed2 Add a new memorybuffer class, to unify all the file reading code in the system
llvm-svn: 36553
2007-04-29 06:58:52 +00:00
Chris Lattner 084982501a new method for creating a path, which does not create a temporary string.
llvm-svn: 36552
2007-04-29 06:16:32 +00:00
Anton Korobeynikov b18f8f85e9 Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.

llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Chris Lattner f40a0a8b9f add a default parameter
llvm-svn: 36529
2007-04-28 05:42:38 +00:00
Chris Lattner 19651c77b2 add a way to make this less brittle
llvm-svn: 36528
2007-04-28 05:38:52 +00:00
Chris Lattner c48e2c3100 represent indirect operands explicitly in inline asm strings.
llvm-svn: 36522
2007-04-28 01:02:58 +00:00
Chris Lattner 2705829925 add a GEP helper function
llvm-svn: 36515
2007-04-27 20:35:56 +00:00
Jeff Cohen 6a23901014 Fix prolific source of 'possible loss of data' warnings.
llvm-svn: 36507
2007-04-27 14:43:05 +00:00
Devang Patel 2c1bba0c0c Move ~Pass() from Pass.h into Pass.cpp
llvm-svn: 36498
2007-04-26 21:33:42 +00:00
Devang Patel e6354bd3ff Delete Analysis Resolver.
llvm-svn: 36493
2007-04-26 21:06:41 +00:00
Dan Gohman e131e3ac02 Fix a typo in a comment.
llvm-svn: 36485
2007-04-26 19:40:56 +00:00
Evan Cheng 910c80851e Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.
llvm-svn: 36483
2007-04-26 19:00:32 +00:00
Jeff Cohen 476db10261 Rename identifier that GCC uses as a macro, breaking llvm-gcc build.
llvm-svn: 36474
2007-04-26 15:07:47 +00:00
Chris Lattner 1ceecb5df4 start defining codes for instructions
llvm-svn: 36471
2007-04-26 05:53:04 +00:00
Chris Lattner ca3b44aa57 add a new code
llvm-svn: 36462
2007-04-26 03:26:26 +00:00
Chris Lattner 6337d7b7c7 add alias support to bitcode
llvm-svn: 36460
2007-04-26 02:46:23 +00:00
Evan Cheng 43a17fe826 Be careful when to add implicit kill / dead operands. Don't add them during / post reg-allocation.
llvm-svn: 36458
2007-04-26 01:40:09 +00:00
Evan Cheng d21968d11a Change UsedPhysRegs from array bool to BitVector to save some space. Setting / getting its states now go through MachineFunction.
llvm-svn: 36451
2007-04-25 22:10:09 +00:00
Evan Cheng 0fbe14ab87 Data structure change to improve compile time (especially in debug mode).
llvm-svn: 36447
2007-04-25 19:34:00 +00:00
Devang Patel 7f7b8985f8 Mem2Reg does not need TargetData.
llvm-svn: 36446
2007-04-25 18:41:11 +00:00
Devang Patel 073be55d8e Remove unused function argument.
llvm-svn: 36441
2007-04-25 17:15:20 +00:00
Anton Korobeynikov cb5b13a0b8 Add missed file
llvm-svn: 36439
2007-04-25 16:42:39 +00:00
Anton Korobeynikov a97b694c82 Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.

llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Evan Cheng 7818c03c6b Fix for PR1306.
- A register def / use now implicitly affects sub-register liveness but does
not affect liveness information of super-registers.
- Def of a larger register (if followed by a use later) is treated as
read/mod/write of a smaller register.

llvm-svn: 36434
2007-04-25 07:30:23 +00:00
Evan Cheng 93e3a2e6f7 Test if a register is sub- or super-register of another.
llvm-svn: 36433
2007-04-25 07:24:50 +00:00
Evan Cheng 559fae748c Minor speed tweak.
llvm-svn: 36432
2007-04-25 07:24:13 +00:00
Chris Lattner 868d969081 support for >4G frames
llvm-svn: 36424
2007-04-25 04:29:06 +00:00
Chris Lattner 9bd98ea4c1 support > 4G stack objects
llvm-svn: 36422
2007-04-25 04:20:54 +00:00
Chris Lattner 7bf18ba0a2 allow 64-bit stack objects
llvm-svn: 36419
2007-04-25 04:07:31 +00:00
Bill Wendling 5c7f25632e Add the final MMX instructions. Correct a few wrong patterns.
llvm-svn: 36405
2007-04-24 21:18:37 +00:00
Chris Lattner a11d217c7a comentate
llvm-svn: 36395
2007-04-24 15:54:42 +00:00
Chris Lattner c6a993dc8c add records for constant exprs
llvm-svn: 36393
2007-04-24 07:03:08 +00:00
Chris Lattner 82202333be add codes for constants table
llvm-svn: 36382
2007-04-23 23:29:59 +00:00
Christopher Lamb 15ea59ddfc Fix bug in isFloatingPoint()
llvm-svn: 36381
2007-04-23 22:50:40 +00:00
Chris Lattner 3e8d122a25 add a missing operator
llvm-svn: 36375
2007-04-23 20:58:14 +00:00
Chris Lattner 7abd70a4a9 Fix a bug in bitstream writer handling abbrevs, add value symtab
llvm-svn: 36373
2007-04-23 20:34:46 +00:00
Chris Lattner 1c927957f0 implement reading of abbrevs
llvm-svn: 36366
2007-04-23 18:57:58 +00:00
Chris Lattner 49ca73d7bc minor cleanups
llvm-svn: 36365
2007-04-23 18:57:32 +00:00
Chris Lattner 9dd74dbe15 finish implementation of basic abbrev writing.
llvm-svn: 36364
2007-04-23 17:43:52 +00:00
Chris Lattner 4b00d92a09 first part of implementation of abbrevs. The writer isn't fully there yet and the
reader doesn't handle them at all yet.

llvm-svn: 36363
2007-04-23 16:04:05 +00:00
Chris Lattner b652b1346e promote this to being a public header.
llvm-svn: 36357
2007-04-23 01:01:15 +00:00
Christopher Lamb 8af6d5896f PR400 phase 2. Propagate attributed load/store information through DAGs.
llvm-svn: 36356
2007-04-22 23:15:30 +00:00
Christopher Lamb f9206e267d PR400 phase 1 implementation feedback.
llvm-svn: 36354
2007-04-22 22:22:02 +00:00
Jeff Cohen af9a8a51a8 Have compiler enforce this.
llvm-svn: 36353
2007-04-22 22:16:55 +00:00
Christopher Lamb 8448570beb PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Jeff Cohen 33be4c78ef Fix build problem with Gentoo 4.1.1-r3.
llvm-svn: 36348
2007-04-22 18:49:32 +00:00
Reid Spencer c6a83847a2 For PR1136:
Add reference counting to ParamAttrsList and make use of it in Function,
CallInst and InvokeInst classes.

llvm-svn: 36346
2007-04-22 17:28:03 +00:00
Reid Spencer 380058025b Terminate with newline.
llvm-svn: 36345
2007-04-22 16:31:22 +00:00
Reid Spencer 386837680f Undo premature commit.
llvm-svn: 36344
2007-04-22 16:30:47 +00:00
Reid Spencer d1906a945d Terminate file with newline.
llvm-svn: 36343
2007-04-22 16:29:35 +00:00
Jeff Cohen 7368a611fb Implement review feedback.
llvm-svn: 36342
2007-04-22 15:11:24 +00:00
Jeff Cohen e7518d5dd7 Teach Visual Studio about Bitcode.
llvm-svn: 36341
2007-04-22 15:00:52 +00:00
Chris Lattner eb9b37fd39 Define the content-independent interfaces to read/write bitcode files and
the high-level interface to read/write LLVM IR bitcode files.

This is a work in progress.

llvm-svn: 36329
2007-04-22 06:22:05 +00:00
Reid Spencer 4388f0b4fa For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.

llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Lauro Ramos Venancio 4e91908f17 X86 TLS: Implement review feedback.
llvm-svn: 36318
2007-04-21 20:56:26 +00:00
Reid Spencer 0c1349e6bc Revert Christopher Lamb's load/store alignment changes.
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Jeff Cohen bef777f506 Make enum-valued bitfield large enough to avoid interpretation as negative values in VC++.
llvm-svn: 36304
2007-04-21 16:29:37 +00:00
Jeff Cohen fa12f9d64a Fix breakage of bytecode reader when built with VC++.
llvm-svn: 36303
2007-04-21 15:29:13 +00:00
Jeff Cohen a30107fb03 The expression "SubclassData = (SubclassData & ~1) | (V) ? 1 : 0;" does not do what
was intended!  | has higher precedence than ?.  Caught by Visual Studio.

llvm-svn: 36302
2007-04-21 14:32:59 +00:00
Christopher Lamb bff50208c8 add support for alignment attributes on load/store instructions
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Owen Anderson 94e1d9aa39 Fix some null checks to actually test the part that needs checking.
llvm-svn: 36298
2007-04-21 07:04:45 +00:00
Evan Cheng 951ed1bdd2 Add super-register set.
llvm-svn: 36295
2007-04-21 00:54:06 +00:00
Chris Lattner d9d3a4bbd6 Fix a problem where primitive types lose their name after llvm_shutdown is called.
This also reduces the amount of work done at static construction time.

llvm-svn: 36285
2007-04-20 22:33:47 +00:00
Lauro Ramos Venancio 2518889872 Implement "general dynamic", "initial exec" and "local exec" TLS models for
X86 32 bits.

llvm-svn: 36283
2007-04-20 21:38:10 +00:00
Evan Cheng 3bf93733b9 Add sub-registers set accessor.
llvm-svn: 36282
2007-04-20 21:28:05 +00:00
Evan Cheng da2bf2ce0a Add sub-register sets.
llvm-svn: 36277
2007-04-20 21:11:22 +00:00
Owen Anderson 2da606c757 Move more passes to using ETForest instead of DominatorTree.
llvm-svn: 36271
2007-04-20 06:27:13 +00:00
Owen Anderson 7a5136d8c5 Add null checks and const-ify these accessors.
llvm-svn: 36270
2007-04-20 05:44:16 +00:00
Chris Lattner bc43e8d0b3 Fix a very strange assertion message, patch by Christopher Lamb
CVS: ----------------------------------------------------------------------

llvm-svn: 36267
2007-04-20 03:27:36 +00:00
Jeff Cohen 8cd3f3d7b4 Fix some VC++ warnings.
llvm-svn: 36259
2007-04-19 02:04:09 +00:00
Owen Anderson 9749c4744e Add accessor to get the blocks immediately dominated by a given block to ETForest.
llvm-svn: 36251
2007-04-18 05:25:09 +00:00
Evan Cheng 4c53d321aa VarInfo::UsedBlocks is no longer used. Remove.
llvm-svn: 36250
2007-04-18 05:04:38 +00:00
Owen Anderson fae86bcbaa Add an accessor to make ETForest more useful.
llvm-svn: 36246
2007-04-18 04:38:39 +00:00
Evan Cheng b408e8f11d Don't populate TryAgainList when coalescing only physical registers with virtual registers.
llvm-svn: 36240
2007-04-18 02:30:19 +00:00
Chris Lattner 0d7265650d what's an & between friends?
llvm-svn: 36234
2007-04-18 00:43:05 +00:00
Evan Cheng b881bdabd9 Copy coalescing change to prevent a physical register from being pin to a
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
   registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
   preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
   first (if available) to create identify moves that can be eliminated.

llvm-svn: 36218
2007-04-17 20:32:26 +00:00
Evan Cheng 57b5214d59 Add a register allocation preference field; add a method to compute size of a live interval.
llvm-svn: 36216
2007-04-17 20:25:11 +00:00
Evan Cheng 2f45bf31c5 Change getAllocatableSet() so it returns allocatable registers for a specific register class.
llvm-svn: 36215
2007-04-17 20:23:34 +00:00
Evan Cheng 8387cf1100 Keep track of number of uses within the function per virtual register.
llvm-svn: 36214
2007-04-17 20:22:11 +00:00
Chris Lattner 51109b7830 Commit an patch from Gabor Greif in Mar 2005. This eliminates the tail
pointer from ilist, storing it in the prev pointer of the first node in the
list instead.

This shrinks ilist from 8 to 4 bytes, BasicBlock from 40->36 bytes, Function
from 76->68 bytes, Module from 52->44 bytes.

llvm-svn: 36210
2007-04-17 18:41:42 +00:00
Chris Lattner ceb4b20807 make getnext/getprev accessors private.
llvm-svn: 36209
2007-04-17 18:30:41 +00:00
Chris Lattner 4a1e0b8c3e make next/prev accessors private
llvm-svn: 36207
2007-04-17 18:16:39 +00:00
Chris Lattner d1721d2e50 bool on darwin/ppc is 4 bytes.
llvm-svn: 36206
2007-04-17 18:15:04 +00:00
Chris Lattner b0aebc208c Instruction:: Next/Prev accessors are now private
llvm-svn: 36204
2007-04-17 18:03:55 +00:00
Anton Korobeynikov 8b7aab009e Implemented correct stack probing on mingw/cygwin for dynamic alloca's.
Also, fixed static case in presence of eax livin. This fixes PR331

PS: Why don't we still have push/pop instructions? :)
llvm-svn: 36195
2007-04-17 09:20:00 +00:00
Jeff Cohen 38be56ddf5 Fix build breakage on 64-bit systems.
llvm-svn: 36193
2007-04-17 05:33:04 +00:00
Chris Lattner 3c2ff10b93 merge several fields in GlobalValue to use the same word, move CallingConv
field into SubclassData in Value.  This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68.  This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.

llvm-svn: 36192
2007-04-17 04:31:29 +00:00
Chris Lattner 422cfcdcb3 The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant.  As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits.  This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.

llvm-svn: 36189
2007-04-17 04:04:14 +00:00
Chris Lattner b47aa543bb Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.

llvm-svn: 36188
2007-04-17 03:26:42 +00:00
Chris Lattner 0ed36f4078 urr, yeah.
llvm-svn: 36187
2007-04-17 02:04:39 +00:00
Reid Spencer 654b96df8b Fix 80 col violations.
llvm-svn: 36168
2007-04-16 21:24:12 +00:00
Devang Patel 9294281ac1 Proivde getAnalysis<FPAnalysis>(Func) support.
llvm-svn: 36159
2007-04-16 20:56:24 +00:00
Devang Patel e64d30573f Give each pass manager chance to manage lower level analysis pass, which is
pass required by one of pass managed by the manager.

llvm-svn: 36153
2007-04-16 20:12:57 +00:00
Devang Patel 254c9eb7c8 Add getPotentialPassManagerType(). No functionality change, yet.
llvm-svn: 36149
2007-04-16 18:51:25 +00:00
Anton Korobeynikov fb80151c42 Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.

llvm-svn: 36146
2007-04-16 18:10:23 +00:00
Reid Spencer 9c2eec377e For PR1328:
Don't assert everytime an intrinsic name isn't recognized. Instead, make
the assert optional when callin getIntrinsicID(). This allows the assembler
to handle invalid intrinsic names gracefully.

llvm-svn: 36120
2007-04-16 06:54:34 +00:00
Owen Anderson f064c92298 Tabs -> Spaces
llvm-svn: 36094
2007-04-15 23:14:18 +00:00
Owen Anderson f35a1dbc7a Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
constructing ImmediateDominator is now folded into DomTree construction.

This is part of the ongoing work for PR217.

llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson 78cecc817f Make ETForest depend on DomTree rather than IDom. This is the first step
in the long process that will be fixing PR 217.

llvm-svn: 36034
2007-04-14 23:49:24 +00:00
Jeff Cohen e7ce8f23f6 Fix PR1329.
llvm-svn: 36016
2007-04-14 21:50:21 +00:00
Chris Lattner 45f15572f7 add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method.
Writing it twice in the same day was too much for me.

llvm-svn: 35978
2007-04-14 00:12:57 +00:00
Reid Spencer 9329e7b626 Implement a getBitsNeeded method to determine how many bits are needed to
represent a string in binary form by an APInt.

llvm-svn: 35968
2007-04-13 19:19:07 +00:00
Dan Gohman a789d31517 Rename Value::getValueType to getValueID, to avoid confusion with
other things named getValueType.

llvm-svn: 35964
2007-04-13 18:12:09 +00:00
Chris Lattner e71f1447f7 CSE simple binary expressions when they are inserted. This makes LSR produce
less huge code that needs to be cleaned up by sdisel.

llvm-svn: 35959
2007-04-13 05:04:18 +00:00
Lauro Ramos Venancio 749e4668e7 Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer c6251a7dfd For PR1284:
Implement the "part_set" intrinsic.

llvm-svn: 35938
2007-04-12 02:48:46 +00:00
Chris Lattner af039c53c0 improve the patch for PR1318 to also support grouped options with custom
handlers (like the pass list).  My previous fix only supported *new* command
line options, not additions to old ones.

This fixes test/Feature/load_module.ll

llvm-svn: 35935
2007-04-12 00:36:29 +00:00
Reid Spencer a472f66dd0 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer d3f622e0d5 Teach sys::Path how to recognize different kinds of object files for ELF
and Mach-O systems. Additionally, correct the Mach-O logic code to look at
byte 12 not byte 15. Hopefully this fixes the llvm-ld warning on Darwin.

llvm-svn: 35876
2007-04-11 02:02:09 +00:00
Bill Wendling f099841573 Add support for our first SSSE3 instruction "pmulhrsw".
llvm-svn: 35869
2007-04-10 22:10:25 +00:00
Chris Lattner b05e1727ef fix a comment bug Reid noticed
llvm-svn: 35864
2007-04-10 16:33:06 +00:00
Chris Lattner 2cc9c488e8 add missing methods, mark stuff const
llvm-svn: 35862
2007-04-10 07:06:21 +00:00
Chris Lattner 338bd30f19 getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
llvm-svn: 35861
2007-04-10 06:44:12 +00:00
Chris Lattner c43883c8a9 add a method
llvm-svn: 35860
2007-04-10 06:43:18 +00:00
Reid Spencer 782ae66e41 Drop the "bit" prefix for the part.select intrinsic.
llvm-svn: 35854
2007-04-10 02:52:46 +00:00
Chris Lattner 35f0417ec1 remove dead target hooks.
llvm-svn: 35847
2007-04-09 23:34:08 +00:00
Chris Lattner 39f65335d5 remove some dead target hooks, subsumed by isLegalAddressingMode
llvm-svn: 35840
2007-04-09 22:27:04 +00:00
Chris Lattner 288c994403 add a default ctor for AddrMode.
llvm-svn: 35832
2007-04-09 21:18:34 +00:00
Reid Spencer ce38beb6a4 For PR1146:
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.

llvm-svn: 35824
2007-04-09 18:00:57 +00:00
Reid Spencer 019c8869ed For PR1146:
* Add ParamAttrList pointers to Function and CallInst.
* Move the implementation of ParamAttrList from Type.cpp to Function.cpp

llvm-svn: 35818
2007-04-09 15:01:12 +00:00
Anton Korobeynikov 506eaf7915 Next stage into switch lowering refactoring
1. Fix some bugs in the jump table lowering threshold
2. Implement much better metric for optimal pivot selection
3. Tune thresholds for different lowering methods
4. Implement shift-and trick for lowering small (<machine word
length) cases with few destinations. Good testcase will follow.

llvm-svn: 35816
2007-04-09 12:31:58 +00:00
Reid Spencer 1ba12951e4 For PR1146:
Remove the handling of ParameterAttributes from FunctionType as they are
their own object defined in ParameterAttributes.h now.

llvm-svn: 35805
2007-04-09 06:06:57 +00:00
Owen Anderson 6978893a8f Move isReachableFromEntry out of line to avoid an unnecessary #include
llvm-svn: 35797
2007-04-09 04:07:36 +00:00
Reid Spencer bdcf9d6f08 Chris convinced me that the default size of the SmallVector (2) was too
small.  Since it doesn't cost much to have 2 more (8 bytes), but not having
them would require a malloc as soon as the third one is needed. Setting
the default to 4 delays the malloc until the 5th parameter attribute.

llvm-svn: 35793
2007-04-09 01:53:54 +00:00
Reid Spencer 389decb3a4 Remove redundancy.
llvm-svn: 35790
2007-04-09 01:26:02 +00:00
Owen Anderson ae39ca037a Cleanup some from my DomSet-removal changes. Add a new
isReachableFromEntry
test to ETForest to factor a common test out of code.

llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Reid Spencer db77ca7cc1 Fix a typo.
llvm-svn: 35781
2007-04-08 22:50:29 +00:00
Reid Spencer f71c15bda6 Implement more feedback:
* Allow attributes to be added and removed singly or jointly so that in
  the future something like -pruneh can manipulate them more easily.
* Move functions generally only useful for LLVM internals to the end of
  the accessors list instead of the beginning.

llvm-svn: 35780
2007-04-08 22:30:27 +00:00
Reid Spencer 0c19c91961 Implement review feedback.
llvm-svn: 35777
2007-04-08 22:05:44 +00:00
Owen Anderson fe507270ac Remove DomSet completely. This concludes work on PR1171.
llvm-svn: 35775
2007-04-08 21:30:05 +00:00
Reid Spencer 0d95160c6d Implement the output inserter for PathWithStatus
llvm-svn: 35770
2007-04-08 20:05:10 +00:00
Reid Spencer 3638a2375f For PR1146:
New header file to provide parameter attribute declarations.

llvm-svn: 35767
2007-04-08 14:46:50 +00:00
Reid Spencer 43340fee01 For PR1291:
Change to use PathWithStatus

llvm-svn: 35746
2007-04-07 19:50:21 +00:00
Reid Spencer ceeb918dd1 For PR1291:
Implement the PathWithStatus class and its use throughout lib/System.

llvm-svn: 35742
2007-04-07 18:52:17 +00:00
Owen Anderson f7ebea1b9f Add DomSet back, and revert the changes to LoopSimplify. Apparently the
ETForest updating mechanisms don't work as I thought they did.  These changes
will be reapplied once the issue is worked out.

llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Nick Lewycky b89804f246 Add signExtend to ConstantRange, to complement zeroExtend and truncate.
llvm-svn: 35733
2007-04-07 15:41:33 +00:00
Owen Anderson 8763ba1b88 Completely purge DomSet. This is the (hopefully) final patch for PR1171.
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson f095bf3ac4 Expunge DomSet from CodeExtractor. This is part of the continuing work
on PR1171.

llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Chris Lattner 45c0dce868 add loop rot
llvm-svn: 35722
2007-04-07 04:43:02 +00:00
Devang Patel f42389ffe5 Add loop rotation pass.
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner 5247f60d20 rearchitect the registration mechanism used by the command line option stuff.
This dramatically reduce the amount of memory allocated by the commandline stuff
at static init time, changing it to build local data structures when ParseCommandLineOptions
is called.  In a dummy empty program that links some llvm libraries, this reduces
the number of malloc'd bytes from 4864 to 3360 on entry to main.  Most of that
memory is now allocated by non-commandline related stuff.

llvm-svn: 35701
2007-04-06 21:06:55 +00:00
Chris Lattner d31e5155be Switch some vectors to smallvectors. This reduces amount of malloc'd
memory that occurs before main starts from 5104 to 4864 bytes with a dummy
example app.

llvm-svn: 35698
2007-04-06 18:36:18 +00:00
Chris Lattner 7bbcd122db Eliminate unneeded virtual methods
llvm-svn: 35697
2007-04-06 18:06:27 +00:00
Reid Spencer 8d529a18f4 For PR1209:
Implement Type class's ContainedTys without using a std::vector.

llvm-svn: 35693
2007-04-06 02:02:20 +00:00
Chris Lattner 91e66dc136 eliminate a virtual method
llvm-svn: 35691
2007-04-05 22:21:39 +00:00
Chris Lattner 2031b02faf remove the dead removeArgument method, rename Options to OptionsMap.
llvm-svn: 35690
2007-04-05 21:58:17 +00:00
Chris Lattner 9df6baa772 Add a helper class (APSInt) which can represent an APInt along with sign
information.  This is useful when a value does have a sign associated with
it.  This shouldn't be used generally in LLVM for mid-level optimizer stuff.

llvm-svn: 35681
2007-04-05 05:20:11 +00:00
Reid Spencer cce90f55ed Implement the llvm.bit.part_select.iN.iN.iN overloaded intrinsic.
llvm-svn: 35678
2007-04-04 23:48:25 +00:00
Lauro Ramos Venancio 6db5eb028c Fix release build.
llvm-svn: 35676
2007-04-04 22:13:39 +00:00
Anton Korobeynikov 915e61736b Properly emit range comparisons for switch cases, where neighbour cases
go to the same destination. Now we're producing really good code for
switch-lower-feature.ll testcase

llvm-svn: 35672
2007-04-04 21:14:49 +00:00
Evan Cheng 44a28f7d77 Add isFixedObjectIndex. It returns true if the stack slot index is for a fixed stack object.
llvm-svn: 35659
2007-04-04 07:38:25 +00:00
Reid Spencer 031fb8d4dc Make the LinkInFile and LinkInLibrary both return an indication of whether
the file was found to be a native library (and thus not linked by these
functions).

llvm-svn: 35652
2007-04-04 06:32:01 +00:00
Reid Spencer 6d211ab8ed For PR1302:
Make the FileType enumerators more readable and add COFF, ELF and Mach-O.

llvm-svn: 35649
2007-04-04 06:29:49 +00:00
Chris Lattner e7cc7c825b trivial optimization
llvm-svn: 35648
2007-04-04 06:18:21 +00:00
Chris Lattner adf83a3513 use calloc instead of new/memset, it is more efficient
llvm-svn: 35644
2007-04-04 00:44:31 +00:00
Chris Lattner c712a1322a Initialize the symbol table to zero explicitly. This ensures that the
symbol table does no allocations for prototypes or other lazily deserialized
functions, saving significant space and time.

llvm-svn: 35643
2007-04-04 00:30:49 +00:00