Commit Graph

5139 Commits

Author SHA1 Message Date
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
Chris Lattner 2376346a8e Extend StringMap to support being initialized as completely empty. When
initialized this way, they do not do a malloc to allocate their buckets.

llvm-svn: 35642
2007-04-04 00:29:37 +00:00
Bill Wendling ac5b650a54 Adding more MMX instructions.
llvm-svn: 35638
2007-04-03 23:48:32 +00:00
Bill Wendling e7b2a864f2 Add FEMMS and ADDQ. Renamed MMX recipes to prepend the MMX_ to them.
llvm-svn: 35616
2007-04-03 06:00:37 +00:00
Chris Lattner fae5c8fae9 add missing operator
llvm-svn: 35613
2007-04-03 04:25:46 +00:00
Chris Lattner 6b3ff17c70 add a helper function to constantint.
llvm-svn: 35610
2007-04-03 01:41:34 +00:00
Evan Cheng 476fb6a5c9 Ugh. Copy coalescer does not update register numbers.
llvm-svn: 35600
2007-04-02 18:49:18 +00:00
Chris Lattner d14447833a add a helper function.
llvm-svn: 35585
2007-04-02 05:41:00 +00:00
Chris Lattner 7c773e6850 add range version of insert()
llvm-svn: 35572
2007-04-02 01:21:19 +00:00
Zhou Sheng 63b6bc1c88 Remove unused methods.
llvm-svn: 35553
2007-04-01 12:45:33 +00:00
Reid Spencer eba021453b For PR1297:
Implement bswap, ctpop, ctlz, and cttz utilizing the new overloaded
intrinsic feature of tblgen. By defining llvm_int_ty to have an ValueType
of iAny, any intrinsic using that type becomes an overloaded intrinsic.
This signals that a) any integer type could be used for that argument and
b) the intrinsic needs a suffix to match each such argument for the
actual intrinsic.

llvm-svn: 35544
2007-04-01 07:30:57 +00:00
Reid Spencer c7c4880ab1 For PR1297:
Intrinsic functions might need to be generated (if they are overloaded) so
returning a const char* is no longer possible. Change getOperationName to
return a std::string instead.

llvm-svn: 35543
2007-04-01 07:28:37 +00:00
Reid Spencer be23fb0370 For PR1297:
Change the interface to the getName, getType, getDeclaration methods to
include the "actual" types of the result/arguments. This is necessary to
support overloaded intrinsics.

llvm-svn: 35542
2007-04-01 07:26:35 +00:00
Reid Spencer 51455e00dc For PR1297:
Add an "iAny" ValueType as a place holder for an integer type of any
bit width. This is used for intrinsics overloading on integer type.

llvm-svn: 35538
2007-04-01 07:17:45 +00:00
Chris Lattner f2836d17b6 Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Chris Lattner f2d71d49e2 switch TL::getValueType to use MVT::getValueType.
llvm-svn: 35527
2007-03-31 04:05:24 +00:00
Chris Lattner 516f38b35f add a method to turn a type into a VT.
llvm-svn: 35526
2007-03-31 04:03:02 +00:00
Chris Lattner ac3f81508c add one addressing mode description hook to rule them all.
llvm-svn: 35520
2007-03-30 23:14:50 +00:00
Zhou Sheng 02d3ac6895 Make sure this method just return value equal or less than Limit.
llvm-svn: 35509
2007-03-30 16:50:28 +00:00
Duncan Sands 3dd14331ac Correct typo.
llvm-svn: 35504
2007-03-30 06:39:42 +00:00
Zhou Sheng 9737575772 Rename and correct the method "greaterOrEqual".
llvm-svn: 35502
2007-03-30 05:10:59 +00:00
Zhou Sheng 12b3549f5d Add two utility methods into ConstantInt.
llvm-svn: 35501
2007-03-30 03:22:55 +00:00
Reid Spencer 200c6f9c3d For PR789:
Make the sys::Path::getFileStatus function more efficient by having it
return a pointer to the FileStatus structure rather than copy it. Adjust
uses of the function accordingly. Also, fix some memory issues in sys::Path.

llvm-svn: 35476
2007-03-29 19:05:44 +00:00
Chris Lattner c3f4d87c90 add a hook to demat functions.
llvm-svn: 35471
2007-03-29 18:30:26 +00:00
Jeff Cohen 73926a5fb5 uniqueID is a uint64_t (caught by VC++)
llvm-svn: 35465
2007-03-29 17:28:31 +00:00
Reid Spencer d394617a55 Add a uniqueID field to the FileStatus structure for Paths. This will map
to the inode number on Unix and something far less unique on Windows. The
windows case needs to be improved.

llvm-svn: 35461
2007-03-29 17:00:31 +00:00
Reid Spencer 858045e396 Don't forget to delete the FileStatus structure on destruction of Path.
llvm-svn: 35459
2007-03-29 16:50:49 +00:00
Reid Spencer 0f92f0e519 For PR789:
* Add a method: bool isAbsolute() const, which determines if the path name
  is absolute or not.
* Implement caching of file status information in the Path object. Allow it
  to be updated forcefully or lazily re-fetched from the cached value.

llvm-svn: 35456
2007-03-29 16:43:20 +00:00
Evan Cheng c2cba18f2b Remove isLegalAddressImmediate.
llvm-svn: 35406
2007-03-28 01:53:55 +00:00
Bill Wendling 5852729ce8 Add support for integer comparison builtins.
llvm-svn: 35384
2007-03-27 20:21:31 +00:00
Evan Cheng ec3ac316e2 Change findRegisterUseOperand() to return operand index instead.
llvm-svn: 35363
2007-03-26 22:37:45 +00:00
Dale Johannesen fd18a0cdf4 Fix reversed logic in getRegsUsed. Rename RegStates to RegsAvailable to
hopefully forestall similar errors.

llvm-svn: 35362
2007-03-26 22:23:54 +00:00
Bill Wendling 98d2104c6f Add support for the v1i64 type. This makes better code for this:
#include <mmintrin.h>

extern __m64 C;

void baz(__v2si *A, __v2si *B)
{
  *A = C;
  _mm_empty();
}

We get this:

_baz:
        call "L1$pb"
"L1$pb":
        popl %eax
        movl L_C$non_lazy_ptr-"L1$pb"(%eax), %eax
        movq (%eax), %mm0
        movl 4(%esp), %eax
        movq %mm0, (%eax)
        emms
        ret

GCC gives us this:

_baz:
        pushl   %ebx
        call    L3
"L00000000001$pb":
L3:
        popl    %ebx
        subl    $8, %esp
        movl    L_C$non_lazy_ptr-"L00000000001$pb"(%ebx), %eax
        movl    (%eax), %edx
        movl    4(%eax), %ecx
        movl    16(%esp), %eax
        movl    %edx, (%eax)
        movl    %ecx, 4(%eax)
        emms
        addl    $8, %esp
        popl    %ebx
        ret

llvm-svn: 35351
2007-03-26 07:53:08 +00:00
Chris Lattner 7a86dc5c27 Start value symbol tables out small (space for 16 elts), not huge (space for 512).
This is particularly useful for the JIT, which lazily deserializes functions.

llvm-svn: 35346
2007-03-26 01:45:35 +00:00
Reid Spencer 8314b16fc3 Compute getLowBitsSet correctly. Using the complement of a 64-bit value
and shifting down without regard for the bitwidth of the APInt can lead
to incorrect initialization values. Instead, check for the word size case
(to avoid undef results from shift) and then do (1 << loBitsSet) - 1

llvm-svn: 35344
2007-03-25 21:58:42 +00:00
Anton Korobeynikov 7037826c86 First step of switch lowering refactoring: perform worklist-driven
strategy, emit JT's where possible.

llvm-svn: 35338
2007-03-25 15:07:15 +00:00
Chris Lattner d685514e2e switch TargetLowering::getConstraintType to take the entire constraint,
not just the first letter.  No functionality change.

llvm-svn: 35322
2007-03-25 02:14:49 +00:00
Reid Spencer 9bb967ec5c Fix a typo in a comment.
llvm-svn: 35316
2007-03-25 01:13:46 +00:00
Reid Spencer d4e07f200a Actually, for getHighBitsSet and getLowBitsSet, don't make a 0 bit size
illegal. Instead do the 0 valued construction for the user. This is because
the caller may not know (or care to check) that the number of bits set is
zero.

llvm-svn: 35315
2007-03-25 00:01:47 +00:00
Reid Spencer 42fbb4fbe3 Make it illegal to set 0 bits in getHighBitsSet and getLowBitsSet. For that
they should have used the uint64_t constructor. This avoids causing
undefined results via shifts by the word size when the bit width is an
exact multiple of the word size.

llvm-svn: 35313
2007-03-24 23:47:58 +00:00
Reid Spencer 790631ff2d In the getBitsSet function, don't optimize for a common case that is
already covered by getLowBitsSet (i.e. when loBits==0). Consequently, remove
the default value for loBits and reorder the arguments to the more natural
loBits, hiBits order. This makes it more clear that this function is for bit
groups in the middle of the bit width and not towards one end or the other.

llvm-svn: 35312
2007-03-24 23:42:47 +00:00
Reid Spencer cf3a678d40 Don't invoke undefined behavior in shifts in the functions getHighBitsSet
and getLowBitsSet.

llvm-svn: 35311
2007-03-24 23:35:54 +00:00
Reid Spencer b334e8ac57 Implement the getBitsSet function.
llvm-svn: 35310
2007-03-24 23:27:48 +00:00
Reid Spencer 30e83dfc4b Implement the getHighBitsSet and getLowBitsSet functions.
llvm-svn: 35308
2007-03-24 23:05:35 +00:00
Reid Spencer 41eadeb49d Get the signs in the right place!
llvm-svn: 35307
2007-03-24 22:50:43 +00:00
Reid Spencer 709a820a53 Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in
the LangRef.html.

llvm-svn: 35305
2007-03-24 22:37:23 +00:00
Reid Spencer 3e51cacd4f Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.

llvm-svn: 35302
2007-03-24 21:56:22 +00:00
Reid Spencer 77859c2d49 Clean up this interface:
1. Group similar methods into doxygen groups
2. Reorganize the groups into a consist flow.
3. Significantly improve the quality of the documentation on several methods
4. Rewrite srem and sdiv to eliminate a copy and improve readability.
5. Eliminate unneeded forward references.

llvm-svn: 35300
2007-03-24 18:09:18 +00:00
Chris Lattner 7750e344d3 add a valuetype for v1i64, which is needed by mmx.
llvm-svn: 35298
2007-03-24 17:36:26 +00:00
Bill Wendling 3ab6e72143 This is dead. DEAD I tells you!!
llvm-svn: 35291
2007-03-23 22:42:04 +00:00
Bill Wendling 871c77cda1 PR1260:
Add final support to get the QT example to compile.

llvm-svn: 35290
2007-03-23 22:35:46 +00:00
Dan Gohman ac8fe43024 Add the 'explicit' keyword to several constructors that accept one
argument that don't appear intended as implicit-conversion operators.

llvm-svn: 35280
2007-03-23 18:44:11 +00:00
Bill Wendling 7c17fbc5b7 We generate a shufflevector instruction, so we don't need the builtin
intrinsic.

llvm-svn: 35269
2007-03-22 20:29:26 +00:00
Jeff Cohen d530a17cef Be more explicit concerning argument sizes.
Use VC++ byteswap intrinsics.

llvm-svn: 35267
2007-03-22 19:11:57 +00:00
Bill Wendling d551a18783 Support added for shifts and unpacking MMX instructions.
llvm-svn: 35266
2007-03-22 18:42:45 +00:00
Reid Spencer be7e9bc494 For PR1145:
Add the NoUnwindAttribute to allow explicit marking of functions that do
not unwind the stack via the unwind instruction. This is akin to gcc's
NoThrow attribute and used for optimizing exception handling.

llvm-svn: 35250
2007-03-22 00:32:02 +00:00
Reid Spencer 925e8aa370 Fix a comment.
llvm-svn: 35246
2007-03-21 22:22:19 +00:00
Dale Johannesen 0c6bb5eab7 repair x86 performance, dejagnu problems from previous change
llvm-svn: 35245
2007-03-21 21:51:52 +00:00
Dale Johannesen bacf4acf65 do not share old induction variables when this would result in invalid
instructions (that would have to be split later)

llvm-svn: 35227
2007-03-20 21:54:54 +00:00
Dale Johannesen d05a1a2ade maintain LiveIn when splitting blocks (register scavenging needs it)
llvm-svn: 35226
2007-03-20 21:35:06 +00:00
Devang Patel b39885d23d LoopSimplify::FindPHIToPartitionLoops()
Use ETForest instead of DominatorSet.

llvm-svn: 35222
2007-03-20 20:19:48 +00:00
Evan Cheng 0e3278e505 First cut trivial re-materialization support.
llvm-svn: 35208
2007-03-20 08:13:50 +00:00
Evan Cheng 61f39d186c Added MRegisterInfo hook to re-materialize an instruction.
llvm-svn: 35205
2007-03-20 08:09:38 +00:00
Zhou Sheng 4852dc1cd5 Correct the name: isStrictPositive --> isStrictlyPositive.
llvm-svn: 35201
2007-03-20 02:18:16 +00:00
Chris Lattner cc411d66d0 Add a dtor to fix leaks from all clients of BitVector.
llvm-svn: 35200
2007-03-20 02:10:56 +00:00
Reid Spencer 362fb29d80 Allow ConstantInt::get(Ty, uint64_t) to interpret the 64-bit values as a
negative number. This is needed to fix test/Assembler/2007-03-19-NegValue.ll

llvm-svn: 35181
2007-03-19 20:39:08 +00:00